Packer.Images/ansible/roles/firstboot/tasks/main.yml

27 lines
709 B
YAML
Raw Normal View History

- name: Create destination folder
ansible.builtin.file:
path: /opt/firstboot
state: directory
2021-06-09 08:39:00 +00:00
- name: Create firstboot script file
ansible.builtin.template:
src: firstboot.j2
dest: /opt/firstboot/firstboot.sh
2021-06-08 19:56:06 +00:00
owner: root
group: root
mode: o+x
- name: Create @reboot crontab job
ansible.builtin.cron:
name: "firstboot"
special_time: reboot
2021-06-09 08:39:00 +00:00
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:
2021-06-09 08:39:56 +00:00
cmd: ansible-galaxy collection install community.general