diff --git a/ansible/roles/os/tasks/cloud-init.yml b/ansible/roles/os/tasks/cloud-init.yml new file mode 100644 index 0000000..50f7b5f --- /dev/null +++ b/ansible/roles/os/tasks/cloud-init.yml @@ -0,0 +1,14 @@ +- name: Delete cloud-init package + ansible.builtin.apt: + name: cloud-init + state: absent + purge: yes + # autoclean: yes + # autoremove: yes +- name: Delete cloud-init files + ansible.builtin.file: + path: "{{ item }}" + state: absent + loop: + - /etc/cloud + - /var/lib/cloud diff --git a/ansible/roles/os/tasks/main.yml b/ansible/roles/os/tasks/main.yml index acb9dba..8fb199e 100644 --- a/ansible/roles/os/tasks/main.yml +++ b/ansible/roles/os/tasks/main.yml @@ -1,23 +1,11 @@ -- name: Delete snapd package - ansible.builtin.apt: - name: snapd - state: absent - purge: yes -- name: Reload systemd unit configurations - ansible.builtin.systemd: - daemon_reload: yes +- name: Remove snapd + import_tasks: snapd.yml -- name: Delete cloud-init package - ansible.builtin.apt: - name: cloud-init - state: absent - purge: yes - # autoclean: yes - # autoremove: yes -- name: Delete cloud-init files - ansible.builtin.file: - path: "{{ item }}" - state: absent - loop: - - /etc/cloud - - /var/lib/cloud +- name: Remove cloud-init + import_tasks: cloud-init.yml + +- name: Configure network + import_tasks: network.yml + +- name: Install packages + import_tasks: packages.yml \ No newline at end of file diff --git a/ansible/roles/os/tasks/network.yml b/ansible/roles/os/tasks/network.yml new file mode 100644 index 0000000..6f26e46 --- /dev/null +++ b/ansible/roles/os/tasks/network.yml @@ -0,0 +1,5 @@ +- name: Disable & mask networkd-wait-online + ansible.builtin.systemd: + name: systemd-networkd-wait-online + enable: no + masked: yes diff --git a/ansible/roles/os/tasks/packages.yml b/ansible/roles/os/tasks/packages.yml new file mode 100644 index 0000000..c2fee3a --- /dev/null +++ b/ansible/roles/os/tasks/packages.yml @@ -0,0 +1,6 @@ +- name: Install additional packages + ansible.builtin.apt: + name: "{{ item }}" + state: latest + update_cache: yes + loop: "{{ packages }}" \ No newline at end of file diff --git a/ansible/roles/os/tasks/snapd.yml b/ansible/roles/os/tasks/snapd.yml new file mode 100644 index 0000000..6244566 --- /dev/null +++ b/ansible/roles/os/tasks/snapd.yml @@ -0,0 +1,8 @@ +- name: Delete snapd package + ansible.builtin.apt: + name: snapd + state: absent + purge: yes +- name: Reload systemd unit configurations + ansible.builtin.systemd: + daemon_reload: yes diff --git a/ansible/vars/main.yml b/ansible/vars/main.yml new file mode 100644 index 0000000..542abbd --- /dev/null +++ b/ansible/vars/main.yml @@ -0,0 +1,2 @@ +packages: + - ansible \ No newline at end of file