1 # make system modifications to handle being on a private Rackspace network
4 notice ("Operating system detected is: '${::operatingsystem} ${::operatingsystemrelease}'")
6 notice ("Subdomain being used is: '${::subdomain}'")
8 # configure nameservers for domains
15 $router = '10.30.11.1'
18 $router = '10.30.12.1'
21 fail("Unrecognized subdomain ${::subdomain}")
28 $router = '10.30.32.1'
31 fail("Unrecognized subdomain ${::subdomain}")
38 # Setup dnsmasq special domain handlers
39 dnsmasq::conf { 'LF-ns1':
41 content => 'server=/linux-foundation.org/172.17.192.30',
44 dnsmasq::conf { 'LF-ns2':
46 content => 'server=/linux-foundation.org/172.17.192.31',
49 dnsmasq::conf { 'ODL-ns1':
51 content => 'server=/opendaylight.org/172.17.192.30',
54 dnsmasq::conf { 'ODL-ns2':
56 content => 'server=/opendaylight.org/172.17.192.31',
59 dnsmasq::conf { 'ODLForge-ns1':
61 content => 'server=/odlforge.org/172.17.192.30',
64 dnsmasq::conf { 'ODLForge-ns2':
66 content => 'server=/odlforge.org/172.17.192.31',
70 file { '/etc/resolv.conf':
71 content => "search ${::subdomain}
79 file { '/etc/cloud/cloud.cfg.d/00_lf_resolv.cfg':
80 content => "#cloud-config
82 manage_resolv_conf: true
85 nameservers: ['127.0.0.1', '${ns1}', '${ns2}']
93 file_line { 'add_resolver':
94 path => '/etc/cloud/cloud.cfg.d/10_rackspace.cfg',
95 line => ' - resolv_conf',
96 after => ' - update_etc_hosts',
99 # OS specific configuration
100 case $::operatingsystem {
101 'CentOS', 'Fedora', 'RedHat': {
102 file { '/etc/sysconfig/network-scripts/route-eth0':
103 content => "default via ${router} dev eth0",
106 # disable the DNS peerage so that our resolv.conf doesn't
108 file_line { 'disable_peerdns':
109 path => '/etc/sysconfig/network',
110 line => 'PEERDNS=no',
114 file { '/etc/network/if-up.d/0000routing':
115 content => "#!/bin/sh\nip route add default via ${router} dev eth0",
120 notice ("${::operatingsystem} is not supported by this configuration")