You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a setup script to automate the setup and provisioning of Ubuntu servers. It does the following:
3
5
* Adds a new user account with sudo access
4
6
* Adds a public ssh key for the new user account
@@ -40,4 +42,8 @@ cat ~/.ssh/id_rsa.pub
40
42
Finally, you will be prompted to specify a [timezone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) for the server. It will be set to 'Asia/Singapore' if you do not specify a value.
41
43
42
44
# Supported versions
43
-
This setup script has been tested against Ubuntu 14.04 and Ubuntu 16.04.
45
+
This setup script has been tested against Ubuntu 14.04 and Ubuntu 16.04.
46
+
47
+
# Running tests
48
+
Tests are run against a set of Vagrant VMs. To run the tests, run the following in the project's directory:
@@ -27,29 +40,35 @@ function testUserAccountCreated() {
27
40
}
28
41
29
42
functiontestIfUserIsSudo() {
30
-
local user_access
31
-
user_access="$(sudo -l -U ${test_user_account})"
32
-
assertContains "(ALL : ALL) ALL""${user_access}"
43
+
if [[ $SKIP_SETUP!=true ]];then
44
+
local user_access
45
+
user_access="$(sudo -l -U ${test_user_account})"
46
+
assertContains "(ALL : ALL) ALL""${user_access}"
47
+
fi
33
48
}
34
49
35
50
functiontestAddingOfSSHKey() {
36
-
disableSudoPassword "${test_user_account}"
51
+
if [[ $SKIP_SETUP!=true ]];then
52
+
disableSudoPassword "${test_user_account}"
37
53
38
-
local dummy_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBGTO0tsVejssuaYR5R3Y/i73SppJAhme1dH7W2c47d4gOqB4izP0+fRLfvbz/tnXFz4iOP/H6eCV05hqUhF+KYRxt9Y8tVMrpDZR2l75o6+xSbUOMu6xN+uVF0T9XzKcxmzTmnV7Na5up3QM3DoSRYX/EP3utr2+zAqpJIfKPLdA74w7g56oYWI9blpnpzxkEd3edVJOivUkpZ4JoenWManvIaSdMTJXMy3MtlQhva+j9CgguyVbUkdzK9KKEuah+pFZvaugtebsU+bllPTB0nlXGIJk98Ie9ZtxuY3nCKneB+KjKiXrAvXUPCI9mWkYS/1rggpFmu3HbXBnWSUdf [email protected]"
39
-
addSSHKey "${test_user_account}""${dummy_key}"
54
+
local dummy_key="ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDBGTO0tsVejssuaYR5R3Y/i73SppJAhme1dH7W2c47d4gOqB4izP0+fRLfvbz/tnXFz4iOP/H6eCV05hqUhF+KYRxt9Y8tVMrpDZR2l75o6+xSbUOMu6xN+uVF0T9XzKcxmzTmnV7Na5up3QM3DoSRYX/EP3utr2+zAqpJIfKPLdA74w7g56oYWI9blpnpzxkEd3edVJOivUkpZ4JoenWManvIaSdMTJXMy3MtlQhva+j9CgguyVbUkdzK9KKEuah+pFZvaugtebsU+bllPTB0nlXGIJk98Ie9ZtxuY3nCKneB+KjKiXrAvXUPCI9mWkYS/1rggpFmu3HbXBnWSUdf [email protected]"
0 commit comments