Get rid of version.yaml facts

/etc/version.yaml is built together with ISO and
it is not a part of any rpm package which contradicts
package based approach.

This patch introduces 2 other puppet facts which
are from the following files:
- /etc/fuel_release
- /etc/fuel_openstack_version
These files are to be packaged into RPM packages and built
using perestroika. Besides, it assumes there is is
PRODUCTION variable in astute.yaml which is used
to set $production (by default it is 'docker').

Depends-On: I02f32386232c94a0288877dfc78513a8bc74d23e
Depends-On: I6e867c4e118518ad02425b49bb067738d4da20c4
Depends-On: I175dc620cbdff3959519e3fc374894f93bba45ac
Implements blueprint: docker-images-perestroika

Change-Id: I5f264fbc8f80a2e92920484ef6a6e28e6c8e7e58
This commit is contained in:
Vladimir Kozhukalov 2015-09-02 10:10:07 +03:00
parent 3330b57448
commit 30af030f44
17 changed files with 83 additions and 83 deletions

View File

@ -1,5 +1,4 @@
$fuel_settings = parseyaml($astute_settings_yaml)
$fuel_version = parseyaml($fuel_version_yaml)
$mco_host = $::fuel_settings['ADMIN_NETWORK']['ipaddress']

View File

@ -1,5 +1,4 @@
$fuel_settings = parseyaml($astute_settings_yaml)
$fuel_version = parseyaml($fuel_version_yaml)
$mco_host = $::fuel_settings['ADMIN_NETWORK']['ipaddress']

View File

