Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cloud-init config:
- #cloud-config
- hostname: vpn-pritunl-clientvpn-01
- fqdn: vpn-pritunl-clientvpn-01.inf.us-west-2.aws.acme.com
- mounts:
- - [ephemeral0, null]
- runcmd:
- - /usr/local/sbin/set-hostname vpn-pritunl-clientvpn-01.inf.us-west-2.aws.acme.com vpn-pritunl-clientvpn-01
- - /usr/local/sbin/enable-salt-minion
- set-hostname:
- #!/bin/bash
- HOSTNAME=$1
- SHORTNAME=$2
- INTERNAL_IPADDRESS=`ip addr show eth0 | grep 'inet ' | awk '{ print $2 }' | cut -f1 -d/`
- echo >> /etc/hosts
- echo "$INTERNAL_IPADDRESS $HOSTNAME $SHORTNAME" >> /etc/hosts
- echo "$HOSTNAME" > /etc/hostname
- hostname $HOSTNAME
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement