[TIDY] move when statements
Having the when condition of a task at the top instead of bottom is easiert to read.
This commit is contained in:
parent
5553f66031
commit
120072e0d5
|
@ -2,9 +2,9 @@
|
|||
# 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
|
||||
when: (override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Darwin"
|
||||
|
||||
- name: Distribute - Copy hostfiles to targets
|
||||
become: yes
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
# Tinc VPN Setup and Configuration
|
||||
|
||||
- name: Main - 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
|
||||
when: (override_os_family is defined) | ternary(override_os_family,ansible_os_family) == "Darwin"
|
||||
|
||||
- name: Main - Install tinc
|
||||
ansible.builtin.include_tasks: "{{ item }}"
|
||||
|
@ -69,6 +69,7 @@
|
|||
flat: yes
|
||||
|
||||
- name: "Main - Enable {{ tinc_vpn_id }}"
|
||||
when: ansible_os_family != 'Darwin'
|
||||
become: yes
|
||||
block:
|
||||
- name: "Main - Enable {{ tinc_vpn_id }} in tinc config"
|
||||
|
@ -86,4 +87,3 @@
|
|||
name: "tinc@{{ tinc_vpn_id }}"
|
||||
state: restarted
|
||||
enabled: yes
|
||||
when: ansible_os_family != 'Darwin'
|
||||
|
|
Loading…
Reference in a new issue