@ -1,12 +1,10 @@
$fuel_settings = parseyaml($astute_settings_yaml)
$fuel_version = parseyaml($fuel_version_yaml)
if is_hash($::fuel_version) and $::fuel_version['VERSION'] and
$::fuel_version['VERSION']['production'] {
$production = $::fuel_version['VERSION']['production']
if $::fuel_settings['PRODUCTION'] {
$production = $::fuel_settings['PRODUCTION']
}
else {
$production = 'prod'
$production = 'docker'
}
$bootstrap_settings = pick($::fuel_settings['BOOTSTRAP'], {})

View File

@ -1,7 +1,12 @@
$fuel_settings = parseyaml($astute_settings_yaml)
$fuel_version = parseyaml($fuel_version_yaml)
$production = $::fuel_version['VERSION']['production']
if $::fuel_settings['PRODUCTION'] {
$production = $::fuel_settings['PRODUCTION']
}
else {
$production = 'docker'
}
if $production {
$env_path = "/usr"
$staticdir = "/usr/share/nailgun/static"

View File

@ -1,14 +1,12 @@
# Configuration of Fuel Master node only
$fuel_settings = parseyaml($astute_settings_yaml)
$fuel_version = parseyaml($fuel_version_yaml)
if is_hash($::fuel_version) and $::fuel_version['VERSION'] and
$::fuel_version['VERSION']['production'] {
$production = $::fuel_version['VERSION']['production']
if $::fuel_settings['PRODUCTION'] {
$production = $::fuel_settings['PRODUCTION']
}
else {
$production = 'prod'
$production = 'docker'
}
#Purge empty NTP server entries
@ -35,7 +33,7 @@ class { 'osnailyfacter::atop': }
class { 'nailgun::host':
production => $production,
fuel_version => $::fuel_version['VERSION']['release'],
fuel_version => $::fuel_release,
cobbler_host => $::fuel_settings['ADMIN_NETWORK']['ipaddress'],
nailgun_group => $nailgun_group,
nailgun_user => $nailgun_user,
@ -44,7 +42,7 @@ class { 'nailgun::host':
dns_upstream => split($::fuel_settings['DNS_UPSTREAM'], ','),
admin_network => $admin_network,
extra_networks => $extra_networks,
repo_root => "/var/www/nailgun/${::fuel_version['VERSION']['openstack_version']}",
repo_root => "/var/www/nailgun/${::fuel_openstack_version}",
monitord_user => $::fuel_settings['keystone']['monitord_user'],
monitord_password => $::fuel_settings['keystone']['monitord_password'],
monitord_tenant => 'services',
@ -57,7 +55,7 @@ class { 'openstack::clocksync':
}
class { 'docker::dockerctl':
release => $::fuel_version['VERSION']['release'],
release => $::fuel_release,
production => $production,
admin_ipaddress => $::fuel_settings['ADMIN_NETWORK']['ipaddress'],
docker_engine => 'native',
@ -65,7 +63,7 @@ class { 'docker::dockerctl':
class { "docker":
docker_engine => 'native',
release => $::fuel_version['VERSION']['release'],
release => $::fuel_release,
}
class { 'openstack::logrotate':
@ -85,7 +83,7 @@ class { 'nailgun::client':
class { 'nailgun::supervisor':
nailgun_env => false,
ostf_env => false,
require => File['/etc/supervisord.d/current', "/etc/supervisord.d/${::fuel_version['VERSION']['release']}"],
require => File['/etc/supervisord.d/current', "/etc/supervisord.d/${::fuel_release}"],
conf_file => 'nailgun/supervisord.conf.base.erb',
}
@ -98,11 +96,11 @@ file { '/etc/supervisord.d':
}
class { 'docker::supervisor':
release => $::fuel_version['VERSION']['release'],
require => File["/etc/supervisord.d/${::fuel_version['VERSION']['release']}"],
release => $::fuel_release,
require => File["/etc/supervisord.d/${::fuel_release}"],
}
file { "/etc/supervisord.d/${::fuel_version['VERSION']['release']}":
file { "/etc/supervisord.d/${::fuel_release}":
ensure => directory,
require => File['/etc/supervisord.d'],
owner => root,
@ -111,8 +109,8 @@ file { "/etc/supervisord.d/${::fuel_version['VERSION']['release']}":
file { '/etc/supervisord.d/current':
ensure => link,
target => "/etc/supervisord.d/${::fuel_version['VERSION']['release']}",
require => File["/etc/supervisord.d/${::fuel_version['VERSION']['release']}"],
target => "/etc/supervisord.d/${::fuel_release}",
require => File["/etc/supervisord.d/${::fuel_release}"],
replace => true,
}

View File

@ -1,12 +1,10 @@
$fuel_settings = parseyaml($astute_settings_yaml)
$fuel_version = parseyaml($fuel_version_yaml)
if is_hash($::fuel_version) and $::fuel_version['VERSION'] and
$::fuel_version['VERSION']['production'] {
$production = $::fuel_version['VERSION']['production']
if $::fuel_settings['PRODUCTION'] {
$production = $::fuel_settings['PRODUCTION']
}
else {
$production = 'prod'
$production = 'docker'
}
#Purge empty NTP server entries
@ -32,7 +30,7 @@ class { 'osnailyfacter::atop': }
class { 'nailgun::host':
production => $production,
fuel_version => $::fuel_version['VERSION']['release'],
fuel_version => $::fuel_release,
cobbler_host => $::fuel_settings['ADMIN_NETWORK']['ipaddress'],
nailgun_group => $nailgun_group,
nailgun_user => $nailgun_user,
@ -41,7 +39,7 @@ class { 'nailgun::host':
dns_upstream => split($::fuel_settings['DNS_UPSTREAM'], ','),
admin_network => $admin_network,
extra_networks => $extra_networks,
repo_root => "/var/www/nailgun/${::fuel_version['VERSION']['openstack_version']}",
repo_root => "/var/www/nailgun/${::fuel_openstack_version}",
monitord_user => $::fuel_settings['keystone']['monitord_user'],
monitord_password => $::fuel_settings['keystone']['monitord_password'],
monitord_tenant => 'services',
@ -54,7 +52,7 @@ class { 'openstack::clocksync':
}
class { 'docker::dockerctl':
release => $::fuel_version['VERSION']['release'],
release => $::fuel_release,
production => $production,
admin_ipaddress => $::fuel_settings['ADMIN_NETWORK']['ipaddress'],
docker_engine => 'native',
@ -62,7 +60,7 @@ class { 'docker::dockerctl':
class { "docker":
docker_engine => 'native',
release => $::fuel_version['VERSION']['release'],
release => $::fuel_release,
}
class { 'openstack::logrotate':
@ -82,4 +80,3 @@ class { 'nailgun::client':
class { 'osnailyfacter::ssh':
password_auth => 'yes',
}

View File

@ -1,11 +1,10 @@
$fuel_settings = parseyaml($astute_settings_yaml)
$fuel_version = parseyaml($fuel_version_yaml)
if is_hash($::fuel_version) and $::fuel_version['VERSION'] and $::fuel_version['VERSION']['production'] {
$production = $::fuel_version['VERSION']['production']
if $::fuel_settings['PRODUCTION'] {
$production = $::fuel_settings['PRODUCTION']
}
else {
$production = 'prod'
$production = 'docker'
}
package { 'python-psycopg2':

View File

@ -1,11 +1,10 @@
$fuel_settings = parseyaml($astute_settings_yaml)
$fuel_version = parseyaml($fuel_version_yaml)
if is_hash($::fuel_version) and $::fuel_version['VERSION'] and $::fuel_version['VERSION']['production'] {
$production = $::fuel_version['VERSION']['production']
if $::fuel_settings['PRODUCTION'] {
$production = $::fuel_settings['PRODUCTION']
}
else {
$production = 'prod'
$production = 'docker'
}
$env_path = "/usr"

View File

@ -1,12 +1,10 @@
$fuel_settings = parseyaml($astute_settings_yaml)
$fuel_version = parseyaml($fuel_version_yaml)
if is_hash($::fuel_version) and $::fuel_version['VERSION'] and
$::fuel_version['VERSION']['production'] {
$production = $::fuel_version['VERSION']['production']
if $::fuel_settings['PRODUCTION'] {
$production = $::fuel_settings['PRODUCTION']
}
else {
$production = 'prod'
$production = 'docker'
}
if $fuel_settings['SSL'] {

View File

@ -1,12 +1,10 @@
$fuel_settings = parseyaml($astute_settings_yaml)
$fuel_version = parseyaml($fuel_version_yaml)
if is_hash($::fuel_version) and $::fuel_version['VERSION'] and
$::fuel_version['VERSION']['production'] {
$production = $::fuel_version['VERSION']['production']
if $::fuel_settings['PRODUCTION'] {
$production = $::fuel_settings['PRODUCTION']
}
else {
$production = 'prod'
$production = 'docker'
}
if $production == 'prod'{

View File

@ -1,12 +1,10 @@
$fuel_settings = parseyaml($astute_settings_yaml)
$fuel_version = parseyaml($fuel_version_yaml)
if is_hash($::fuel_version) and $::fuel_version['VERSION'] and
$::fuel_version['VERSION']['production'] {
$production = $::fuel_version['VERSION']['production']
if $::fuel_settings['PRODUCTION'] {
$production = $::fuel_settings['PRODUCTION']
}
else {
$production = 'prod'
$production = 'docker'
}
if $production == 'prod'{

View File

@ -1,15 +1,12 @@
$fuel_settings = parseyaml($astute_settings_yaml)
$fuel_version = parseyaml($fuel_version_yaml)
if is_hash($::fuel_version) and $::fuel_version['VERSION'] and
$::fuel_version['VERSION']['production'] {
$production = $::fuel_version['VERSION']['production']
if $::fuel_settings['PRODUCTION'] {
$production = $::fuel_settings['PRODUCTION']
}
else {
$production = 'prod'
$production = 'docker'
}
#astute user
$rabbitmq_astute_user = $::fuel_settings['astute']['user']
$rabbitmq_astute_password = $::fuel_settings['astute']['password']
@ -55,4 +52,3 @@ class { 'nailgun::rabbitmq':
'NODENAME' => "rabbit@${::hostname}",
},
}

View File

@ -1,5 +1,4 @@
$fuel_settings = parseyaml($astute_settings_yaml)
$fuel_version = parseyaml($fuel_version_yaml)
Class['docker::container'] ->
Class['rsyslog::server'] ->

View File

@ -1,11 +1,10 @@
$fuel_settings = parseyaml($astute_settings_yaml)
$fuel_version = parseyaml($fuel_version_yaml)
if is_hash($::fuel_version) and $::fuel_version['VERSION'] and $::fuel_version['VERSION']['production'] {
$production = $::fuel_version['VERSION']['production']
if $::fuel_settings['PRODUCTION'] {
$production = $::fuel_settings['PRODUCTION']
}
else {
$production = 'prod'
$production = 'docker'
}
$env_path = "/usr"

View File

@ -0,0 +1,16 @@
require 'facter'
fuel_openstack_version_path = '/etc/fuel_openstack_version'
# FIXME(kozhukalov): This default value is necessary
# to solve chicken/egg problem. The thing is that
# deployment tests use the ISO where this file is not
# installed. This default value should be removed
# once the ISO is updated.
read_data = "2015.1.0-8.0"
Facter.add('fuel_openstack_version') do
if File.exist?(fuel_openstack_version_path)
read_data = File.read(fuel_openstack_version_path).strip
end
setcode { read_data }
end

View File

@ -0,0 +1,16 @@
require 'facter'
fuel_release_path = '/etc/fuel_release'
# FIXME(kozhukalov): This default value is necessary
# to solve chicken/egg problem. The thing is that
# deployment tests use the ISO where this file is not
# installed. This default value should be removed
# once the ISO is updated.
read_data = "8.0"
Facter.add('fuel_release') do
if File.exist?(fuel_release_path)
read_data = File.read(fuel_release_path).strip
end
setcode { read_data }
end

View File

@ -1,14 +0,0 @@
require 'facter'
fuel_version_path = [ '/etc/fuel/version.yaml', '/etc/fuel/nailgun/version.yaml', '/etc/nailgun/version.yaml' ]
read_data = "none"
Facter.add('fuel_version_yaml') do
fuel_version_path.each do |fuel_version_file|
if File.exist?(fuel_version_file)
read_data = File.read(fuel_version_file)
break
end
end
setcode { read_data }
end