Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
ansible_callback.template.j2 836 B
# {{ ansible_managed }}

MAC_ADDR=`ip a |grep -B1 $(hostname -I)|grep ether |awk '{ print $2 }'`

rm -fr /etc/yum.repos.d/CentOS-*.repo
yum makecache
yum install -y python3

wget -O {{ autoinstall_awxkit_path }} {{ autoinstall_awxkit_binary_url }}
chmod a+x {{ autoinstall_awxkit_path }}
wget -O /tmp/awxconf {{ kickstart_url }}/awx_cli_config
source /tmp/awxconf
rm /tmp/awxconf

cd /root
echo -e "---\nautoinstall_boot_profile: localboot\nautoinstall_pxe_mac_addr: ${MAC_ADDR}\n" > extra.yaml
{{ autoinstall_awxkit_path }} -k job_template launch "{{ setboot_job }}"  --limit {{ autoinstall_server }} --monitor --extra_vars "@extra.yaml"
rm extra.yaml

wget -O /root/.firstboot.sh  {{ kickstart_url }}/firstboot.sh
chmod +x /root/.firstboot.sh

cp /etc/crontab /root/crontab.bkp
echo "@reboot root /root/.firstboot.sh" >> /etc/crontab