From d6a6486886ce15b8a3c946c6251d37b697f66a1e Mon Sep 17 00:00:00 2001 From: caoyuan Date: Fri, 20 Apr 2018 23:16:08 +0800 Subject: [PATCH] Add owner and group when create directories Change-Id: Idb429823d48c4f40cf391151e8bb7478cc7d3631 --- ansible/roles/common/tasks/config.yml | 4 +++- ansible/roles/mistral/tasks/config.yml | 3 ++- ansible/roles/ovs-dpdk/tasks/config.yml | 4 +++- ansible/roles/swift/tasks/config.yml | 3 ++- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ansible/roles/common/tasks/config.yml b/ansible/roles/common/tasks/config.yml index bc5ec7d9f5..2ad3f2fc81 100644 --- a/ansible/roles/common/tasks/config.yml +++ b/ansible/roles/common/tasks/config.yml @@ -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" diff --git a/ansible/roles/mistral/tasks/config.yml b/ansible/roles/mistral/tasks/config.yml index 623bf03147..01b3dd415e 100644 --- a/ansible/roles/mistral/tasks/config.yml +++ b/ansible/roles/mistral/tasks/config.yml @@ -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] diff --git a/ansible/roles/ovs-dpdk/tasks/config.yml b/ansible/roles/ovs-dpdk/tasks/config.yml index 89c6d68b8b..9701a89b9d 100644 --- a/ansible/roles/ovs-dpdk/tasks/config.yml +++ b/ansible/roles/ovs-dpdk/tasks/config.yml @@ -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 diff --git a/ansible/roles/swift/tasks/config.yml b/ansible/roles/swift/tasks/config.yml index 670600201e..3d72639d7d 100644 --- a/ansible/roles/swift/tasks/config.yml +++ b/ansible/roles/swift/tasks/config.yml @@ -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: