fuel-library/deployment/puppet/nailgun/examples/site.pp
Vladimir Kozhukalov 30af030f44 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
2015-10-02 16:39:38 +03:00

108 lines
3.0 KiB
Puppet

$fuel_settings = parseyaml($astute_settings_yaml)
if $::fuel_settings['PRODUCTION'] {
$production = $::fuel_settings['PRODUCTION']
}
else {
$production = 'docker'
}
$env_path = "/usr"
$staticdir = "/usr/share/nailgun/static"
# this replaces removed postgresql version fact
$postgres_default_version = '9.3'
node default {
Exec {path => '/usr/bin:/bin:/usr/sbin:/sbin'}
$centos_repos =
[
{
"id" => "nailgun",
"name" => "Nailgun",
"url" => "\$tree"
},
]
$cobbler_user = $::fuel_settings['cobbler']['user']
$cobbler_password = $::fuel_settings['cobbler']['password']
$puppet_master_hostname = "${hostname}.${domain}"
$mco_pskey = "unset"
$mco_vhost = "mcollective"
$mco_user = $::fuel_settings['mcollective']['user']
$mco_password = $::fuel_settings['mcollective']['password']
$mco_connector = "rabbitmq"
$rabbitmq_host = $::fuel_settings['ADMIN_NETWORK']['ipaddress']
$rabbitmq_astute_user = $::fuel_settings['astute']['user']
$rabbitmq_astute_password = $::fuel_settings['astute']['password']
$repo_root = "/var/www/nailgun"
$pip_repo = "/var/www/nailgun/eggs"
$gem_source = "http://${::fuel_settings['ADMIN_NETWORK']['ipaddress']}:8080/gems/"
class { 'postgresql::server':
config_hash => {
'ip_mask_allow_all_users' => '0.0.0.0/0',
'listen_addresses' => '127.0.0.1',
},
}
$ntp_servers = [$::fuel_settings['NTP1'], $::fuel_settings['NTP2'], $::fuel_settings['NTP3']]
class { "openstack::clocksync":
ntp_servers => $ntp_servers,
config_template => "ntp/ntp.conf.erb",
}
class { "nailgun":
package => "Nailgun",
version => "0.1.0",
production => $production,
astute_version => "0.0.2",
nailgun_group => "nailgun",
nailgun_user => "nailgun",
venv => $env_path,
pip_index => "--no-index",
pip_find_links => "-f file://${pip_repo}",
gem_source => $gem_source,
# it will be path to database file while using sqlite
# (this is not implemented now)
database_name => $::fuel_settings['postgres']['nailgun_dbname'],
database_engine => "postgresql",
database_host => "localhost",
database_port => "5432",
database_user => $::fuel_settings['postgres']['nailgun_user'],
database_passwd => $::fuel_settings['postgres']['nailgun_password'],
staticdir => $staticdir,
templatedir => $staticdir,
cobbler_url => "http://localhost/cobbler_api",
cobbler_user => $cobbler_user,
cobbler_password => $cobbler_password,
mco_pskey => $mco_pskey,
mco_vhost => $mco_vhost,
mco_host => $::fuel_settings['ADMIN_NETWORK']['ipaddress'],
mco_user => $mco_user,
mco_password => $mco_password,
mco_connector => "rabbitmq",
rabbitmq_astute_user => $rabbitmq_astute_user,
rabbitmq_astute_password => $rabbitmq_astute_password,
puppet_master_hostname => $puppet_master_hostname,
puppet_master_ip => $::fuel_settings['ADMIN_NETWORK']['ipaddress'],
keystone_host => $::fuel_settings['ADMIN_NETWORK']['ipaddress'],
}
Class['postgresql::server'] -> Class['nailgun']
}