Skip to content

Commit

Permalink
Group similar directory tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
eb4x committed Mar 25, 2024
1 parent 76e1ce9 commit d7fa33f
Showing 1 changed file with 12 additions and 26 deletions.
38 changes: 12 additions & 26 deletions roles/zabbix_proxy/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,41 +81,27 @@
- name: "Initialize the database"
ansible.builtin.include_tasks: "initialize-{{ zabbix_proxy_database }}.yml"

- name: "Create include dir zabbix-proxy"
- name: "Create directories"
ansible.builtin.file:
path: "{{ zabbix_proxy_include }}"
owner: "{{ zabbix_os_user }}"
group: "{{ zabbix_os_user }}"
mode: "{{ zabbix_proxy_include_mode }}"
state: directory
become: true
tags:
- install
- config

- name: "Create module dir zabbix-proxy"
ansible.builtin.file:
path: "{{ zabbix_proxy_loadmodulepath }}"
path: "{{ item.path }}"
owner: "{{ zabbix_os_user }}"
group: "{{ zabbix_os_user }}"
state: directory
mode: "0755"
mode: "{{ item.mode | default('0755') }}"
become: true
loop:
- path: "{{ zabbix_proxy_include }}"
mode: "{{ zabbix_proxy_include_mode }}"
- path: "{{ zabbix_proxy_loadmodulepath }}"
- required: "{{ zabbix_proxy_tlspskfile is defined }}"
path: "{{ zabbix_proxy_tlspskfile | default('/path/to/zabbix_proxy_tlspskfile/zabbix_proxy.psk') | dirname }}"
loop_control:
label: "{{ item.path }}"
when: item.required | default(true)
tags:
- install
- config

- name: "Create directory for PSK file if not exist."
ansible.builtin.file:
path: "{{ zabbix_proxy_tlspskfile | dirname }}"
mode: 0755
state: directory
become: true
when:
- zabbix_proxy_tlspskfile is defined
tags:
- config

- name: "Place TLS PSK File"
ansible.builtin.copy:
dest: "{{ zabbix_proxy_tlspskfile }}"
Expand Down

0 comments on commit d7fa33f

Please sign in to comment.