Extend ansible roles #2
continuous-integration/drone/push Build is failing Details

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" \
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

View File

@ -4,3 +4,4 @@
become: true
roles:
- 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
state: absent
purge: yes
# autoclean: yes
# autoremove: yes
- name: Delete cloud-init files
ansible.builtin.file:
path: "{{ item }}"

View File

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

View File

@ -4,3 +4,12 @@
state: latest
update_cache: yes
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:
- ansible
- libxml2-utils