Skip to content
Snippets Groups Projects
Commit 18b8360a authored by Alessandro Costantini's avatar Alessandro Costantini
Browse files

Preliminar code for mogodb installation and configuration.

parent 7a254981
No related branches found
No related tags found
1 merge request!23Dev
......@@ -39,6 +39,16 @@ iaas::profile::haproxy::stats_login: "stats"
iaas::profile::haproxy::stats_password: "stats"
iaas::profile::haproxy::stats_uri: "/"
# Endpoints
iaas::role::endpoint::servers: ['ocp-tb-1','ocp-tb-2','ocp-tb-3'] # List of load-balancers
iaas::main_hostname: '10.101.32.x' # VIP Hostname (public)
iaas::main_address: 10.101.32.x # The main virtual address pointing to the load-balancers
iaas::admin_address: 10.101.32.x # The private virtual address pointing to the load-balancers
iaas::role::endpoint::coordination: ['10.101.32.x:2181,10.101.32.x:2181'] # coordination for zookeeper, controllers
# Memcache
iaas::memcache::coordination: ['10.101.32.x:11211','10.101.32.x:11211'] # Set memcache servers and related port
# Percona
iaas::profile::database::mysql_cluster_servers: 'ocp-tb-1,ocp-tb-2,ocp-tb-3'
iaas::profile::database::mysql_port: 3307
......@@ -46,6 +56,8 @@ iaas::profile::database::root_password: 'test'
# Mongo - NEW
iaas::mongo::endpoint::coordination: ['ocp-tb-1-priv:27017,ocp-tb-2-priv:27017,ocp-tb-3-priv:27017']
iaas::profile::mongodb::key: 'Uf+8s0LbxIxNrbyEC1kw'
iaas::profile::mongodb::password: '<MONGODB_ADMIN_PASSWORD>'
# Rabbitmq
iaas::profile::rabbitmq::servers: [ocp-tb-1,ocp-tb-2,ocp-tb-3]
......@@ -74,16 +86,6 @@ ceph::profile::params::bootstrap_osd_key: 'AQDlL/hUUCpdFBAAZeo6mKj4yeKPmVKfUY5aw
ceph::profile::params::bootstrap_mds_key: 'AQApksZUIJhXJxAAEHVW/dbL1OeLA7Om++zdVw=='
ceph::profile::params::osd_journal_size: '5120'
# Endpoints
iaas::role::endpoint::servers: ['ocp-tb-1','ocp-tb-2','ocp-tb-3'] # List of load-balancers
iaas::main_hostname: '10.101.32.x' # VIP Hostname (public)
iaas::main_address: 10.101.32.x # The main virtual address pointing to the load-balancers
iaas::admin_address: 10.101.32.x # The private virtual address pointing to the load-balancers
iaas::role::endpoint::coordination: ['10.101.32.x:2181,10.101.32.x:2181'] # coordination for zookeeper, controllers
# Memcache
iaas::memcache::coordination: ['10.101.32.x:11211','10.101.32.x:11211'] # Set memcache servers and related port
# Galera MySQL
iaas::mysql::keystone::user: keystone
iaas::mysql::keystone::password: keystone
......
......@@ -210,6 +210,9 @@ $rabbit_hostnames = ['rb-tb-1-priv','rb-tb-2-priv','rb-tb-3-priv']
# class {'iaas::role::rhmk':
# # to be true only if renewing the cluster
# # percona_master => true,
# mongo_master => true,
# # to be commented during replica sets cluster configuration
# mongo_bootstrap => true,
# keepalived_state => 'MASTER',
# keepalived_priority => 102,
# haproxy_percona_servers => $haproxy_percona_servers,
......
class iaas::profile::mongodb (
$hosts = hiera('iaas::mongo::endpoint::coordination', undef),
$bootstrap = false,
$master = false,
$key = hiera('iaas::profile::mongodb::key', undef),
$password = hiera('iaas::profile::mongodb::password', undef),
$mongouser = hiera('iaas::mongo::ceilometer::user', 'ceilometer'),
$mongopasswd = hiera('iaas::mongo::ceilometer::password', 'ceilometer'),
){
class {'::mongodb::globals':
# manage_package_repo => true,
# bind_ip => [$::facts["ipaddress_eth1"]], #[$::facts["ipaddress_${admin_interface}"]],
}
if $master {
if $bootstrap {
class {'::mongodb::server':
# bind_ip => ['127.0.0.1',$::facts["ipaddress_eth1"]], #[$::facts["ipaddress_${admin_interface}"]],
bind_ip => ['127.0.0.1',$::facts["ipaddress_eth1"]],
port => '27017',
auth => true,
journal => 'true',
keyfile => '/etc/mongodb.key',
key => $key,
verbose => true,
create_admin => true,
store_creds => true,
admin_username => "admin",
admin_password => $password,
} ->
class {'::mongodb::client': } ->
mongodb::db { 'ceilometer':
user => $mongouser,
password => $mongopasswd,
}
} else {
class {'::mongodb::server':
# bind_ip => ['127.0.0.1',$::facts["ipaddress_eth1"]], #[$::facts["ipaddress_${admin_interface}"]],
bind_ip => ['127.0.0.1',$::facts["ipaddress_eth1"]],
replset => 'rs0',
replset_config => { 'rs0' => { ensure => present, members => $hosts } },
port => '27017',
auth => true,
journal => 'true',
keyfile => '/etc/mongodb.key',
key => $key,
verbose => true,
store_creds => true,
admin_username => "admin",
admin_password => $password,
}
}
} else {
class {'::mongodb::server':
# bind_ip => ['127.0.0.1',$::facts["ipaddress_eth1"]], #[$::facts["ipaddress_${admin_interface}"]],
bind_ip => ['127.0.0.1',$::facts["ipaddress_eth1"]],
port => '27017',
auth => true,
journal => 'true',
keyfile => '/etc/mongodb.key',
key => $key,
verbose => true,
store_creds => true,
admin_username => "admin",
admin_password => $password,
replset => 'rs0',
} ->
class {'::mongodb::client': }
}
}
class iaas::role::rhmk(
$percona_master = false,
$mongo_master = false,
$mongo_bootstrap = false,
$keepalived_priority = 100,
$keepalived_state = 'BACKUP',
$haproxy_percona_servers = undef,
......@@ -35,5 +37,9 @@ class iaas::role::rhmk(
}
class { 'iaas::profile::rabbitmq':
node_hostname => $rabbit_hostname,
}
}
class { 'iaas::profile::mongodb':
master => $mongo_master,
bootstrap => $mongo_bootstrap,
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment