ansible-role-tinc/tasks/distribute.yml
Jannik Beyerstedt 120072e0d5 [TIDY] move when statements
Having the when condition of a task at the top instead of bottom is
easiert to read.
2022-02-13 20:42:31 +01:00

14 lines
440 B
YAML

---
# Tinc VPN Hostfile Distribution
- name: Distribute - Set different base dir for macOS
when: (override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Darwin"
ansible.builtin.set_fact:
tinc_base_dir: /usr/local/etc/tinc
- name: Distribute - Copy hostfiles to targets
become: yes
ansible.builtin.copy:
src: "{{ role_path }}/files/tmp/"
dest: "{{ tinc_base_dir }}/{{ tinc_vpn_id }}/hosts/"