Extend ansible roles #2
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
This commit is contained in:
parent
d5c3e2c0b6
commit
4ea138fd69
@ -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
|
||||
|
@ -4,3 +4,4 @@
|
||||
become: true
|
||||
roles:
|
||||
- os
|
||||
- firstboot
|
||||
|
3
ansible/roles/firstboot/files/firstboot.sh
Normal file
3
ansible/roles/firstboot/files/firstboot.sh
Normal file
@ -0,0 +1,3 @@
|
||||
#!/bin/bash
|
||||
|
||||
# FOO
|
12
ansible/roles/firstboot/tasks/main.yml
Normal file
12
ansible/roles/firstboot/tasks/main.yml
Normal 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"
|
@ -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 }}"
|
||||
|
@ -1,5 +1,5 @@
|
||||
- name: Disable & mask networkd-wait-online
|
||||
ansible.builtin.systemd:
|
||||
name: systemd-networkd-wait-online
|
||||
enable: no
|
||||
enabled: no
|
||||
masked: yes
|
||||
|
@ -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
|
||||
|
@ -1,2 +1,3 @@
|
||||
packages:
|
||||
- ansible
|
||||
- libxml2-utils
|
||||
|
Loading…
Reference in New Issue
Block a user