Last active
August 29, 2015 14:12
-
-
Save dnd/8dd332ec66018a6f9c6a to your computer and use it in GitHub Desktop.
bootstrap-linode-networking.sh
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 | |
echo "Setting hostname to: {{vm['name']}}" | |
echo '{{vm['name']}}' > /etc/hostname | |
hostname -F /etc/hostname | |
echo "Setting private interface address to: {{data['private_ips'][0]}}" | |
cat >>/etc/network/interfaces <<EOF | |
auto eth0:0 | |
iface eth0:0 inet static | |
address {{data['private_ips'][0]}} | |
netmask 255.255.128.0 | |
EOF | |
/etc/init.d/networking restart | |
ifdown eth0:0 && ifup eth0:0 | |
curl -L https://bootstrap.saltstack.com | sudo sh -s -- -c /tmp/.saltcloud* -k /tmp/.saltcloud* "$@" |
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
{% set datacenters = [ | |
{'name': 'dallas', 'city': 'Dallas, TX'}, | |
{'name': 'newark', 'city': 'Newark, NJ'}, | |
{'name': 'atlanta', 'city': 'Atlanta, GA'}, | |
{'name': 'fremont', 'city': 'Fremont, CA'} | |
] -%} | |
{% set sizes = [1024, 2048, 4096, 8192, 16384, 32768] -%} | |
{% for datacenter in datacenters -%} | |
{% for size in sizes -%} | |
linode_{{datacenter.name}}_{{size}}: | |
provider: linode | |
image: Ubuntu 14.04 LTS | |
size: Linode {{size}} | |
location: {{datacenter.city}}, USA | |
grains: | |
location: {{datacenter.name}} | |
{% endfor -%} | |
{%- endfor %} |
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
linode: | |
provider: linode | |
apikey: {{provider.apikey}} | |
password: {{provider.password}} | |
private_ip: True | |
script: bootstrap-linode-networking.sh | |
script_args: 'git 2014.7' | |
minion: | |
master: {{master}} | |
grains: | |
provider: linode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment