Add owner and group when create directories

Change-Id: Idb429823d48c4f40cf391151e8bb7478cc7d3631
This commit is contained in:
caoyuan 2018-04-20 23:16:08 +08:00
parent c6967c8b1f
commit d6a6486886
4 changed files with 10 additions and 4 deletions

View File

@ -3,7 +3,9 @@
file:
path: "{{ node_config_directory }}/{{ item }}"
state: "directory"
recurse: yes
owner: "{{ config_owner_user }}"
group: "{{ config_owner_group }}"
mode: "0770"
become: true
with_items:
- "kolla-toolbox"

View File

@ -3,7 +3,8 @@
file:
path: "{{ node_config_directory }}/{{ item.key }}"
state: "directory"
recurse: yes
owner: "{{ config_owner_user }}"
group: "{{ config_owner_group }}"
mode: "0770"
become: true
when: inventory_hostname in groups[item.value.group]

View File

@ -3,7 +3,9 @@
file:
path: "{{ node_config_directory }}/{{ item.key }}"
state: "directory"
recurse: yes
owner: "{{ config_owner_user }}"
group: "{{ config_owner_group }}"
mode: "0770"
when:
- item.value.enabled | bool
- item.value.host_in_groups | bool

View File

@ -3,7 +3,8 @@
file:
path: "{{ node_config_directory }}/{{ item }}"
state: "directory"
recurse: yes
owner: "{{ config_owner_user }}"
group: "{{ config_owner_group }}"
mode: "0770"
become: true
with_items: