From b9ae3cbd24b144dd0433fb845a95514ead17f037 Mon Sep 17 00:00:00 2001 From: Alexey Sheplyakov Date: Fri, 31 Jul 2015 07:36:58 +0300 Subject: [PATCH] nailgun::astute: set the bootstrap profile in astuted.conf In MOS 7.0 several bootstrap images and corresponding cobbler profiles can exist. Astute needs to know which bootstrap profile should be used to correctly reboot the nodes being (re-)provisioned. Closes-Bug: #1479882 Depends-On: I844e30311938fcd2c0aea6f558862205ba2a9982 Change-Id: I3ca4c0a172f1b607048523a7c0cc70aa76a83ee1 --- deployment/puppet/nailgun/examples/astute-only.pp | 4 ++++ deployment/puppet/nailgun/manifests/astute.pp | 7 +++++++ deployment/puppet/nailgun/templates/astuted.conf.erb | 1 + 3 files changed, 12 insertions(+) diff --git a/deployment/puppet/nailgun/examples/astute-only.pp b/deployment/puppet/nailgun/examples/astute-only.pp index d7fa9c3925..cdf610e685 100644 --- a/deployment/puppet/nailgun/examples/astute-only.pp +++ b/deployment/puppet/nailgun/examples/astute-only.pp @@ -9,6 +9,9 @@ else { $production = 'prod' } +$bootstrap_settings = pick($::fuel_settings['BOOTSTRAP'], {}) +$bootstrap_flavor = pick($bootstrap_settings['flavor'], 'centos') + if $production == 'prod'{ $env_path = "/usr" $staticdir = "/usr/share/nailgun/static" @@ -47,6 +50,7 @@ node default { rabbitmq_astute_user => $rabbitmq_astute_user, rabbitmq_astute_password => $rabbitmq_astute_password, version => '0.1.0', + bootstrap_flavor => $bootstrap_flavor, } package { "supervisor": } -> class { "nailgun::supervisor": diff --git a/deployment/puppet/nailgun/manifests/astute.pp b/deployment/puppet/nailgun/manifests/astute.pp index c5c5fb3018..aa0575d9a1 100644 --- a/deployment/puppet/nailgun/manifests/astute.pp +++ b/deployment/puppet/nailgun/manifests/astute.pp @@ -4,9 +4,16 @@ class nailgun::astute( $rabbitmq_astute_user = 'naily', $rabbitmq_astute_password = 'naily', $version, + $bootstrap_flavor = 'centos', $gem_source = "http://rubygems.org/", ){ + $bootstrap_profile = $bootstrap_flavor ? { + /(?i)centos/ => 'bootstrap', + /(?i)ubuntu/ => 'ubuntu_bootstrap', + default => 'bootstrap', + } + # exec { 'install-astute-gem': # command => "gem install astute --source $gem_source --version $version --no-ri --no-rdoc", # require => Exec['configure-rubygems'], diff --git a/deployment/puppet/nailgun/templates/astuted.conf.erb b/deployment/puppet/nailgun/templates/astuted.conf.erb index 46f94e3a8b..8d2a5d1aa9 100644 --- a/deployment/puppet/nailgun/templates/astuted.conf.erb +++ b/deployment/puppet/nailgun/templates/astuted.conf.erb @@ -11,6 +11,7 @@ broker_queue: 'naily' broker_publisher_queue: 'nailgun' broker_exchange: 'nailgun' iops: <%= @iops %> +bootstrap_profile: '<%= @bootstrap_profile %>' #reboot_timeout: 120 # Wait for reboot request #provisioning_timeout: 5400 # Timeout for target nodes to install OS #dump_timeout: 3600 # Timeout for dump