Extend ansible roles #2
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Danny Bessems 2021-06-08 21:56:06 +02:00
parent d5c3e2c0b6
commit 4ea138fd69
8 changed files with 31 additions and 4 deletions

View File

@ -26,7 +26,10 @@ steps:
sed -i -e "s/<<img-password>>/$${SSH_PASSWORD}/g" \ sed -i -e "s/<<img-password>>/$${SSH_PASSWORD}/g" \
packer/preseed/UbuntuServer20.04/user-data packer/preseed/UbuntuServer20.04/user-data
- | - |
yamllint -d "{extends: relaxed, rules: {line-length: disable}}" ansible packer/preseed/UbuntuServer20.04/user-data scripts yamllint -d "{extends: relaxed, rules: {line-length: disable}}" \
ansible \
packer/preseed/UbuntuServer20.04/user-data \
scripts
- | - |
packer init -upgrade \ packer init -upgrade \
./packer ./packer

View File

@ -4,3 +4,4 @@
become: true become: true
roles: roles:
- os - os
- firstboot

View File

@ -0,0 +1,3 @@
#!/bin/bash
# FOO

View File

@ -0,0 +1,12 @@
- name: Copy firstboot script file
ansible.builtin.copy:
src: firstboot.sh
dest: /opt/firstboot.sh
owner: root
group: root
mode: o+x
- name: Create @reboot crontab job
ansible.builtin.cron:
name: "firstboot"
special_time: reboot
job: "/opt/firstboot.sh"

View File

@ -3,8 +3,6 @@
name: cloud-init name: cloud-init
state: absent state: absent
purge: yes purge: yes
# autoclean: yes
# autoremove: yes
- name: Delete cloud-init files - name: Delete cloud-init files
ansible.builtin.file: ansible.builtin.file:
path: "{{ item }}" path: "{{ item }}"

View File

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

View File

@ -4,3 +4,12 @@
state: latest state: latest
update_cache: yes update_cache: yes
loop: "{{ packages }}" loop: "{{ packages }}"
- name: Upgrade all packages
ansible.builtin.apt:
name: "*"
state: latest
update_cache: yes
- name: Cleanup
ansible.builtin.apt:
autoclean: yes
autoremove: yes

View File

@ -1,2 +1,3 @@
packages: packages:
- ansible - ansible
- libxml2-utils