Skip to content

Instantly share code, notes, and snippets.

@dnd
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dnd/8dd332ec66018a6f9c6a to your computer and use it in GitHub Desktop.
Save dnd/8dd332ec66018a6f9c6a to your computer and use it in GitHub Desktop.
bootstrap-linode-networking.sh
#!/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* "$@"
{% 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 %}
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