From 527eddbb77b2d9b425354d3ca8e6367f272f2bc4 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Tue, 22 May 2012 13:37:30 -0400 Subject: [PATCH] Add upstart script to update puppet on boot. Change-Id: I42e45aac4aae9abf2ace051d53112ae6b0d8d0a9 --- manifests/site.pp | 1 + modules/puppetboot/files/puppetboot.conf | 13 +++++++++++++ modules/puppetboot/manifests/init.pp | 11 +++++++++++ 3 files changed, 25 insertions(+) create mode 100644 modules/puppetboot/files/puppetboot.conf create mode 100644 modules/puppetboot/manifests/init.pp diff --git a/manifests/site.pp b/manifests/site.pp index 2ea31b7..88b01d6 100644 --- a/manifests/site.pp +++ b/manifests/site.pp @@ -4,6 +4,7 @@ $jenkins_ssh_key = 'ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAtioTW2wh3mBRuj+R0Jyb/mLt class openstack_cron { include logrotate + include puppetboot cron { "updatepuppet": user => root, minute => "*/15", diff --git a/modules/puppetboot/files/puppetboot.conf b/modules/puppetboot/files/puppetboot.conf new file mode 100644 index 0000000..67d34a8 --- /dev/null +++ b/modules/puppetboot/files/puppetboot.conf @@ -0,0 +1,13 @@ +author "Monty Taylor " +description "Applying puppet config on boot" + +start on runlevel[2345] + +script + cd /root/openstack-ci-puppet/modules + /usr/bin/git pull --ff-only + echo "Running puppet on boot" >> /var/log/manifest.log + date >> /var/log/manifest.log + /usr/bin/puppet apply --modulepath=/root/openstack-ci-puppet/modules -l /var/log/manifest.log /root/openstack-ci-puppet/manifests/site.pp +end script + diff --git a/modules/puppetboot/manifests/init.pp b/modules/puppetboot/manifests/init.pp new file mode 100644 index 0000000..67809f0 --- /dev/null +++ b/modules/puppetboot/manifests/init.pp @@ -0,0 +1,11 @@ +class puppetboot { + file {'/etc/init/puppetboot.conf': + owner => 'root', + group => 'root', + mode => 644, + ensure => 'present', + source => [ + "puppet:///modules/puppetboot/puppetboot.conf", + ], + } +}