Add ability to configure installed openstack version
perform a hiera lookup for the openstack_version to use to setup the appropriate packages(for ubuntu). Ensure that setup/hosts.pp is run before (and not from within) setup/os.pp. This is b/c hiera is not required to be installed before the os specific setup manifest is run.
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -8,3 +8,4 @@ Puppetfile.lock
|
|||||||
my.log
|
my.log
|
||||||
*swp
|
*swp
|
||||||
logs
|
logs
|
||||||
|
hiera_data/jenkins.yaml
|
||||||
|
|||||||
18
Vagrantfile
vendored
18
Vagrantfile
vendored
@@ -185,6 +185,15 @@ Vagrant::Config.run do |config|
|
|||||||
puppet_options = ["--certname=#{node_name}"]
|
puppet_options = ["--certname=#{node_name}"]
|
||||||
puppet_options.merge!({'--verbose', '--show_diff'}) if v_config['verbose']
|
puppet_options.merge!({'--verbose', '--show_diff'}) if v_config['verbose']
|
||||||
|
|
||||||
|
# configure hosts, install hiera
|
||||||
|
# perform pre-steps that always need to occur
|
||||||
|
agent.vm.provision(:puppet, :pp_path => "/etc/puppet") do |puppet|
|
||||||
|
puppet.manifests_path = 'manifests'
|
||||||
|
puppet.manifest_file = "setup/hosts.pp"
|
||||||
|
puppet.module_path = 'modules'
|
||||||
|
puppet.options = puppet_options
|
||||||
|
end
|
||||||
|
|
||||||
if v_config['update_repos'] == true
|
if v_config['update_repos'] == true
|
||||||
|
|
||||||
agent.vm.provision(:puppet, :pp_path => "/etc/puppet") do |puppet|
|
agent.vm.provision(:puppet, :pp_path => "/etc/puppet") do |puppet|
|
||||||
@@ -194,15 +203,6 @@ Vagrant::Config.run do |config|
|
|||||||
puppet.options = puppet_options
|
puppet.options = puppet_options
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
|
||||||
|
|
||||||
agent.vm.provision(:puppet, :pp_path => "/etc/puppet") do |puppet|
|
|
||||||
puppet.manifests_path = 'manifests'
|
|
||||||
puppet.manifest_file = "setup/hosts.pp"
|
|
||||||
puppet.module_path = 'modules'
|
|
||||||
puppet.options = puppet_options
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# export a data directory that can be used by hiera
|
# export a data directory that can be used by hiera
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
#
|
#
|
||||||
# specify a connection to the hardcoded puppet master
|
# this manifest performs essentially environment configuration
|
||||||
|
# that needs to be run before anything is configured
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# setup basic dns in /etc/hosts
|
||||||
#
|
#
|
||||||
host {
|
host {
|
||||||
'puppetmaster': ip => '172.16.0.31', host_aliases => ['puppetmaster.puppetlabs.lan'];
|
'puppetmaster': ip => '172.16.0.31', host_aliases => ['puppetmaster.puppetlabs.lan'];
|
||||||
@@ -33,8 +38,7 @@ package { ['make', 'gcc']:
|
|||||||
ensure => present,
|
ensure => present,
|
||||||
} ->
|
} ->
|
||||||
|
|
||||||
# install hiera
|
# install hiera, to support Puppet pre 3.0
|
||||||
# TODO pretty sure hiera-puppet is not installed b/c I installed the module
|
|
||||||
package { ['hiera', 'hiera-puppet', 'ruby-debug']:
|
package { ['hiera', 'hiera-puppet', 'ruby-debug']:
|
||||||
ensure => present,
|
ensure => present,
|
||||||
provider => 'gem',
|
provider => 'gem',
|
||||||
|
|||||||
@@ -1,12 +1,14 @@
|
|||||||
import 'hosts.pp'
|
#import 'hosts.pp'
|
||||||
|
|
||||||
#
|
#
|
||||||
# This puppet manifest is already applied first to do some environment specific things
|
# This puppet manifest is already applied first to do some environment specific things
|
||||||
#
|
#
|
||||||
|
|
||||||
|
$openstack_version = hiera('openstack_version', 'folsom')
|
||||||
|
|
||||||
apt::source { 'openstack_folsom':
|
apt::source { 'openstack_folsom':
|
||||||
location => "http://ubuntu-cloud.archive.canonical.com/ubuntu",
|
location => "http://ubuntu-cloud.archive.canonical.com/ubuntu",
|
||||||
release => "precise-updates/folsom",
|
release => "precise-updates/${openstack_version}",
|
||||||
repos => "main",
|
repos => "main",
|
||||||
required_packages => 'ubuntu-cloud-keyring',
|
required_packages => 'ubuntu-cloud-keyring',
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user