summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Belanger <pabelanger@redhat.com>2018-08-23 17:27:49 -0400
committerPaul Belanger <pabelanger@redhat.com>2018-08-23 17:27:49 -0400
commit28721e46e406fb2bda36ae13b5211ebf97884ae1 (patch)
tree86e3be856560f0564a827fc93f548ed1ed96fb52
parent4666971ac5c2d2ac612aa085a002c1db60be09f6 (diff)
Create nodepool_user_home_mode variable
and default the value to 0755. Change-Id: I2d5374c49d682a0e8b565e61d280e73fc4619863 Signed-off-by: Paul Belanger <pabelanger@redhat.com>
Notes
Notes (review): Code-Review+2: Paul Belanger <pabelanger@redhat.com> Workflow+1: Paul Belanger <pabelanger@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Thu, 23 Aug 2018 22:34:39 +0000 Reviewed-on: https://review.openstack.org/595893 Project: openstack/ansible-role-nodepool Branch: refs/heads/master
-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 }}"