diff options
| author | Ahmed Abdelhalim <[email protected]> | 2026-01-24 00:33:50 +0100 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2026-01-24 01:03:37 +0100 |
| commit | d7b3463a79a50dc81d28d530c5212a1749efbb15 (patch) | |
| tree | 198f009230b71c23275400826a2f60e50f01360a /roles/network/tasks | |
| parent | 4b9d5e3318d4de8df862f3794c6bc85eba6f8942 (diff) | |
Fix ansible 2.20.1 deprecation warning about ansible_vars
Diffstat (limited to 'roles/network/tasks')
| -rw-r--r-- | roles/network/tasks/main.yml | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/roles/network/tasks/main.yml b/roles/network/tasks/main.yml index a3483891..394ec688 100644 --- a/roles/network/tasks/main.yml +++ b/roles/network/tasks/main.yml @@ -1,9 +1,9 @@ --- - name: "Include OS-specific variables" - ansible.builtin.include_vars: "{{ ansible_distribution | lower }}.yml" + ansible.builtin.include_vars: "{{ ansible_facts['distribution'] | lower }}.yml" - name: "Include OS-specific tasks" - ansible.builtin.include_tasks: "install-{{ ansible_os_family | lower }}.yml" + ansible.builtin.include_tasks: "install-{{ ansible_facts['os_family'] | lower }}.yml" - name: "Validate network_ipv4_* params" ansible.builtin.assert: @@ -28,14 +28,14 @@ enabled: true state: "started" loop: "{{ network_enabled_services }}" - when: not ansible_is_chroot + when: not ansible_facts['is_chroot'] - name: "(chroot): Ensure network enabled services are enabled" ansible.builtin.command: cmd: "systemctl enable {{ item }}" changed_when: true loop: "{{ network_enabled_services }}" - when: ansible_is_chroot + when: ansible_facts['is_chroot'] # noqa: command-instead-of-module module doesn't work inside chroot - name: "Ensure network disabled services are masked" @@ -45,14 +45,14 @@ masked: true state: "stopped" loop: "{{ network_disabled_services }}" - when: not ansible_is_chroot + when: not ansible_facts['is_chroot'] - name: "(chroot): Ensure network disabled services are masked" ansible.builtin.command: cmd: "systemctl mask {{ item }}" changed_when: true loop: "{{ network_disabled_services }}" - when: ansible_is_chroot + when: ansible_facts['is_chroot'] # noqa: command-instead-of-module module doesn't work inside chroot - name: "Configure NetworkManager" |
