Skip to content

Commit

Permalink
Closes-Bug: #1615267
Browse files Browse the repository at this point in the history
Support for CentOS provisioning in mitaka

Change-Id: Ie279662de1f00c91569c9f5ba547f1351de1574f
  • Loading branch information
sgurumurthy committed Sep 6, 2016
1 parent 1314836 commit 26789eb
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 21 deletions.
2 changes: 1 addition & 1 deletion contrail/environment/modules/ceph/manifests/mon.pp
Expand Up @@ -123,7 +123,7 @@
if $public_addr {
$public_addr_option = "--public_addr ${public_addr}"
}
if ( $package_sku =~ /^*:13\.0.*$/) {
if ( $package_sku =~ /13\.0/) {
$setuser_option = "--setuser ceph --setgroup ceph"
}

Expand Down
Expand Up @@ -11,6 +11,7 @@
$ssd_data_dir = $::contrail::params::ssd_data_dir,
$contrail_logoutput = $::contrail::params::contrail_logoutput,
$database_minimum_diskGB = $::contrail::params::database_minimum_diskGB,
$zookeeper_conf_dir = $::contrail::params::zookeeper_conf_dir,
) {

# Main Class code
Expand Down Expand Up @@ -124,7 +125,7 @@
settings_hash => $kafka_log4j_properties_config['kafka_log4j_properties'],
lens_to_use => $kafka_log4j_augeas_lens_to_use,
} ->
file { '/etc/zookeeper/conf/zoo.cfg':
file { "${zookeeper_conf_dir}/zoo.cfg":
ensure => present,
content => template("${module_name}/zoo.cfg.erb"),
} ->
Expand Down Expand Up @@ -158,12 +159,12 @@
# Below is temporary to work-around in Ubuntu as Service resource fails
# as upstart is not correctly linked to /etc/init.d/service-name
if ($::operatingsystem == 'Ubuntu') {
File['/etc/zookeeper/conf/zoo.cfg'] ->
File["${zookeeper_conf_dir}/zoo.cfg"] ->
file { '/etc/init.d/supervisord-contrail-database':
ensure => link,
target => '/lib/init/upstart-job',
} ->
File ['/etc/zookeeper/conf/log4j.properties'] -> File ['/etc/zookeeper/conf/environment'] ->
File ["${zookeeper_conf_dir}/log4j.properties"] -> File ["${zookeeper_conf_dir}/environment"] ->
File [$zk_myid_file] ~> Service['zookeeper']
}
contain ::contrail::database::config_cassandra
Expand Down
@@ -1,7 +1,8 @@
class contrail::database::new_config_zk_files_setup (
$contrail_logoutput = $::contrail::params::contrail_logoutput,
$zookeeper_conf_dir = $::contrail::params::zookeeper_conf_dir,
$database_index = 1,
$zk_myid_file = '/etc/zookeeper/conf/myid'
$zk_myid_file = "${zookeeper_conf_dir}/myid"
) {
# set high session timeout to survive glance led disk activity
$zk_cfg = { 'zk_cfg' =>
Expand All @@ -10,15 +11,15 @@
},
}
contrail::lib::augeas_conf_set { 'zk_cfg_keys':
config_file => '/etc/zookeeper/conf/zoo.cfg',
config_file => "${zookeeper_conf_dir}/zoo.cfg",
settings_hash => $zk_cfg['zk_cfg'],
lens_to_use => 'properties.lns',
} ->
file {'/etc/zookeeper/conf/log4j.properties':
file {"${zookeeper_conf_dir}/log4j.properties":
ensure => present,
} ->
contrail::lib::augeas_conf_set { 'log4j.appender.ROLLINGFILE.MaxBackupIndex':
config_file => '/etc/zookeeper/conf/log4j.properties',
config_file => "${zookeeper_conf_dir}/log4j.properties",
settings_hash => { 'log4j.appender.ROLLINGFILE.MaxBackupIndex' => "11",},
lens_to_use => 'properties.lns',
} ->
Expand All @@ -31,23 +32,23 @@
case $::operatingsystem {
'Ubuntu': {
Contrail::Lib::Augeas_conf_set['log4j.appender.ROLLINGFILE.MaxBackupIndex'] ->
file {'/etc/zookeeper/conf/environment':
file {"${zookeeper_conf_dir}/environment":
ensure => present,
} ->
file_line { 'Add ZOO_LOG4J_PROP to Zookeeper env':
path => '/etc/zookeeper/conf/environment',
path => "${zookeeper_conf_dir}/environment",
line => "ZOO_LOG4J_PROP=\"INFO,CONSOLE,ROLLINGFILE\"",
match => 'ZOO_LOG4J_PROP=.*$',
} ->
File[$zk_myid_file]
}
'Centos', 'Fedora' : {
Contrail::Lib::Augeas_conf_set['log4j.appender.ROLLINGFILE.MaxBackupIndex'] ->
file {'/etc/zookeeper/zookeeper-env.sh':
file {"${zookeeper_conf_dir}/zookeeper-env.sh":
ensure => present,
} ->
file_line { 'Add ZOO_LOG4J_PROP to Zookeeper env':
path => '/etc/zookeeper/zookeeper-env.sh',
path => "${zookeeper_conf_dir}/zookeeper-env.sh",
line => 'export ZOO_LOG4J_PROP=\"INFO,CONSOLE,ROLLINGFILE\"',
} ->
File[$zk_myid_file]
Expand Down
@@ -1,8 +1,10 @@
class contrail::database::service {
class contrail::database::service (
$zookeeper_conf_dir = $::contrail::params::zookeeper_conf_dir,
){
service { 'zookeeper':
ensure => running,
enable => true,
subscribe => File['/etc/zookeeper/conf/zoo.cfg'],
subscribe => File["${zookeeper_conf_dir}/zoo.cfg"],
}
->
service { ['supervisor-database', 'contrail-database'] :
Expand Down
5 changes: 5 additions & 0 deletions contrail/environment/modules/contrail/manifests/params.pp
Expand Up @@ -951,5 +951,10 @@
$redis_service = 'redis-server'
$ssl_package='libssl0.9.8'
}
if ( ($package_sku =~ /13\.0/) and ($::operatingsystem == 'Centos')) {
$zookeeper_conf_dir= "/etc/zookeeper"
} else {
$zookeeper_conf_dir= "/etc/zookeeper/conf"
}

}
Expand Up @@ -26,7 +26,8 @@
allowed_hosts => $allowed_hosts,
}

if ( $package_sku =~ /^*:13\.0.*$/) {
$paste_config = ''
if ( $package_sku =~ /13\.0/) {
$default_domain = 'default'
} else {
$default_domain = undef
Expand All @@ -43,6 +44,7 @@
public_port => '6000',
admin_port => '35358',
default_domain => $default_domain,
paste_config => $paste_config,
database_idle_timeout => '180',
rabbit_hosts => $openstack_rabbit_servers,
verbose => $openstack_verbose,
Expand All @@ -66,6 +68,7 @@
admin_token => $admin_token,
database_connection => $keystone_db_conn,
default_domain => $default_domain,
paste_config => $paste_config,
enabled => true,
admin_bind_host => $admin_bind_host,
sync_db => true,
Expand Down
Expand Up @@ -31,12 +31,16 @@
allowed_hosts => $allowed_hosts,
}

if ( $package_sku =~ /^*:13\.0.*$/) {
if ( $package_sku =~ /13\.0/) {
## TODO: Remove once we move to mitaka modules
class {'::nova::db::mysql_api':
password => $service_password,
allowed_hosts => $allowed_hosts,
}
$enabled_apis = ['osapi_compute,metadata']
}
else {
$enabled_apis = ['ec2,osapi_compute,metadata']
}

$compute_ip_list = $::contrail::params::compute_ip_list
Expand Down Expand Up @@ -114,10 +118,11 @@
#sync_db => $sync_db,
sync_db => true,
osapi_compute_workers => $osapi_compute_workers,
package_sku => $package_sku
package_sku => $package_sku,
enabled_apis => $enabled_apis
}

if ( $package_sku =~ /^*:13\.0.*$/) {
if ( $package_sku =~ /13\.0/) {
## TODO: Remove once we move to mitaka modules
$nova_api_db_conn = join(["mysql://nova_api:",$database_credentials,"/nova_api"],'')
nova_config {
Expand Down
Expand Up @@ -21,7 +21,7 @@
$internal_vip = $::contrail::params::internal_vip
$contrail_internal_vip = $::contrail::params::contrail_internal_vip

if ( $package_sku =~ /^*:13\.0.*$/) {
if ( $package_sku =~ /13\.0/) {
$endpoint_version = "v2.1"
} else {
$endpoint_version = "v2"
Expand Down
4 changes: 2 additions & 2 deletions contrail/environment/modules/nova/manifests/api.pp
Expand Up @@ -351,7 +351,7 @@
Package<| title == $::nova::params::api_package_name |> ~> Exec['nova-db-sync']
Package<| title == $::nova::params::common_package_name |> ~> Exec['nova-db-sync']

if ( $package_sku =~ /^*:13\.0.*$/) {
if ( $package_sku =~ /13\.0/) {
Package<| title == $::nova::params::api_package_name |> ~> Exec['nova-api-db-sync']
Package<| title == $::nova::params::common_package_name |> ~> Exec['nova-api-db-sync']
}
Expand All @@ -361,7 +361,7 @@
refreshonly => true,
subscribe => Exec['post-nova_config'],
}
if ( $package_sku =~ /^*:13\.0.*$/) {
if ( $package_sku =~ /13\.0/) {
exec { 'nova-api-db-sync':
command => '/usr/bin/nova-manage api_db sync',
refreshonly => true,
Expand Down

0 comments on commit 26789eb

Please sign in to comment.