[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 # Tinc VPN Hostfile Distribution
- name: Distribute - Set different base dir for macOS - 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: ansible.builtin.set_fact:
tinc_base_dir: /usr/local/etc/tinc 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 - name: Distribute - Copy hostfiles to targets
become: yes become: yes

View file

@ -2,9 +2,9 @@
# Tinc VPN Setup and Configuration # Tinc VPN Setup and Configuration
- name: Main - Set different base dir for macOS - 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: ansible.builtin.set_fact:
tinc_base_dir: /usr/local/etc/tinc 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 - name: Main - Install tinc
ansible.builtin.include_tasks: "{{ item }}" ansible.builtin.include_tasks: "{{ item }}"
@ -69,6 +69,7 @@
flat: yes flat: yes
- name: "Main - Enable {{ tinc_vpn_id }}" - name: "Main - Enable {{ tinc_vpn_id }}"
when: ansible_os_family != 'Darwin'
become: yes become: yes
block: block:
- name: "Main - Enable {{ tinc_vpn_id }} in tinc config" - name: "Main - Enable {{ tinc_vpn_id }} in tinc config"
@ -86,4 +87,3 @@
name: "tinc@{{ tinc_vpn_id }}" name: "tinc@{{ tinc_vpn_id }}"
state: restarted state: restarted
enabled: yes enabled: yes
when: ansible_os_family != 'Darwin'