Last active
October 6, 2019 08:08
-
-
Save sierra-tango-echo/b9440bdede089e72e948737b0f7fe5ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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