feat: golden-image build support (cloud-init on EL, selinux relabel, SSH wait)
This commit is contained in:
16
main.yml
16
main.yml
@@ -141,6 +141,15 @@
|
||||
ansible_ssh_extra_args: "-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
|
||||
ansible_python_interpreter: /usr/bin/python3
|
||||
|
||||
- name: Wait for the rebooted host to accept SSH
|
||||
when:
|
||||
- post_reboot_can_connect | bool
|
||||
ansible.builtin.wait_for_connection:
|
||||
delay: 5
|
||||
sleep: 5
|
||||
# 600s: a selinux-enabled first boot relabels the filesystem and reboots once more.
|
||||
timeout: 600
|
||||
|
||||
- name: Re-gather facts for target OS after reboot
|
||||
when:
|
||||
- post_reboot_can_connect | bool
|
||||
@@ -150,6 +159,13 @@
|
||||
- min
|
||||
- pkg_mgr
|
||||
|
||||
- name: Register with the Satellite content source
|
||||
when:
|
||||
- post_reboot_can_connect | bool
|
||||
- system_cfg.content.source == 'satellite'
|
||||
- system_cfg.os | lower in os_family_rhel
|
||||
ansible.builtin.include_tasks: "{{ playbook_dir }}/roles/configuration/tasks/satellite_register.yml"
|
||||
|
||||
- name: Install post-reboot packages
|
||||
when:
|
||||
- post_reboot_can_connect | bool
|
||||
|
||||
Reference in New Issue
Block a user