diff options
| author | Ahmed Abdelhalim <[email protected]> | 2026-02-04 22:12:57 +0100 |
|---|---|---|
| committer | Ahmed Abdelhalim <[email protected]> | 2026-02-04 22:12:57 +0100 |
| commit | d4901fdfca954d7a8c392fdb20d871e3ef116813 (patch) | |
| tree | 305faa6f03fc71d22755a88ba6ccd4baa65915a4 /roles | |
| parent | 00893e614b16b3a98f0c0275f817addbf8b9a159 (diff) | |
Adapt playbook to ansible 2.24+
Diffstat (limited to 'roles')
| -rw-r--r-- | roles/bootstrap/tasks/install-ubuntu.yml | 2 | ||||
| -rw-r--r-- | roles/bootstrap/tasks/main.yml | 8 | ||||
| -rw-r--r-- | roles/configure/tasks/install-ansible.yml | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/roles/bootstrap/tasks/install-ubuntu.yml b/roles/bootstrap/tasks/install-ubuntu.yml index 7757b18..a121fe8 100644 --- a/roles/bootstrap/tasks/install-ubuntu.yml +++ b/roles/bootstrap/tasks/install-ubuntu.yml @@ -1,6 +1,6 @@ --- - name: "Include distribution vars" - ansible.builtin.include_vars: "{{ ansible_distribution | lower }}.yml" + ansible.builtin.include_vars: "{{ ansible_facts['distribution'] | lower }}.yml" - name: "Ensure install dependencies are installed on live environment" ansible.builtin.apt: diff --git a/roles/bootstrap/tasks/main.yml b/roles/bootstrap/tasks/main.yml index f74e743..cc35056 100644 --- a/roles/bootstrap/tasks/main.yml +++ b/roles/bootstrap/tasks/main.yml @@ -7,18 +7,18 @@ - name: "Install archlinux" ansible.builtin.include_tasks: "install-archlinux.yml" - when: ansible_os_family == "Archlinux" + when: ansible_facts['os_family'] == "Archlinux" - name: "Install debian" - when: ansible_os_family == "Debian" + when: ansible_facts['os_family'] == "Debian" block: - name: "Install ubuntu" ansible.builtin.include_tasks: "install-ubuntu.yml" - when: ansible_distribution == "Ubuntu" + when: ansible_facts['distribution'] == "Ubuntu" - name: "Install raspberry" ansible.builtin.include_tasks: "install-raspberry.yml" - when: ansible_distribution == "Debian" and ansible_architecture == "aarch64" + when: ansible_facts['distribution'] == "Debian" and ansible_facts['architecture'] == "aarch64" - name: "Ensure ansible dependencies are installed in chroot" ansible.builtin.command: diff --git a/roles/configure/tasks/install-ansible.yml b/roles/configure/tasks/install-ansible.yml index c9894a9..80d095b 100644 --- a/roles/configure/tasks/install-ansible.yml +++ b/roles/configure/tasks/install-ansible.yml @@ -5,7 +5,7 @@ - "python3" - "python-packaging" state: present - when: ansible_os_family == "Archlinux" + when: ansible_facts['os_family'] == "Archlinux" - name: "Ensure ansible dependencies are installed on live environment" ansible.builtin.apt: @@ -13,7 +13,7 @@ - "python3" - "python3-packaging" state: "present" - when: ansible_os_family == "Debian" + when: ansible_facts['os_family'] == "Debian" # Workaround ansible.builtin.pip not working on live environment, # after giving up on fixing it, now we install pip manually and use the commands to setup ansible |
