Skip to content

Instantly share code, notes, and snippets.

@sierra-tango-echo
Last active October 6, 2019 08:08
Show Gist options
  • Select an option

  • Save sierra-tango-echo/b9440bdede089e72e948737b0f7fe5ca to your computer and use it in GitHub Desktop.

Select an option

Save sierra-tango-echo/b9440bdede089e72e948737b0f7fe5ca to your computer and use it in GitHub Desktop.
#!/bin/bash
#Install packages and enable
yum -y install cloud-init cloud-utils-growpart
systemctl enable cloud-init.service
#Use NoCloud datasource
cat << EOF > /etc/cloud/cloud.cfg.d/zz_flight.cfg
cloud_init_modules:
- disk_setup
- migrator
- bootcmd
- write-files
- growpart
- resizefs
- set_hostname
- update_hostname
- update_etc_hosts
- rsyslog
- users-groups
- ssh
- resolv_conf
datasource_list: [ NoCloud, None ]
EOF
#Let cloudinit take over network config
systemctl disable NetworkManager
find /etc/sysconfig/network-scripts/ifcfg-* | grep -v ifcfg-lo | while read f; do rm -fv $f; done
rm -fv /etc/resolv.conf
firewall-offline-cmd --set-default-zone trusted
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment