Only modify folders created by devstack
running chown and chmod on files and folders not created by
devstack causes a few issues:
* On nfs mounted directories it can take an extremely
long time to chown -R some of the git repos, especially
if any tox commands have been ran in the host
* chown can cause the host files to get into a weird state
if nfs is set up wrong.
If files and folders are pre-existing we should assume
they are in the correct state, and not modify them.
Fix setup-devstack-log-dir to create the logs directory with
correct permissions in the first place.
Change-Id: I5ebdaded3ffd0a5bc70c5e9ab5b18daefb358f58
Signed-off-by: Graham Hayes <gr@ham.ie>
diff --git a/roles/setup-devstack-log-dir/tasks/main.yaml b/roles/setup-devstack-log-dir/tasks/main.yaml
index b9f38df..d8e8cfe 100644
--- a/roles/setup-devstack-log-dir/tasks/main.yaml
+++ b/roles/setup-devstack-log-dir/tasks/main.yaml
@@ -2,4 +2,7 @@
file:
path: '{{ devstack_base_dir }}/logs'
state: directory
+ mode: 0755
+ owner: stack
+ group: stack
become: yes
diff --git a/roles/sync-devstack-data/tasks/main.yaml b/roles/sync-devstack-data/tasks/main.yaml
index e62be87..a1d37c3 100644
--- a/roles/sync-devstack-data/tasks/main.yaml
+++ b/roles/sync-devstack-data/tasks/main.yaml
@@ -46,3 +46,14 @@
dest: "{{ devstack_data_base_dir }}/data/"
mode: push
when: 'inventory_hostname in groups["subnode"]|default([])'
+
+- name: Ensure the data folder and subfolders have the correct permissions
+ become: true
+ file:
+ path: "{{ devstack_data_base_dir }}/data"
+ state: directory
+ owner: stack
+ group: stack
+ mode: 0755
+ recurse: yes
+ when: 'inventory_hostname in groups["subnode"]|default([])'