Extend ansible playbook
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Danny Bessems 2021-06-08 21:27:08 +02:00
parent d50bf402af
commit f33a99ad05
6 changed files with 45 additions and 22 deletions

View File

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

View File

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

View File

@ -0,0 +1,5 @@
- name: Disable & mask networkd-wait-online
ansible.builtin.systemd:
name: systemd-networkd-wait-online
enable: no
masked: yes

View File

@ -0,0 +1,6 @@
- name: Install additional packages
ansible.builtin.apt:
name: "{{ item }}"
state: latest
update_cache: yes
loop: "{{ packages }}"

View File

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

2
ansible/vars/main.yml Normal file
View File

@ -0,0 +1,2 @@
packages:
- ansible