Files
dc-deployments-automation/roles/bitbucket_mesh_config/tasks/mesh_setup.yml
2024-03-27 10:41:10 -05:00

44 lines
1.2 KiB
YAML

---
- name: Enforce correct permissions on mounted filesystems attached to atl_product_home
ansible.builtin.file:
path: "{{ item }}"
owner: "{{ atl_product_user }}"
group: "{{ atl_product_user }}"
mode: 0750
state: directory
recurse: no
with_items:
- "{{ atl_product_home }}"
- "{{ atl_product_home }}/caches"
- "{{ atl_product_home }}/log"
- name: Enforce the permissions on the pem files
ansible.builtin.file:
path: "{{ atl_product_home }}/config/{{ item }}"
state: touch
owner: "{{ atl_product_user }}"
group: "{{ atl_product_user }}"
mode: 0600
with_items:
- signing-key.pem
- control-plane.pem
register: pem_chown
failed_when:
- pem_chown.failed | bool
- "'No such file or directory' not in pem_chown.msg"
- name: Touch mesh.properties to make sure it exists
ansible.builtin.file:
state: touch
path: "{{ mesh_properties_file }}"
owner: "{{ atl_product_user }}"
group: "{{ atl_product_user }}"
mode: 0600
# check for lines starting with '!' and prefix them with #
- name: Prefix properties files bangs with hashes
ansible.builtin.replace:
path: "{{ mesh_properties_file }}"
regexp: '^(\!.*)$'
replace: '# \1'