packer-builds

Packer Builds for LXC and Libvirt
git clone https://git.in0rdr.ch/packer-builds.git
Log | Files | Refs | Pull requests |Archive | README

cloud-config.sh (580B)


      1 #!/usr/bin/env bash
      2 
      3 set -o errexit
      4 set -o nounset
      5 #set -o xtrace
      6 
      7 # install cloud-init
      8 yum install -y cloud-init cloud-utils-growpart
      9 
     10 # disable cloud-init
     11 #touch /etc/cloud/cloud-init.disabled
     12 # reset cloud-init
     13 #rm -rf /var/lib/cloud
     14 
     15 # change cloud-init default user
     16 sed -i \
     17   -e 's/name: cloud-user/name: centos/' \
     18   /etc/cloud/cloud.cfg
     19 
     20 # resolve fqdn/hostname to public address
     21 sed -i \
     22   -e 's/127.0.0.1 {{fqdn}} {{hostname}}/#127.0.0.1 {{fqdn}} {{hostname}}/' \
     23   -e 's/::1 {{fqdn}} {{hostname}}/#::1 {{fqdn}} {{hostname}}/' \
     24   /etc/cloud/templates/hosts.redhat.tmpl