From 857f5b7f8e04f55f3a4c2b453fdd62782e265d56 Mon Sep 17 00:00:00 2001 From: Michael Chapman Date: Tue, 25 Jun 2013 13:16:06 +1000 Subject: [PATCH] Allow multiple runs of basic test. Move package installs of git vim curl and cobbler into the initial puppet run, and do this before the cobbler pre-import --- Vagrantfile | 5 +++-- manifests/setup.pp | 2 +- tests/basic_test.sh | 10 ++++++++-- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index de978ba..a2b06bf 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -197,9 +197,11 @@ Vagrant::Config.run do |config| end config.vm.provision :shell do |shell| - shell.inline = "%s apt-get update; dhclient -r eth0 && dhclient eth0; apt-get install -y git vim curl;" % apt_cache_proxy + shell.inline = "%s apt-get update; dhclient -r eth0 && dhclient eth0;" % apt_cache_proxy end + apply_manifest(config, v_config, 'setup.pp') + # pre-import the ubuntu image if we are using a custom mirror if v_config['apt-mirror'] != 'us.archive.ubuntu.com' config.vm.provision :shell do |shell| @@ -207,7 +209,6 @@ Vagrant::Config.run do |config| end end - apply_manifest(config, v_config, 'setup.pp') apply_manifest(config, v_config) # Configure puppet diff --git a/manifests/setup.pp b/manifests/setup.pp index 181c27b..d3fbdb9 100644 --- a/manifests/setup.pp +++ b/manifests/setup.pp @@ -50,6 +50,6 @@ file { '/root/run_puppet.sh': puppet apply --modulepath /etc/puppet/modules-0/ --certname ${clientcert} /etc/puppet/manifests/site.pp $*" } -package { ['git', 'curl', 'vim']: +package { ['git', 'curl', 'vim', 'cobbler']: ensure => present, } diff --git a/tests/basic_test.sh b/tests/basic_test.sh index 5cd9db2..529795e 100755 --- a/tests/basic_test.sh +++ b/tests/basic_test.sh @@ -14,10 +14,16 @@ ret=0 datestamp=`date "+%Y%m%d%H%M%S"` # install librarian-puppet-simple -mkdir vendor +mkdir -p vendor export GEM_HOME=`pwd`/vendor gem install thor --no-ri --no-rdoc -git clone git://github.com/bodepd/librarian-puppet-simple vendor/librarian-puppet-simple +if [ -d vendor/librarian-puppet-simple ]; then + cd vendor/librarian-puppet-simple + git pull + cd ../.. +else + git clone git://github.com/bodepd/librarian-puppet-simple vendor/librarian-puppet-simple +fi export PATH=`pwd`/vendor/librarian-puppet-simple/bin/:$PATH # puppet_repos_to_use