From ceba8d47ba59f6f39484ac8115391825129744fe Mon Sep 17 00:00:00 2001 From: Geoff Jacobs Date: Wed, 21 Aug 2019 11:25:24 +1000 Subject: [PATCH] ITOPS-2059 adding tags to tasks which only apply to new stacks so they can be skipped by clones --- roles/database_init/tasks/main.yml | 6 ++++++ roles/nfs_server/defaults/main.yml | 4 ++-- roles/nfs_server/tasks/main.yml | 10 ++++++++-- roles/nfs_server/templates/media-atl.exports.j2 | 2 +- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/roles/database_init/tasks/main.yml b/roles/database_init/tasks/main.yml index b291ea5..99638f7 100644 --- a/roles/database_init/tasks/main.yml +++ b/roles/database_init/tasks/main.yml @@ -9,6 +9,8 @@ name: "{{ atl_jdbc_user }}" password: "{{ atl_jdbc_password }}" expires: 'infinity' + tags: + - new_only - name: Update root privs for new user postgresql_privs: @@ -19,6 +21,8 @@ roles: "{{ atl_db_root_user }}" objs: "{{ atl_jdbc_user }}" type: group + tags: + - new_only - name: Create application database postgresql_db: @@ -32,3 +36,5 @@ lc_collate: "{{ atl_jdbc_collation }}" lc_ctype: "{{ atl_jdbc_ctype }}" template: "{{ atl_jdbc_template }}" + tags: + - new_only diff --git a/roles/nfs_server/defaults/main.yml b/roles/nfs_server/defaults/main.yml index 4ac6f45..b66b23e 100644 --- a/roles/nfs_server/defaults/main.yml +++ b/roles/nfs_server/defaults/main.yml @@ -1,5 +1,5 @@ --- atl_nfs_server_device: "{{ lookup('env', 'ATL_NFS_SERVER_DEVICE') }}" -atl_nfs_fs_type: "xfs" -atl_nfs_fs_label: "BB-Shared" +atl_nfs_fs_type: "{{ lookup('env', 'ATL_NFS_FS_TYPE') or 'xfs' }}" +atl_nfs_fs_label: "{{ lookup('env', 'ATL_NFS_FS_LABEL') or 'BB-Shared' }}" diff --git a/roles/nfs_server/tasks/main.yml b/roles/nfs_server/tasks/main.yml index d032589..6cd4aff 100644 --- a/roles/nfs_server/tasks/main.yml +++ b/roles/nfs_server/tasks/main.yml @@ -17,6 +17,8 @@ number: 1 flags: - "{{ atl_nfs_fs_type }}" + tags: + - new_only - name: Create the filesystem @@ -24,6 +26,8 @@ dev: "{{ atl_nfs_server_device }}" fstype: "{{ atl_nfs_fs_type }}" opts: "-L {{ atl_nfs_fs_label }}" + tags: + - new_only - name: Setup fstab and mount the filesystem mount: @@ -33,13 +37,15 @@ state: mounted -- name: Create the shared home as BB mounts this directly +- name: Create the shared home file: - path: "{{ atl_shared_mountpoint }}/bitbucket/shared" + path: "{{ atl_shared_mountpoint }}/{{ atl_product_user }}/shared" state: directory owner: "{{ atl_product_user }}" group: "{{ atl_product_user }}" mode: 0750 + tags: + - new_only - name: Create the NFS export file diff --git a/roles/nfs_server/templates/media-atl.exports.j2 b/roles/nfs_server/templates/media-atl.exports.j2 index d4580e3..3a40c66 100644 --- a/roles/nfs_server/templates/media-atl.exports.j2 +++ b/roles/nfs_server/templates/media-atl.exports.j2 @@ -1,2 +1,2 @@ # Created by Ansible -/media/atl *(rw,no_root_squash) +/media/atl *(rw,no_root_squash,no_subtree_check,sync)