summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--defaults/main.yaml1
-rw-r--r--molecule/tests/test_role.py2
-rw-r--r--tasks/pre.yaml10
3 files changed, 10 insertions, 3 deletions
diff --git a/defaults/main.yaml b/defaults/main.yaml
index 1bd7317..902f20c 100644
--- a/defaults/main.yaml
+++ b/defaults/main.yaml
@@ -23,6 +23,7 @@ nodepool_task_manager:
23nodepool_user_name: nodepool 23nodepool_user_name: nodepool
24nodepool_user_group: nodepool 24nodepool_user_group: nodepool
25nodepool_user_home: /var/lib/nodepool 25nodepool_user_home: /var/lib/nodepool
26nodepool_user_home_mode: 0755
26# nodepool_user_shell: 27# nodepool_user_shell:
27 28
28nodepool_file_nodepool_yaml_dest: /etc/nodepool/nodepool.yaml 29nodepool_file_nodepool_yaml_dest: /etc/nodepool/nodepool.yaml
diff --git a/molecule/tests/test_role.py b/molecule/tests/test_role.py
index 6b87e65..f3364f2 100644
--- a/molecule/tests/test_role.py
+++ b/molecule/tests/test_role.py
@@ -27,7 +27,7 @@ def test_nodepool_user(host):
27 assert f.is_directory 27 assert f.is_directory
28 assert f.user == 'nodepool' 28 assert f.user == 'nodepool'
29 assert f.group == 'nodepool' 29 assert f.group == 'nodepool'
30 # TODO(pabelanger): Validate mode 30 assert f.mode == 0o755
31 31
32 32
33def test_nodepool_config(host): 33def test_nodepool_config(host):
diff --git a/tasks/pre.yaml b/tasks/pre.yaml
index 067f9de..1b5da65 100644
--- a/tasks/pre.yaml
+++ b/tasks/pre.yaml
@@ -12,12 +12,12 @@
12# License for the specific language governing permissions and limitations 12# License for the specific language governing permissions and limitations
13# under the License. 13# under the License.
14--- 14---
15- name: Create group account. 15- name: Create group account
16 become: true 16 become: true
17 group: 17 group:
18 name: "{{ nodepool_user_group }}" 18 name: "{{ nodepool_user_group }}"
19 19
20- name: Create user account. 20- name: Create user account
21 become: true 21 become: true
22 user: 22 user:
23 createhome: true 23 createhome: true
@@ -25,3 +25,9 @@
25 home: "{{ nodepool_user_home }}" 25 home: "{{ nodepool_user_home }}"
26 name: "{{ nodepool_user_name }}" 26 name: "{{ nodepool_user_name }}"
27 shell: "{{ nodepool_user_shell|default(omit) }}" 27 shell: "{{ nodepool_user_shell|default(omit) }}"
28
29- name: Set permissions on home directory
30 become: true
31 file:
32 path: "{{ nodepool_user_home }}"
33 mode: "{{ nodepool_user_home_mode }}"