summaryrefslogtreecommitdiffstats
path: root/utils/dev_env/deploy/p-master-user-data.template
diff options
context:
space:
mode:
authorwangyaoguang <sunshine.wang@huawei.com>2016-04-19 08:49:09 +0800
committerwangyaoguang <sunshine.wang@huawei.com>2016-04-19 09:02:07 +0800
commit177def06a663796302a9b50abe931ca56b64d413 (patch)
treeb41256b5d203237737917a189d24716865891760 /utils/dev_env/deploy/p-master-user-data.template
parente2b73bf29779412d3b0ceb7742e6a4bdcecb7f74 (diff)
Add a common tool for creating libvirt vms w/o puppet
1.It requires two argumets, input config and output folder. 2.It can bring libvirt vms with puppet and trusted ssh keys. 3.It can also bring normal libvirt vms. JIRA: BOTTLENECK-57 Change-Id: I47fd61c328b45d03b4d0daf25fd9e4fe79303f88 Signed-off-by: wangyaoguang <sunshine.wang@huawei.com>
Diffstat (limited to 'utils/dev_env/deploy/p-master-user-data.template')
-rw-r--r--utils/dev_env/deploy/p-master-user-data.template39
1 files changed, 39 insertions, 0 deletions
diff --git a/utils/dev_env/deploy/p-master-user-data.template b/utils/dev_env/deploy/p-master-user-data.template
new file mode 100644
index 00000000..446c9698
--- /dev/null
+++ b/utils/dev_env/deploy/p-master-user-data.template
@@ -0,0 +1,39 @@
+#cloud-config
+
+users:
+ - name: ubuntu
+ ssh-authorized-keys:
+REPLACED_TRUSTED_PUB_SSH_KEYS
+ - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCwmx8/86Vc1yqqplMPkm/w6wB2r5Yl6CjON85Ko5SzPEpnysJwO5ygbMClQTbzCUztIpFeO8D6xdWlhPmhMEJIWtRh+Dx0swB+ByMraGTP92xxKo2ukWzYI6eu25LmJX+a1lmVPmewQq+6dPzIwgCZvwD8UVe5L+d0EP2rb3iniQVoBzksUmhL3N6jp2Lgpscfi1yXFgjFdLpDsCcFcM+Q6wQUC2+qGBYa5RxqercWzISSbvAsYwC7UepmjFpcj3W/WX2QcOCDIlAzeURvC8PbOdzCtgeMhuhH2499BcIUSzPMpjzvpRiHr5SeF/zrPeW+2Ei1MfHi1qrBCxS8JBqt bottlenecks@bottlenecks.opnfv.org
+ sudo: ['ALL=(ALL) NOPASSWD:ALL']
+ groups: sudo
+ shell: /bin/bash
+
+runcmd:
+ - restart ssh
+ - wget https://apt.puppetlabs.com/puppetlabs-release-trusty.deb
+ - sudo dpkg -i puppetlabs-release-trusty.deb
+ - sudo apt-get update
+ - sudo apt-get -y install puppetserver
+ - sed -i '/^factpath/a basemodulepath=\/etc\/puppet\/modules' /etc/puppet/puppet.conf
+ - sed -i '/^factpath/a server=REPLACED_PUPPET_MASTER_SERVER' /etc/puppet/puppet.conf
+ - sed -i '/^factpath/a runinterval=1d' /etc/puppet/puppet.conf
+ - sed -i '/^templatedir/d' /etc/puppet/puppet.conf
+
+write_files:
+ - path: /etc/hosts
+ content: |
+ 127.0.0.1 localhost
+
+ # The following lines are desirable for IPv6 capable hosts
+ ::1 ip6-localhost ip6-loopback
+ fe00::0 ip6-localnet
+ ff00::0 ip6-mcastprefix
+ ff02::1 ip6-allnodes
+ ff02::2 ip6-allrouters
+ ff02::3 ip6-allhosts
+
+ # hosts info for all vms
+REPLACED_HOSTS_INFO
+
+final_message: "The system with puppet is finally up, after $UPTIME seconds."