Files
dc-deployments-automation/roles/bitbucket_mesh_config/tasks/mesh_setup.yml
2024-03-25 14:38:23 -05:00

43 lines
1.1 KiB
YAML

---
- name: Create additional Bitbucket dirs if necessary
ansible.builtin.file:
path: "{{ item }}"
owner: "{{ atl_product_user }}"
group: "{{ atl_product_user }}"
mode: 0750
state: directory
recurse: no
with_items:
- "{{ 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'