diff options
Diffstat (limited to 'puppet')
-rw-r--r-- | puppet/all-nodes-config.yaml | 19 | ||||
-rw-r--r-- | puppet/cinder-storage-puppet.yaml | 7 | ||||
-rw-r--r-- | puppet/compute-puppet.yaml | 9 | ||||
-rw-r--r-- | puppet/controller-puppet.yaml | 12 | ||||
-rw-r--r-- | puppet/hieradata/controller.yaml | 1 | ||||
-rw-r--r-- | puppet/manifests/overcloud_controller.pp | 2 | ||||
-rw-r--r-- | puppet/manifests/overcloud_controller_pacemaker.pp | 243 |
7 files changed, 143 insertions, 150 deletions
diff --git a/puppet/all-nodes-config.yaml b/puppet/all-nodes-config.yaml index c6dcaecb..ec7fa7fa 100644 --- a/puppet/all-nodes-config.yaml +++ b/puppet/all-nodes-config.yaml @@ -62,10 +62,14 @@ resources: list_join: - ',' - {get_param: controller_names} - rabbit_node_ips: - list_join: - - ',' - - {get_param: controller_ips} + rabbit_node_ips: &rabbit_nodes_array + str_replace: + template: "['SERVERS_LIST']" + params: + SERVERS_LIST: + list_join: + - "','" + - {get_param: controller_ips} mongo_node_ips: list_join: - ',' @@ -78,6 +82,13 @@ resources: list_join: - ',' - {get_param: controller_ips} + # NOTE(gfidente): interpolation with %{} in the + # hieradata file can't be used as it returns string + ceilometer::rabbit_hosts: *rabbit_nodes_array + cinder::rabbit_hosts: *rabbit_nodes_array + heat::rabbit_hosts: *rabbit_nodes_array + neutron::rabbit_hosts: *rabbit_nodes_array + nova::rabbit_hosts: *rabbit_nodes_array outputs: config_id: diff --git a/puppet/cinder-storage-puppet.yaml b/puppet/cinder-storage-puppet.yaml index 708f6a9b..d3cbc531 100644 --- a/puppet/cinder-storage-puppet.yaml +++ b/puppet/cinder-storage-puppet.yaml @@ -149,11 +149,6 @@ resources: size: {get_param: CinderLVMLoopDeviceSize} cinder_enable_iscsi_backend: {get_param: CinderEnableIscsiBackend} cinder_iscsi_helper: {get_param: CinderISCSIHelper} - rabbit_hosts: - str_replace: - template: '["host"]' - params: - host: {get_param: VirtualIP} rabbit_username: {get_param: RabbitUserName} rabbit_password: {get_param: RabbitPassword} rabbit_client_use_ssl: {get_param: RabbitClientUseSSL} @@ -176,6 +171,7 @@ resources: hierarchy: - heat_config_%{::deploy_config_name} - volume + - all_nodes # provided by allNodesConfig - '"%{::osfamily}"' - common datafiles: @@ -191,7 +187,6 @@ resources: cinder::setup_test_volume::size: {get_input: cinder_lvm_loop_device_size} cinder_iscsi_helper: {get_input: cinder_iscsi_helper} cinder::database_connection: {get_input: cinder_dsn} - cinder::rabbit_hosts: {get_input: rabbit_hosts} cinder::rabbit_userid: {get_input: rabbit_username} cinder::rabbit_password: {get_input: rabbit_password} cinder::rabbit_use_ssl: {get_input: rabbit_client_use_ssl} diff --git a/puppet/compute-puppet.yaml b/puppet/compute-puppet.yaml index 367bc405..7843447f 100644 --- a/puppet/compute-puppet.yaml +++ b/puppet/compute-puppet.yaml @@ -291,6 +291,7 @@ resources: - compute - ceph_cluster # provided by CephClusterConfig - ceph + - all_nodes # provided by allNodesConfig - '"%{::osfamily}"' - common datafiles: @@ -304,7 +305,6 @@ resources: nova::compute::vncserver_proxyclient_address: local-ipv4 mapped_data: nova::debug: {get_input: debug} - nova::rabbit_hosts: {get_input: rabbit_hosts} nova::rabbit_userid: {get_input: rabbit_username} nova::rabbit_password: {get_input: rabbit_password} nova::rabbit_use_ssl: {get_input: rabbit_client_use_ssl} @@ -316,7 +316,6 @@ resources: nova_enable_rbd_backend: {get_input: nova_enable_rbd_backend} nova_password: {get_input: nova_password} ceilometer::debug: {get_input: debug} - ceilometer::rabbit_hosts: {get_input: rabbit_hosts} ceilometer::rabbit_userid: {get_input: rabbit_username} ceilometer::rabbit_password: {get_input: rabbit_password} ceilometer::rabbit_use_ssl: {get_input: rabbit_client_use_ssl} @@ -329,7 +328,6 @@ resources: snmpd_readonly_user_password: {get_input: snmpd_readonly_user_password} nova::glance_api_servers: {get_input: glance_api_servers} neutron::debug: {get_input: debug} - neutron::rabbit_hosts: {get_input: rabbit_hosts} neutron::rabbit_password: {get_input: rabbit_password} neutron::rabbit_user: {get_input: rabbit_user} neutron::rabbit_use_ssl: {get_input: rabbit_client_use_ssl} @@ -418,11 +416,6 @@ resources: - {get_param: NeutronHost} - ':35357/v2.0' admin_password: {get_param: AdminPassword} - rabbit_hosts: - str_replace: - template: '["host"]' - params: - host: {get_param: RabbitHost} rabbit_username: {get_param: RabbitUserName} rabbit_password: {get_param: RabbitPassword} rabbit_client_use_ssl: {get_param: RabbitClientUseSSL} diff --git a/puppet/controller-puppet.yaml b/puppet/controller-puppet.yaml index 09a26d58..af1ee6fd 100644 --- a/puppet/controller-puppet.yaml +++ b/puppet/controller-puppet.yaml @@ -552,7 +552,6 @@ resources: - {get_param: VirtualIP} - ':5000/v2.0/' enable_galera: {get_param: EnableGalera} - enable_pacemaker: {get_param: EnablePacemaker} enable_ceph_storage: {get_param: EnableCephStorage} enable_swift_storage: {get_param: EnableSwiftStorage} mysql_innodb_buffer_pool_size: {get_param: MysqlInnodbBufferPoolSize} @@ -617,11 +616,6 @@ resources: - {get_param: VirtualIP} - '/nova' pcsd_password: {get_param: PcsdPassword} - rabbit_hosts: - str_replace: - template: '["host"]' - params: - host: {get_param: VirtualIP} rabbit_username: {get_param: RabbitUserName} rabbit_password: {get_param: RabbitPassword} rabbit_cookie: {get_param: RabbitCookie} @@ -675,7 +669,6 @@ resources: controller_host: {get_input: controller_host} #local-ipv4 # Pacemaker - enable_pacemaker: {get_input: enable_pacemaker} hacluster_pwd: {get_input: pcsd_password} # Swift @@ -704,7 +697,6 @@ resources: cinder::api::auth_uri: {get_input: keystone_auth_uri} cinder::api::identity_uri: {get_input: keystone_identity_uri} cinder::api::bind_host: {get_input: controller_host} - cinder::rabbit_hosts: {get_input: rabbit_hosts} cinder::rabbit_userid: {get_input: rabbit_username} cinder::rabbit_password: {get_input: rabbit_password} cinder::rabbit_use_ssl: {get_input: rabbit_client_use_ssl} @@ -744,7 +736,6 @@ resources: heat::engine::heat_metadata_server_url: {get_input: heat.metadata_server_url} heat::engine::heat_waitcondition_server_url: {get_input: heat.waitcondition_server_url} heat::engine::auth_encryption_key: {get_input: heat_auth_encryption_key} - heat::rabbit_hosts: {get_input: rabbit_hosts} heat::rabbit_userid: {get_input: rabbit_username} heat::rabbit_password: {get_input: rabbit_password} heat::rabbit_use_ssl: {get_input: rabbit_client_use_ssl} @@ -784,7 +775,6 @@ resources: # Neutron neutron::bind_host: {get_input: controller_host} - neutron::rabbit_hosts: {get_input: rabbit_hosts} neutron::rabbit_password: {get_input: rabbit_password} neutron::rabbit_user: {get_input: rabbit_user} neutron::rabbit_use_ssl: {get_input: rabbit_client_use_ssl} @@ -820,7 +810,6 @@ resources: ceilometer_backend: {get_input: ceilometer_backend} ceilometer_mysql_conn_string: {get_input: ceilometer_dsn} ceilometer::metering_secret: {get_input: ceilometer_metering_secret} - ceilometer::rabbit_hosts: {get_input: rabbit_hosts} ceilometer::rabbit_userid: {get_input: rabbit_username} ceilometer::rabbit_password: {get_input: rabbit_password} ceilometer::rabbit_use_ssl: {get_input: rabbit_client_use_ssl} @@ -835,7 +824,6 @@ resources: snmpd_readonly_user_password: {get_input: snmpd_readonly_user_password} # Nova - nova::rabbit_hosts: {get_input: rabbit_hosts} nova::rabbit_userid: {get_input: rabbit_username} nova::rabbit_password: {get_input: rabbit_password} nova::rabbit_use_ssl: {get_input: rabbit_client_use_ssl} diff --git a/puppet/hieradata/controller.yaml b/puppet/hieradata/controller.yaml index 02b7c42a..1748ccdb 100644 --- a/puppet/hieradata/controller.yaml +++ b/puppet/hieradata/controller.yaml @@ -109,7 +109,6 @@ tripleo::loadbalancer::nova_osapi: true tripleo::loadbalancer::nova_metadata: true tripleo::loadbalancer::nova_novncproxy: true tripleo::loadbalancer::mysql: true -tripleo::loadbalancer::rabbitmq: true tripleo::loadbalancer::redis: true tripleo::loadbalancer::swift_proxy_server: true tripleo::loadbalancer::ceilometer: true diff --git a/puppet/manifests/overcloud_controller.pp b/puppet/manifests/overcloud_controller.pp index 2b4e2052..a11df054 100644 --- a/puppet/manifests/overcloud_controller.pp +++ b/puppet/manifests/overcloud_controller.pp @@ -160,7 +160,7 @@ if hiera('step') >= 2 { } } - $rabbit_nodes = split(hiera('rabbit_node_ips'), ',') + $rabbit_nodes = hiera('rabbit_node_ips') if count($rabbit_nodes) > 1 { class { '::rabbitmq': config_cluster => true, diff --git a/puppet/manifests/overcloud_controller_pacemaker.pp b/puppet/manifests/overcloud_controller_pacemaker.pp index 996701d0..47f460ac 100644 --- a/puppet/manifests/overcloud_controller_pacemaker.pp +++ b/puppet/manifests/overcloud_controller_pacemaker.pp @@ -13,6 +13,11 @@ # License for the specific language governing permissions and limitations # under the License. +Pcmk_resource <| |> { + tries => 10, + try_sleep => 3, +} + if !str2bool(hiera('enable_package_install', 'false')) { case $::osfamily { 'RedHat': { @@ -26,12 +31,18 @@ if !str2bool(hiera('enable_package_install', 'false')) { if $::hostname == downcase(hiera('bootstrap_nodeid')) { $pacemaker_master = true + $sync_db = true } else { $pacemaker_master = false + $sync_db = false } if hiera('step') >= 1 { + if count(hiera('ntp::servers')) > 0 { + include ::ntp + } + $controller_node_ips = split(hiera('controller_node_ips'), ',') $controller_node_names = split(downcase(hiera('controller_node_names')), ',') class { '::tripleo::loadbalancer' : @@ -55,88 +66,38 @@ if hiera('step') >= 1 { class { '::pacemaker::stonith': disable => true, } - if $pacemaker_master { - $control_vip = hiera('tripleo::loadbalancer::controller_virtual_ip') - pacemaker::resource::ip { 'control_vip': - ip_address => $control_vip, - } - $public_vip = hiera('tripleo::loadbalancer::public_virtual_ip') - pacemaker::resource::ip { 'public_vip': - ip_address => $public_vip, - } - pacemaker::resource::service { 'haproxy': - clone => true, - } - } - Class['::pacemaker::corosync'] -> Pacemaker::Resource::Service <| |> - -} - -if hiera('step') >= 2 { - - if count(hiera('ntp::servers')) > 0 { - include ::ntp + # Only configure RabbitMQ in this step, don't start it yet to + # avoid races where non-master nodes attempt to start without + # config (eg. binding on 0.0.0.0) + # The module ignores erlang_cookie if cluster_config is false + class { '::rabbitmq': + service_manage => false, + tcp_keepalive => false, + config_kernel_variables => hiera('rabbitmq_kernel_variables'), + config_variables => hiera('rabbitmq_config_variables'), + environment_variables => hiera('rabbitmq_environment'), + } -> + file { '/var/lib/rabbitmq/.erlang.cookie': + ensure => 'present', + owner => 'rabbitmq', + group => 'rabbitmq', + mode => '0400', + content => hiera('rabbitmq::erlang_cookie'), + replace => true, } # MongoDB - if downcase(hiera('ceilometer_backend')) == 'mongodb' { - include ::mongodb::globals + include ::mongodb::globals - class {'::mongodb::server' : - service_ensure => undef - } - $mongo_node_ips = split(hiera('mongo_node_ips'), ',') - $mongo_node_ips_with_port = suffix($mongo_node_ips, ':27017') - $mongo_node_string = join($mongo_node_ips_with_port, ',') - - $mongodb_replset = hiera('mongodb::server::replset') - $ceilometer_mongodb_conn_string = "mongodb://${mongo_node_string}/ceilometer?replicaSet=${mongodb_replset}" - if downcase(hiera('bootstrap_nodeid')) == $::hostname { - - pacemaker::resource::service { 'mongod' : - options => "op start timeout=120s", - clone => true, - before => Exec['mongodb-ready'], - } - # NOTE (spredzy) : The replset can only be run - # once all the nodes have joined the cluster. - $mongodb_cluster_ready_command = join(suffix(prefix($mongo_node_ips, '/bin/nc -w1 '), ' 27017 < /dev/null'), ' && ') - exec { 'mongodb-ready' : - command => $mongodb_cluster_ready_command, - timeout => 600, - tries => 60, - try_sleep => 10, - before => Mongodb_replset[$mongodb_replset], - } - - mongodb_replset { $mongodb_replset : - members => $mongo_node_ips_with_port, - } - } - } - - # Redis - $redis_node_ips = split(hiera('redis_node_ips'), ',') - $redis_master_hostname = downcase(hiera('bootstrap_nodeid')) - - if $redis_master_hostname == $::hostname { - $slaveof = undef - } else { - $slaveof = "${redis_master_hostname} 6379" - } - class {'::redis' : - slaveof => $slaveof, - } - - if count($redis_node_ips) > 1 { - Class['::tripleo::redis_notification'] -> Service['redis-sentinel'] - include ::redis::sentinel - class {'::tripleo::redis_notification' : - haproxy_monitor_ip => hiera('tripleo::loadbalancer::controller_virtual_ip'), - } + # FIXME: replace with service_manage => false on ::mongodb::server + # when this is merged: https://github.com/puppetlabs/pupp etlabs-mongodb/pull/198 + class { '::mongodb::server' : + service_ensure => undef, + service_enable => false, } + # Galera if str2bool(hiera('enable_galera', 'true')) { $mysql_config_file = '/etc/my.cnf.d/galera.cnf' } else { @@ -184,31 +145,97 @@ if hiera('step') >= 2 { service_manage => false, } +} + +if hiera('step') >= 2 { + if $pacemaker_master { - $sync_db = true + $control_vip = hiera('tripleo::loadbalancer::controller_virtual_ip') + pacemaker::resource::ip { 'control_vip': + ip_address => $control_vip, + } + $public_vip = hiera('tripleo::loadbalancer::public_virtual_ip') + pacemaker::resource::ip { 'public_vip': + ip_address => $public_vip, + } + pacemaker::resource::service { 'haproxy': + clone_params => true, + } - pacemaker::resource::ocf { 'galera' : - resource_name => 'heartbeat:galera', - options => "enable_creation=true wsrep_cluster_address='gcomm://${galera_nodes}' meta master-max=${galera_nodes_count} ordered=true op promote timeout=300s on-fail=block --master", - require => Class['::mysql::server'], - before => Exec['galera-ready'], + pacemaker::resource::ocf { 'rabbitmq': + ocf_agent_name => 'heartbeat:rabbitmq-cluster', + resource_params => 'set_policy=\'ha-all ^(?!amq\.).* {"ha-mode":"all"}\'', + clone_params => 'ordered=true interleave=true', + require => Class['::rabbitmq'], } + if downcase(hiera('ceilometer_backend')) == 'mongodb' { + pacemaker::resource::service { $::mongodb::params::service_name : + op_params => 'start timeout=120s', + clone_params => true, + require => Class['::mongodb::server'], + before => Exec['mongodb-ready'], + } + # NOTE (spredzy) : The replset can only be run + # once all the nodes have joined the cluster. + $mongo_node_ips = split(hiera('mongo_node_ips'), ',') + $mongo_node_ips_with_port = suffix($mongo_node_ips, ':27017') + $mongo_node_string = join($mongo_node_ips_with_port, ',') + $mongodb_replset = hiera('mongodb::server::replset') + $mongodb_cluster_ready_command = join(suffix(prefix($mongo_node_ips, '/bin/nc -w1 '), ' 27017 < /dev/null'), ' && ') + exec { 'mongodb-ready' : + command => $mongodb_cluster_ready_command, + timeout => 600, + tries => 60, + try_sleep => 10, + } + mongodb_replset { $mongodb_replset : + members => $mongo_node_ips_with_port, + require => Exec['mongodb-ready'], + } + } + + pacemaker::resource::ocf { 'galera' : + ocf_agent_name => 'heartbeat:galera', + op_params => 'promote timeout=300s on-fail=block --master', + meta_params => "master-max=${galera_nodes_count} ordered=true", + resource_params => "additional_parameters='--open-files-limit=16384' enable_creation=true wsrep_cluster_address='gcomm://${galera_nodes}'", + require => Class['::mysql::server'], + before => Exec['galera-ready'], + } mysql_user { 'clustercheckuser@localhost' : password_hash => mysql_password($clustercheck_password), require => Exec['galera-ready'], } + } + + # Redis + $redis_node_ips = split(hiera('redis_node_ips'), ',') + $redis_master_hostname = downcase(hiera('bootstrap_nodeid')) + + if $redis_master_hostname == $::hostname { + $slaveof = undef } else { - $sync_db = false + $slaveof = "${redis_master_hostname} 6379" + } + class {'::redis' : + slaveof => $slaveof, + } + + if count($redis_node_ips) > 1 { + Class['::tripleo::redis_notification'] -> Service['redis-sentinel'] + include ::redis::sentinel + class {'::tripleo::redis_notification' : + haproxy_monitor_ip => hiera('tripleo::loadbalancer::controller_virtual_ip'), + } } exec { 'galera-ready' : command => '/bin/mysql -e "SHOW GLOBAL VARIABLES LIKE \'read_only\'" | /bin/grep -i off', - timeout => 3600, + timeout => 600, tries => 60, - try_sleep => 60, + try_sleep => 10, environment => 'HOME=/root', - require => Class['::mysql::server'], } file { '/etc/sysconfig/clustercheck' : @@ -232,7 +259,6 @@ MYSQL_HOST=localhost\n", require => File['/etc/sysconfig/clustercheck'], } - # FIXME: this should only occur on the bootstrap host (ditto for db syncs) # Create all the database schemas # Example DSN format: mysql://user:password@host/dbname if $sync_db { @@ -304,34 +330,10 @@ MYSQL_HOST=localhost\n", } } - # the module ignores erlang_cookie if cluster_config is false - file { '/var/lib/rabbitmq/.erlang.cookie': - ensure => 'present', - owner => 'rabbitmq', - group => 'rabbitmq', - mode => '0400', - content => hiera('rabbitmq::erlang_cookie'), - replace => true, - } -> - class { '::rabbitmq': - service_manage => false, - tcp_keepalive => false, - config_kernel_variables => hiera('rabbitmq_kernel_variables'), - config_variables => hiera('rabbitmq_config_variables'), - environment_variables => hiera('rabbitmq_environment'), - } - if $pacemaker_master { - pacemaker::resource::ocf { 'rabbitmq': - resource_name => 'heartbeat:rabbitmq-cluster', - options => 'set_policy=\'ha-all ^(?!amq\.).* {"ha-mode":"all"}\'', - clone => true, - require => Class['::rabbitmq'], - } - } - # pre-install swift here so we can build rings include ::swift + # Ceph $cinder_enable_rbd_backend = hiera('cinder_enable_rbd_backend', false) $enable_ceph = $cinder_enable_rbd_backend @@ -347,12 +349,16 @@ MYSQL_HOST=localhost\n", include ::ceph::profile::osd } + # Memcached + include ::memcached + } #END STEP 2 -if (hiera('step') >= 3 and $::hostname == downcase(hiera('bootstrap_nodeid'))) - or hiera('step') >= 4 { +if (hiera('step') >= 3 and $pacemaker_master) or hiera('step') >= 4 { - include ::keystone + class { '::keystone': + sync_db => $sync_db, + } #TODO: need a cleanup-keystone-tokens.sh solution here keystone_config { @@ -454,7 +460,9 @@ if (hiera('step') >= 3 and $::hostname == downcase(hiera('bootstrap_nodeid'))) Service['neutron-server'] -> Service['neutron-metadata'] include ::cinder - include ::cinder::api + class { '::cinder::api': + sync_db => $sync_db, + } include ::cinder::glance include ::cinder::scheduler include ::cinder::volume @@ -505,7 +513,6 @@ if (hiera('step') >= 3 and $::hostname == downcase(hiera('bootstrap_nodeid'))) } # swift proxy - include ::memcached include ::swift::proxy include ::swift::proxy::proxy_logging include ::swift::proxy::healthcheck @@ -544,7 +551,7 @@ if (hiera('step') >= 3 and $::hostname == downcase(hiera('bootstrap_nodeid'))) $ceilometer_database_connection = hiera('ceilometer_mysql_conn_string') } default : { - $ceilometer_database_connection = $ceilometer_mongodb_conn_string + $ceilometer_database_connection = "mongodb://${mongo_node_string}/ceilometer?replicaSet=${mongodb_replset}" } } include ::ceilometer @@ -591,4 +598,4 @@ if (hiera('step') >= 3 and $::hostname == downcase(hiera('bootstrap_nodeid'))) snmpd_config => [ join(['rouser ', hiera('snmpd_readonly_user_name')]), 'proc cron', 'includeAllDisks 10%', 'master agentx', 'trapsink localhost public', 'iquerySecName internalUser', 'rouser internalUser', 'defaultMonitors yes', 'linkUpDownNotifications yes' ], } -} #END STEP 3 +} #END STEP 3/4 |