Add puppet manifests

This commit is contained in:
Fedor Zhadaev 2016-12-15 16:45:35 +04:00
parent 651999d4b4
commit ea9ac97ea2
6 changed files with 185 additions and 5 deletions

View File

@ -1,3 +1,24 @@
notice('MODULAR: congress.pp')
# TODO implement
$management_vip = hiera('management_vip')
$public_vip = hiera('public_vip')
$network_scheme = hiera_hash('network_scheme', {})
prepare_network_config($network_scheme)
$plugin_hash = hiera_hash('congress', {})
$debug = $plugin_hash['debug']
$congress_hash = $plugin_hash['metadata']
$rabbit_hash = hiera_hash('rabbit', {})
$rabbit_hosts = split(hiera('amqp_hosts',''), ',')
$rabbit_password = $rabbit_hash['password']
$rabbit_userid = $rabbit_hash['user']
class { 'congress':
rabbit_hosts => $rabbit_hosts,
rabbit_password => $rabbit_password,
rabbit_userid => $rabbit_userid
}
include congress::client

View File

@ -0,0 +1,49 @@
notice('MODULAR: congress/db.pp')
$plugin_hash = hiera_hash('congress', {})
$congress_hash = $plugin_hash['metadata']
$mysql_hash = hiera_hash('mysql', {})
$management_vip = hiera('management_vip')
$database_vip = hiera('database_vip')
$mysql_root_user = pick($mysql_hash['root_user'], 'root')
$mysql_root_password = $mysql_hash['root_password']
$db_user = pick($congress_hash['user'], 'congress')
$db_name = pick($congress_hash['db_name'], 'congress')
$db_password = pick($congress_hash['db_password'], $mysql_root_password)
$db_host = $database_vip
$db_root_user = $mysql_root_user
$db_root_password = $mysql_root_password
$allowed_hosts = [ 'localhost', '127.0.0.1', '%' ]
validate_string($mysql_root_user)
validate_string($database_vip)
class { '::openstack::galera::client':
custom_setup_class => hiera('mysql_custom_setup_class', 'galera'),
}
class { '::congress::db::mysql':
user => $db_user,
password => $db_password,
dbname => $db_name,
allowed_hosts => $allowed_hosts,
}
class { '::osnailyfacter::mysql_access':
db_host => $db_host,
db_user => $db_root_user,
db_password => $db_root_password,
}
Class['::openstack::galera::client'] ->
Class['::osnailyfacter::mysql_access'] ->
Class['::tacker::db::mysql']
class mysql::config {}
include mysql::config
class mysql::server {}
include mysql::server

View File

@ -0,0 +1,46 @@
notice('MODULAR: congress/keystone.pp')
$plugin_hash = hiera_hash('congress', {})
$congress_hash = $plugin_hash['metadata']
$port = $congress_hash['port']
$public_vip = hiera('public_vip')
$public_ssl_hash = hiera_hash('public_ssl')
$management_vip = hiera('management_vip')
$region = pick($congress_hash['region'], hiera('region', 'RegionOne'))
$password = $congress_hash['user_password']
$auth_name = pick($congress_hash['auth_name'], 'congress')
$configure_endpoint = pick($congress_hash['configure_endpoint'], true)
$configure_user = pick($congress_hash['configure_user'], true)
$configure_user_role = pick($congress_hash['configure_user_role'], true)
$service_name = pick($congress_hash['service_name'], 'congress')
$tenant = pick($congress_hash['tenant'], 'services')
$ssl_hash = hiera_hash('use_ssl', {})
Class['::osnailyfacter::wait_for_keystone_backends'] -> Class['::congress::keystone::auth']
$public_protocol = get_ssl_property($ssl_hash, $public_ssl_hash, 'congress', 'public', 'protocol', 'http')
$public_address = get_ssl_property($ssl_hash, $public_ssl_hash, 'congress', 'public', 'hostname', [$public_vip])
$internal_protocol = get_ssl_property($ssl_hash, {}, 'congress', 'internal', 'protocol', 'http')
$internal_address = get_ssl_property($ssl_hash, {}, 'congress', 'internal', 'hostname', [$management_vip])
$admin_protocol = get_ssl_property($ssl_hash, {}, 'congress', 'admin', 'protocol', 'http')
$admin_address = get_ssl_property($ssl_hash, {}, 'congress', 'admin', 'hostname', [$management_vip])
$public_url = "${public_protocol}://${public_address}:${port}"
$internal_url = "${internal_protocol}://${internal_address}:${port}"
$admin_url = "${admin_protocol}://${admin_address}:${port}"
validate_string($public_address)
validate_string($password)
class {'::osnailyfacter::wait_for_keystone_backends':}
class { 'congress::keystone::auth':
auth_name => $auth_name,
password => $password,
tenant => $tenant,
admin_url => $admin_url,
internal_url => $internal_url,
public_url => $public_url,
region => $region,
}

View File

@ -0,0 +1,47 @@
notice('MODULAR: congress/server.pp')
$management_vip = hiera('management_vip')
$public_vip = hiera('public_vip')
$plugin_hash = hiera_hash('congress', {})
$congress_hash = $plugin_hash['metadata']
$bind_port = $congress_hash['port']
$bind_host = get_network_role_property('management', 'ipaddr')
$service_name = pick($congress_hash['service'], 'congress-server')
$service_enabled = $plugin_hash['enabled']
$policies = parsejson($plugin_hash['policies'], {})
$congress_tenant = pick($congress_hash['tenant'], 'services')
$congress_user = pick($congress_hash['user'], 'congress')
$congress_user_password = $congress_hash['user_password']
$ssl_hash = hiera_hash('use_ssl', {})
$public_auth_protocol = get_ssl_property($ssl_hash, {}, 'keystone', 'public', 'protocol', 'http')
$public_auth_address = get_ssl_property($ssl_hash, {}, 'keystone', 'public', 'hostname', $public_vip)
$admin_auth_protocol = get_ssl_property($ssl_hash, {}, 'keystone', 'admin', 'protocol', 'http')
$admin_auth_address = get_ssl_property($ssl_hash, {}, 'keystone', 'admin', 'hostname', $management_vip)
$auth_uri = "${public_auth_protocol}://${public_auth_address}:5000"
$auth_url = "${admin_auth_protocol}://${admin_auth_address}:35357"
class { 'congress::keystone::authtoken':
password => $congress_user_password,
username => $congress_user,
project_name => $congress_tenant,
auth_url => $auth_url,
auth_uri => $auth_uri,
}
class {'congress::server':
enabled => $service_enabled,
bing_host => $bind_host,
bind_port => $bind_port
}
class {'congress::policy':
policies => $policies
}

View File

@ -20,6 +20,17 @@
puppet_modules: puppet/modules:/etc/puppet/modules
timeout: 3600
- id: congress-server
type: puppet
version: 2.1.0
groups: [congress]
cross-depends:
- name: congress-install
parameters:
puppet_manifest: puppet/manifests/server.pp
puppet_modules: puppet/modules:/etc/puppet/modules
- id: congress-keystone
type: puppet
version: 2.1.0

View File

@ -10,9 +10,15 @@ attributes:
user: 'congress'
port: 1789
service: 'congress-server'
debug:
value: false
label: 'Debug logging'
description: 'Debug logging mode provides more information, but requires more disk space.'
enabled:
value: true
label: 'Enable'
description: 'Service enable state for congress-server'
weight: 25
type: "checkbox"
policies:
value: {}
label: 'Policies'
description: 'Set of policies to configure for congress (in JSON format)'
weight: 50
type: "text"