Migrate to new apps role
This commit is contained in:
31
roles/apps/tasks/configs.yml
Normal file
31
roles/apps/tasks/configs.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
- name: Create app directories
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.dest }}"
|
||||
state: directory
|
||||
mode: "0755"
|
||||
owner: "{{ item.owner | default(omit) }}"
|
||||
group: "{{ item.group | default(omit) }}"
|
||||
loop: "{{ apps_directories }}"
|
||||
become: "{{ item.owner is defined and item.owner == 'root' }}"
|
||||
when: apps_directories is defined and apps_directories | length > 0
|
||||
|
||||
- name: Create parent directories for config files
|
||||
ansible.builtin.file:
|
||||
path: "{{ item.dest | dirname }}"
|
||||
state: directory
|
||||
mode: '0755'
|
||||
loop: "{{ apps_configs }}"
|
||||
become: "{{ item.owner is defined and item.owner == 'root' }}"
|
||||
when: apps_configs is defined and apps_configs | length > 0
|
||||
|
||||
- name: Deploy configuration templates
|
||||
ansible.builtin.copy:
|
||||
content: "{{ item.content }}"
|
||||
dest: "{{ item.dest }}"
|
||||
mode: "{{ item.mode | default('0644') }}"
|
||||
owner: "{{ item.owner | default(omit) }}"
|
||||
group: "{{ item.group | default(omit) }}"
|
||||
backup: "{{ item.backup | default(false) }}"
|
||||
loop: "{{ apps_configs }}"
|
||||
become: "{{ item.owner is defined and item.owner == 'root' }}"
|
||||
when: apps_configs is defined and apps_configs | length > 0
|
||||
Reference in New Issue
Block a user