[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:
Jannik Beyerstedt 2022-02-13 20:42:31 +01:00
parent 5553f66031
commit 120072e0d5
2 changed files with 3 additions and 3 deletions

View File

@ -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

View File

@ -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'