Packer.Images/ansible/roles/firstboot/tasks/main.yml
djpbessems 990534618b
All checks were successful
continuous-integration/drone/push Build is passing
Housekeeping;Disable crontab w/ reboot-followup
2021-06-09 22:49:14 +02:00

27 lines
707 B
YAML

- name: Create destination folder
ansible.builtin.file:
path: /opt/firstboot
state: directory
- name: Create firstboot script file
ansible.builtin.template:
src: firstboot.j2
dest: /opt/firstboot/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/firstboot.sh"
- name: Copy payload folder
ansible.builtin.copy:
src: ansible_payload/
dest: /opt/firstboot/ansible/
owner: root
group: root
mode: '0644'
- name: Install ansible-galaxy collection
ansible.builtin.shell:
cmd: ansible-galaxy collection install community.general