Create nodepool_user_home_mode variable

and default the value to 0755.

Change-Id: I2d5374c49d682a0e8b565e61d280e73fc4619863
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
This commit is contained in:
Paul Belanger 2018-08-23 17:27:49 -04:00
parent 4666971ac5
commit 28721e46e4
3 changed files with 10 additions and 3 deletions

View File

@ -23,6 +23,7 @@ nodepool_task_manager:
nodepool_user_name: nodepool
nodepool_user_group: nodepool
nodepool_user_home: /var/lib/nodepool
nodepool_user_home_mode: 0755
# nodepool_user_shell:
nodepool_file_nodepool_yaml_dest: /etc/nodepool/nodepool.yaml

View File

@ -27,7 +27,7 @@ def test_nodepool_user(host):
assert f.is_directory
assert f.user == 'nodepool'
assert f.group == 'nodepool'
# TODO(pabelanger): Validate mode
assert f.mode == 0o755
def test_nodepool_config(host):

View File

@ -12,12 +12,12 @@
# License for the specific language governing permissions and limitations
# under the License.
---
- name: Create group account.
- name: Create group account
become: true
group:
name: "{{ nodepool_user_group }}"
- name: Create user account.
- name: Create user account
become: true
user:
createhome: true
@ -25,3 +25,9 @@
home: "{{ nodepool_user_home }}"
name: "{{ nodepool_user_name }}"
shell: "{{ nodepool_user_shell|default(omit) }}"
- name: Set permissions on home directory
become: true
file:
path: "{{ nodepool_user_home }}"
mode: "{{ nodepool_user_home_mode }}"