diff --git a/contrail/environment/modules/contrail/files/add_dev_tun_in_cgroup_device_acl.sh b/contrail/environment/modules/contrail/files/add_dev_tun_in_cgroup_device_acl.sh index 641b1c5b..d6275bf4 100755 --- a/contrail/environment/modules/contrail/files/add_dev_tun_in_cgroup_device_acl.sh +++ b/contrail/environment/modules/contrail/files/add_dev_tun_in_cgroup_device_acl.sh @@ -1,9 +1,9 @@ #!/bin/bash +platform=$1 grep -q '^cgroup_device_acl' /etc/libvirt/qemu.conf if [ "$?" -ne 0 ] then - grep -q -i -e 'centos' -e 'redhat' /etc/issue - if [ "$?" -eq 0 ] + if [ $platform == 'CentOS' ] || [ $platform == 'Fedora' ] then echo "clear_emulator_capabilities = 1" >> /etc/libvirt/qemu.conf echo 'user = "root"' >> /etc/libvirt/qemu.conf @@ -15,5 +15,10 @@ then echo ' "/dev/ptmx", "/dev/kvm", "/dev/kqemu",' >> /etc/libvirt/qemu.conf echo ' "/dev/rtc", "/dev/hpet","/dev/net/tun",' >> /etc/libvirt/qemu.conf echo ']' >> /etc/libvirt/qemu.conf - service libvirt-bin restart + if [ $platform == 'CentOS' ] || [ $platform == 'Fedora' ] + then + service libvirtd restart + else + service libvirt-bin restart + fi fi diff --git a/contrail/environment/modules/contrail/lib/facter/contrail-compute-custom-facts.rb b/contrail/environment/modules/contrail/lib/facter/contrail-compute-custom-facts.rb index 2eacbb88..192f339e 100755 --- a/contrail/environment/modules/contrail/lib/facter/contrail-compute-custom-facts.rb +++ b/contrail/environment/modules/contrail/lib/facter/contrail-compute-custom-facts.rb @@ -35,7 +35,13 @@ end Facter.add(:contrail_version) do setcode do - Facter::Util::Resolution.exec('dpkg -l contrail-lib | grep contrail-lib | awk \'{ printf $3}\'') + operatingsystem = Facter.value('operatingsystem') + case operatingsystem + when "CentOS" + Facter::Util::Resolution.exec('yum list | grep contrail-lib | awk \'{ printf $2}\' | awk -F \'.e\' \'{printf $1}\'') + when "Ubuntu" + Facter::Util::Resolution.exec('dpkg -l contrail-lib | grep contrail-lib | awk \'{ printf $3}\'') + end end end Facter.add(:conductor_idx) do diff --git a/contrail/environment/modules/contrail/lib/facter/contrail_interfaces.rb b/contrail/environment/modules/contrail/lib/facter/contrail_interfaces.rb index c6c66eaa..f667ec8a 100755 --- a/contrail/environment/modules/contrail/lib/facter/contrail_interfaces.rb +++ b/contrail/environment/modules/contrail/lib/facter/contrail_interfaces.rb @@ -3,9 +3,14 @@ Facter.add(:contrail_interfaces) do setcode do contrail_interfaces = {} - interface_list_str = %x[ifconfig -a | grep HWaddr | awk \'{ print $1 \'}] + operatingsystem = Facter.value('operatingsystem') + case operatingsystem + when "CentOS" + interface_list_str = %x[ifconfig -a | grep flags | awk \'{ print $1 \'} | sed \'s/:$// \'] + when "Ubuntu" + interface_list_str = %x[ifconfig -a | grep HWaddr | awk \'{ print $1 \'}] + end intf_list = interface_list_str.split("\n") - intf_list.each do |intf| intf_detail = {} vlan_intf = %x[ip addr show #{intf} | head -1| cut -f2 -d':' | grep -o '@.*'] diff --git a/contrail/environment/modules/contrail/manifests/collector/config.pp b/contrail/environment/modules/contrail/manifests/collector/config.pp index be17a660..a84006f4 100644 --- a/contrail/environment/modules/contrail/manifests/collector/config.pp +++ b/contrail/environment/modules/contrail/manifests/collector/config.pp @@ -36,7 +36,12 @@ $contrail_analytics_api_ini_command ="/usr/bin/contrail-analytics-api --conf_file /etc/contrail/contrail-analytics-api.conf --conf_file /etc/contrail/contrail-keystone-auth.conf" $contrail_alarm_gen_ini_command ="/usr/bin/contrail-alarm-gen --conf_file /etc/contrail/contrail-alarm-gen.conf --conf_file /etc/contrail/contrail-keystone-auth.conf" - $redis_config_file = '/etc/redis/redis.conf' + if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') { + $redis_config_file = '/etc/redis.conf' + } + if ($::operatingsystem == 'Ubuntu') { + $redis_config_file = '/etc/redis/redis.conf' + } $redis_augeas_lens_to_use = 'spacevars.lns' if ($redis_password != "" ) { diff --git a/contrail/environment/modules/contrail/manifests/collector/install.pp b/contrail/environment/modules/contrail/manifests/collector/install.pp index 8e3d232d..4de86ea2 100644 --- a/contrail/environment/modules/contrail/manifests/collector/install.pp +++ b/contrail/environment/modules/contrail/manifests/collector/install.pp @@ -1,7 +1,7 @@ class contrail::collector::install( $upgrade_needed = $::contrail::params::upgrade_needed, ) { - if ($upgrade_needed == 1) { + if ($upgrade_needed == 1 and $::operatingsystem == 'Ubuntu') { exec { 'Temporarily delete contrail-analytics to upgrade python-kafka' : command => "dpkg -P contrail-analytics contrail-openstack-analytics python-kafka-python", provider => shell, diff --git a/contrail/environment/modules/contrail/manifests/collector/service.pp b/contrail/environment/modules/contrail/manifests/collector/service.pp index 39c5acd7..b64e9acc 100644 --- a/contrail/environment/modules/contrail/manifests/collector/service.pp +++ b/contrail/environment/modules/contrail/manifests/collector/service.pp @@ -1,13 +1,19 @@ class contrail::collector::service( $contrail_logoutput = $::contrail::params::contrail_logoutput, ) { + if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') { + $redis_service = 'redis' + } + if ($::operatingsystem == 'Ubuntu') { + $redis_service = 'redis-server' + } # Ensure the services needed are running. exec { 'redis-del-db-dir': command => 'rm -f /var/lib/redis/dump.rb', provider => shell, logoutput => $contrail_logoutput } -> - service { ['redis-server', 'supervisor-analytics'] : + service { [$redis_service, 'supervisor-analytics'] : ensure => running, enable => true, } diff --git a/contrail/environment/modules/contrail/manifests/common.pp b/contrail/environment/modules/contrail/manifests/common.pp index 44bd2e88..906773cc 100644 --- a/contrail/environment/modules/contrail/manifests/common.pp +++ b/contrail/environment/modules/contrail/manifests/common.pp @@ -59,17 +59,24 @@ User['nova', 'libvirt-qemu', 'libvirt-dnsmasq'] -> contrail::lib::contrail_upgrade{ 'contrail_upgrade': contrail_upgrade => $contrail_upgrade, - contrail_logoutput => $contrail_logoutput, - upgrade_needed => $upgrade_needed - } -> - apt::pin { 'debian_repo_preferences': - priority => '-10', - originator => 'Debian' - } -> - apt::pin { 'contrail_repo_preferences': - priority => '999', - codename => 'contrail' - } -> + contrail_logoutput => $contrail_logoutput + } + if 'Ubuntu' == $::operatingsystem { + apt::pin { 'debian_repo_preferences': + priority => '-10', + originator => 'Debian' + } -> + apt::pin { 'contrail_repo_preferences': + priority => '999', + codename => 'contrail' + } + } + if ($::operatingsystem == 'Ubuntu') { + $ssl_package='libssl0.9.8' + } + if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') { + $ssl_package='openssl' + } # Create repository config on target. contrail::lib::contrail_setup_repo{ $contrail_repo_name: contrail_repo_ip => $contrail_repo_ip, @@ -87,7 +94,7 @@ ensure => present, ip => $host_mgmt_ip } -> - package { 'libssl0.9.8' : ensure => present,} -> + package { $ssl_package : ensure => present,} -> sysctl::value { 'kernel.core_pattern': value => '/var/crashes/core.%e.%p.%h.%t' } -> @@ -102,10 +109,9 @@ ensure => 'directory', } -> Class['::contrail::enable_kernel_core'] - # Disable SELINUX on boot, if not already disabled. if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') { - Package['libssl0.9.8']-> + Package['openssl']-> # Set SELINUX as disabled in selinux config contrail::lib::augeas_conf_set { 'SELINUX': config_file => '/etc/selinux/config', @@ -126,6 +132,7 @@ lens_to_use => 'properties.lns', } -> Sysctl::Value['kernel.core_pattern'] + package { 'yum-plugin-priorities' : ensure => present,} contain ::contrail::disable_selinux } diff --git a/contrail/environment/modules/contrail/manifests/compute.pp b/contrail/environment/modules/contrail/manifests/compute.pp index e7c94787..b9cbd55c 100644 --- a/contrail/environment/modules/contrail/manifests/compute.pp +++ b/contrail/environment/modules/contrail/manifests/compute.pp @@ -164,7 +164,10 @@ ) { contrail::lib::report_status { 'compute_started': } -> Class['::contrail::compute::install'] -> - Class['::contrail::compute::config'] ~> + # Commenting out line below as service manifest is never executed, execution is + # looping in config never goes to server.pp. + #Class['::contrail::compute::config'] ~> + Class['::contrail::compute::config'] -> Class['::contrail::compute::service'] -> contrail::lib::report_status { "compute_completed": } contain ::contrail::compute::install diff --git a/contrail/environment/modules/contrail/manifests/compute/add_dev_tun_in_cgroup_device_acl.pp b/contrail/environment/modules/contrail/manifests/compute/add_dev_tun_in_cgroup_device_acl.pp index f47ba005..eaeccd5c 100644 --- a/contrail/environment/modules/contrail/manifests/compute/add_dev_tun_in_cgroup_device_acl.pp +++ b/contrail/environment/modules/contrail/manifests/compute/add_dev_tun_in_cgroup_device_acl.pp @@ -1,6 +1,7 @@ class contrail::compute::add_dev_tun_in_cgroup_device_acl ( $contrail_logoutput = $::contrail::params::contrail_logoutput, ) { + $os = $::operatingsystem file { '/etc/contrail/contrail_setup_utils/add_dev_tun_in_cgroup_device_acl.sh': ensure => present, mode => '0755', @@ -9,7 +10,7 @@ source => "puppet:///modules/${module_name}/add_dev_tun_in_cgroup_device_acl.sh" } -> exec { 'add_dev_tun_in_cgroup_device_acl' : - command => './add_dev_tun_in_cgroup_device_acl.sh && echo add_dev_tun_in_cgroup_device_acl >> /etc/contrail/contrail_compute_exec.out', + command => "./add_dev_tun_in_cgroup_device_acl.sh $os && echo add_dev_tun_in_cgroup_device_acl >> /etc/contrail/contrail_compute_exec.out", cwd => '/etc/contrail/contrail_setup_utils/', unless => 'grep -qx add_dev_tun_in_cgroup_device_acl /etc/contrail/contrail_compute_exec.out', provider => shell, diff --git a/contrail/environment/modules/contrail/manifests/compute/config.pp b/contrail/environment/modules/contrail/manifests/compute/config.pp index ff6c9643..db06c82b 100644 --- a/contrail/environment/modules/contrail/manifests/compute/config.pp +++ b/contrail/environment/modules/contrail/manifests/compute/config.pp @@ -183,12 +183,6 @@ } } - # Install interface rename package for centos. - if (inline_template('<%= @operatingsystem.downcase %>') == 'centos') { - Notify["vmware_physical_intf = ${vmware_physical_intf}"] -> - contrail::lib::contrail_rename_interface { 'centos-rename-interface' : - } - } # for storage ## Same condition as compute/service.pp if ($nfs_server == 'xxx' and $host_control_ip == $compute_ip_list[0] ) { @@ -215,9 +209,12 @@ 'compute/compute_driver'=> { value => "libvirt.LibvirtDriver" }, 'DEFAULT/rabbit_hosts' => {value => "${nova_compute_rabbit_hosts}"}, } + if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') { + $nova_params['keystone_authtoken/password'] = { value =>"${keystone_admin_password}" } + } if ($keystone_ip) { $vnc_base_url_port = '5999' - nova_config { 'DEFAULT/novncproxy_base_url': value => "http://${keystone_ip}:${vnc_base_url_port}/vnc_auto.html" } + $nova_params['DEFAULT/novncproxy_base_url'] = { value => "http://${keystone_ip}:${vnc_base_url_port}/vnc_auto.html" } } if (!('openstack' in $host_roles)){ nova_config { 'glance/api_servers': value => "http://${glance_management_address}:9292"} @@ -413,10 +410,21 @@ subscribe => Exec ["setup-compute-server-setup"], timeout => 0, } + contain ::contrail::compute::setup_compute_server_setup contain ::contrail::compute::add_vnc_config # Now reboot the system if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') { + Class['::contrail::compute::setup_compute_server_setup'] -> + Class['::contrail::compute::cp_ifcfg_file'] -> + # remove blank password line from nova.conf + exec { "set-nova-password": + command => "sed -i \'s/^password=$/password=${keystone_admin_password}/\' /etc/nova/nova.conf && echo exec-set-nova-password >> /etc/contrail/exec-contrail-compute.out", + provider => shell, + unless => "grep -qx set-nova-conf /etc/contrail/exec-contrail-compute.out", + logoutput => true + } -> + Reboot['compute'] contain ::contrail::compute::cp_ifcfg_file } diff --git a/contrail/environment/modules/contrail/manifests/compute/cp_ifcfg_file.pp b/contrail/environment/modules/contrail/manifests/compute/cp_ifcfg_file.pp index 29e83096..92f9625d 100644 --- a/contrail/environment/modules/contrail/manifests/compute/cp_ifcfg_file.pp +++ b/contrail/environment/modules/contrail/manifests/compute/cp_ifcfg_file.pp @@ -8,7 +8,5 @@ logoutput => $contrail_logoutput } -> - Reboot['compute'] - -> notify { "executed cp_ifcfg_file" :; } } diff --git a/contrail/environment/modules/contrail/manifests/compute/install.pp b/contrail/environment/modules/contrail/manifests/compute/install.pp index ac8d2250..90fbc90b 100644 --- a/contrail/environment/modules/contrail/manifests/compute/install.pp +++ b/contrail/environment/modules/contrail/manifests/compute/install.pp @@ -77,6 +77,12 @@ # Ensure all needed packages are latest package { [ $vrouter_pkg, 'contrail-openstack-vrouter'] : ensure => latest, notify => Service['supervisor-vrouter']} + # Install interface rename package for centos. + if (inline_template('<%= @operatingsystem.downcase %>') == 'centos') { + contrail::lib::contrail_rename_interface { 'centos-rename-interface' : + } + } + if ($enable_lbaas == true) { Package[$vrouter_pkg, 'contrail-openstack-vrouter'] -> package{ ['haproxy', 'iproute'] : ensure => present,} diff --git a/contrail/environment/modules/contrail/manifests/compute/service.pp b/contrail/environment/modules/contrail/manifests/compute/service.pp index cd7a208b..f7218883 100644 --- a/contrail/environment/modules/contrail/manifests/compute/service.pp +++ b/contrail/environment/modules/contrail/manifests/compute/service.pp @@ -11,7 +11,17 @@ enable => true, } } - service { 'nova-compute' : + if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') { + $nova_service_name = "openstack-nova-compute" + exec { 'sevc-openstk-nova-restart' : + command => "service ${nova_service_name} restart", + provider => shell, + logoutput => $contrail_logoutput, + } + } else { + $nova_service_name = "nova-compute" + } + service { $nova_service_name : enable => $nova_compute_status, ensure => $nova_compute_status, } diff --git a/contrail/environment/modules/contrail/manifests/config/config.pp b/contrail/environment/modules/contrail/manifests/config/config.pp index ca21339b..4f42c869 100644 --- a/contrail/environment/modules/contrail/manifests/config/config.pp +++ b/contrail/environment/modules/contrail/manifests/config/config.pp @@ -85,8 +85,8 @@ $contrail_api_ubuntu_command = join(["/usr/bin/contrail-api --conf_file /etc/contrail/contrail-api.conf --conf_file /etc/contrail/contrail-keystone-auth.conf --listen_port ",$api_port_base,"%(process_num)01d --worker_id %(process_num)s"],'') $contrail_discovery_ubuntu_command = join(["/usr/bin/contrail-discovery --conf_file /etc/contrail/contrail-discovery.conf --listen_port ",$disc_port_base,"%(process_num)01d --worker_id %(process_num)s"],'') - $contrail_api_centos_command = join(['/bin/bash -c "source /opt/contrail/api-venv/bin/activate && exec python /opt/contrail/api-venv/lib/python2.7/site-packages/vnc_cfg_api_server/vnc_cfg_api_server.py --conf_file /etc/contrail/contrail-api.conf --listen_port ',$api_port_base,'%(process_num)01d --worker_id %(process_num)s"'],'') - $contrail_discovery_centos_command = join(['/bin/bash -c "source /opt/contrail/api-venv/bin/activate && exec python /opt/contrail/api-venv/lib/python2.7/site-packages/discovery/disc_server_zk.py --conf_file /etc/contrail/contrail-discovery.conf --listen_port ',$disc_port_base,'%(process_num)01d --worker_id %(process_num)s"'],'') + $contrail_api_centos_command = join(["/usr/bin/contrail-api --conf_file /etc/contrail/contrail-api.conf --conf_file /etc/contrail/contrail-keystone-auth.conf --conf_file /etc/contrail/contrail-database.conf --listen_port ",$api_port_base,"%(process_num)01d --worker_id %(process_num)s"],'') + $contrail_discovery_centos_command = join(["/usr/bin/contrail-discovery --conf_file /etc/contrail/contrail-discovery.conf --listen_port ",$disc_port_base,"%(process_num)01d --worker_id %(process_num)s"],'') $keystone_auth_server = $keystone_ip_to_use @@ -363,6 +363,8 @@ 'APISERVER/multi_tenancy' : value => "$multi_tenancy"; 'APISERVER/contrail_extensions': value => 'ipam:neutron_plugin_contrail.plugins.opencontrail.contrail_plugin_ipam.NeutronPluginContrailIpam,policy:neutron_plugin_contrail.plugins.opencontrail.contrail_plugin_policy.NeutronPluginContrailPolicy,route-table:neutron_plugin_contrail.plugins.opencontrail.contrail_plugin_vpc.NeutronPluginContrailVpc,contrail:None,service-interface:None,vf-binding:None'; 'KEYSTONE/auth_url' : value => "$keystone_auth_url"; + 'KEYSTONE/admin_user' : value => "$keystone_admin_user"; + 'KEYSTONE/admin_password' : value => "$keystone_admin_password"; 'KEYSTONE/auth_user' : value => "$keystone_admin_user"; 'KEYSTONE/admin_tenant_name': value => "$keystone_admin_tenant"; } -> @@ -378,6 +380,8 @@ 'APISERVER/multi_tenancy' : value => "$multi_tenancy"; 'APISERVER/contrail_extensions': value => 'ipam:neutron_plugin_contrail.plugins.opencontrail.contrail_plugin_ipam.NeutronPluginContrailIpam,policy:neutron_plugin_contrail.plugins.opencontrail.contrail_plugin_policy.NeutronPluginContrailPolicy,route-table:neutron_plugin_contrail.plugins.opencontrail.contrail_plugin_vpc.NeutronPluginContrailVpc,contrail:None'; 'KEYSTONE/auth_url' : value => "$keystone_auth_url"; + 'KEYSTONE/admin_user' : value => "$keystone_admin_user"; + 'KEYSTONE/admin_password' : value => "$keystone_admin_password"; 'KEYSTONE/auth_user' : value => "$keystone_admin_user"; 'KEYSTONE/admin_tenant_name': value => "$keystone_admin_tenant"; 'COLLECTOR/analytics_api_ip': value => "$collector_ip"; @@ -389,7 +393,7 @@ lens_to_use => 'properties.lns', } -> - Class['::contrail::config::config_neutron_server'] -> + #Class['::contrail::config::config_neutron_server'] -> # initd script wrapper for contrail-discovery file { '/etc/init.d/contrail-discovery' : @@ -414,6 +418,6 @@ } contain ::contrail::openstackrc contain ::contrail::keystone - contain ::contrail::config::config_neutron_server + #contain ::contrail::config::config_neutron_server contain ::contrail::config::setup_quantum_server_setup } diff --git a/contrail/environment/modules/contrail/manifests/config/install.pp b/contrail/environment/modules/contrail/manifests/config/install.pp index e442f794..9b6abbf8 100644 --- a/contrail/environment/modules/contrail/manifests/config/install.pp +++ b/contrail/environment/modules/contrail/manifests/config/install.pp @@ -10,26 +10,35 @@ # if ($contrail_internal_vip == "" and ($internal_vip == "" or !('openstack' in $contrail_host_roles))) { - if ($lsbdistrelease == "14.04") { - $keepalived_pkg = '1.2.13-0~276~ubuntu14.04.1' - } else { - $keepalived_pkg = '1:1.2.13-1~bpo70+1' - } + if ($::operatingsystem == 'Ubuntu') { + if ($lsbdistrelease == "14.04") { + $keepalived_pkg = '1.2.13-0~276~ubuntu14.04.1' + } else { + $keepalived_pkg = '1:1.2.13-1~bpo70+1' + } - package { 'keepalived' : - ensure => $keepalived_pkg, + package { 'keepalived' : + ensure => $keepalived_pkg, + } } - -> service { "keepalived" : enable => false, ensure => stopped, } - Package['keepalived'] -> Package['contrail-openstack-config'] + if defined(Package['keepalived']) { + Package['keepalived'] -> Package['contrail-openstack-config'] + } } + if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') { + $cmd='yum -y remove contrail-openstack-config contrail-config-openstack' + } + else { + $cmd="apt-get -y --force-yes purge contrail-openstack-config contrail-config-openstack" + } if ($upgrade_needed == 1) { exec { 'Temporarily delete contrail-openstack-config, contrail-config-openstack' : - command => "apt-get -y --force-yes purge contrail-openstack-config contrail-config-openstack", + command => $cmd, provider => shell, logoutput => $contrail_logoutput, } diff --git a/contrail/environment/modules/contrail/manifests/config/service.pp b/contrail/environment/modules/contrail/manifests/config/service.pp index d0227265..86065862 100644 --- a/contrail/environment/modules/contrail/manifests/config/service.pp +++ b/contrail/environment/modules/contrail/manifests/config/service.pp @@ -4,14 +4,18 @@ service { 'supervisor-config': ensure => running, enable => true, - } -> - service { 'supervisor-support-service': - ensure => running, - enable => true, + } + if ($::operatingsystem == 'Ubuntu') { + service { 'supervisor-support-service': + ensure => running, + enable => true, + } } #Set rabbit params for both internal and contrail_internal_vip if($vip != '') { - Service['supervisor-support-service'] -> + if ($::operatingsystem == 'Ubuntu') { + Service['supervisor-support-service'] -> Exec['rabbit_os_fix'] + } exec { 'rabbit_os_fix': command => "rabbitmqctl set_policy HA-all \"\" '{\"ha-mode\":\"all\",\"ha-sync-mode\":\"automatic\"}' && echo rabbit_os_fix >> /etc/contrail/contrail_openstack_exec.out", unless => 'grep -qx rabbit_os_fix /etc/contrail/contrail_openstack_exec.out', diff --git a/contrail/environment/modules/contrail/manifests/contrail_all.pp b/contrail/environment/modules/contrail/manifests/contrail_all.pp index 053718b2..3b8a6277 100644 --- a/contrail/environment/modules/contrail/manifests/contrail_all.pp +++ b/contrail/environment/modules/contrail/manifests/contrail_all.pp @@ -4,7 +4,9 @@ $host_roles = $contrail::params::host_roles class { '::contrail::provision_start' : state => 'provision_started', stage => 'provision_start' } class { '::sysctl::base' : stage => 'base' } - class { '::apt' : stage => 'common' } + if 'Ubuntu' == $::operatingsystem { + class { '::apt' : stage => 'common' } + } class { '::contrail::profile::common' : stage => 'common' } class { '::contrail::profile::keepalived' : stage => 'keepalived' } class { '::contrail::profile::haproxy' : stage => 'haproxy' } diff --git a/contrail/environment/modules/contrail/manifests/control/service.pp b/contrail/environment/modules/contrail/manifests/control/service.pp index 00be4330..22d6f006 100644 --- a/contrail/environment/modules/contrail/manifests/control/service.pp +++ b/contrail/environment/modules/contrail/manifests/control/service.pp @@ -1,9 +1,10 @@ class contrail::control::service() { - service { 'supervisor-dns' : - ensure => running, - enable => true, + if ($::operatingsystem == 'Ubuntu') { + service { 'supervisor-dns' : + ensure => running, + enable => true, + } } - -> service { 'supervisor-control' : ensure => running, enable => true, diff --git a/contrail/environment/modules/contrail/manifests/enable_kernel_core.pp b/contrail/environment/modules/contrail/manifests/enable_kernel_core.pp index a6f082da..8b16e885 100644 --- a/contrail/environment/modules/contrail/manifests/enable_kernel_core.pp +++ b/contrail/environment/modules/contrail/manifests/enable_kernel_core.pp @@ -7,12 +7,13 @@ owner => root, group => root, source => "puppet:///modules/${module_name}/enable_kernel_core.py" - } -> + } # enable kernel core , below python code has bug, for now ignore by executing echo regardless and thus returning true for cmd. # need to revisit afterwards. - package { 'linux-crashdump' : ensure => present,} - -> + if ($::operatingsystem == 'Ubuntu') { + package { 'linux-crashdump' : ensure => present,} + } exec { 'enable-kernel-core' : command => 'python /etc/contrail/contrail_setup_utils/enable_kernel_core.py; echo enable-kernel-core >> /etc/contrail/contrail_common_exec.out', require => File['/etc/contrail/contrail_setup_utils/enable_kernel_core.py' ], diff --git a/contrail/environment/modules/contrail/manifests/lib/contrail_install_repo.pp b/contrail/environment/modules/contrail/manifests/lib/contrail_install_repo.pp index 0d1f041e..bb092dfc 100644 --- a/contrail/environment/modules/contrail/manifests/lib/contrail_install_repo.pp +++ b/contrail/environment/modules/contrail/manifests/lib/contrail_install_repo.pp @@ -4,14 +4,30 @@ ) { package { ['contrail-fabric-utils', 'contrail-setup' ] : ensure => latest - } -> - - exec { "exec-pip-install-fabric" : - command => "pip install /opt/contrail/python_packages/Fabric-1.7.5.tar.gz && echo exec-pip-install-fabric >> /etc/contrail/contrail_common_exec.out", - provider => shell, - unless => "grep -qx exec-pip-install-fabric /etc/contrail/contrail_common_exec.out", - logoutput => $contrail_logoutput - } -> + } + case $::operatingsystem { + Ubuntu: { + $install_command = "pip install /opt/contrail/python_packages/Fabric-1.7.5.tar.gz && echo exec-pip-install-fabric >> /etc/contrail/contrail_common_exec.out" + exec { "exec-pip-install-fabric" : + command => $install_command, + provider => shell, + unless => "grep -qx exec-pip-install-fabric /etc/contrail/contrail_common_exec.out", + logoutput => $contrail_logoutput + } -> + exec { "exec-disable-jre-prompts" : + command => "echo 'sun-java6-plugin shared/accepted-sun-dlj-v1-1 boolean true' | /usr/bin/debconf-set-selections; echo 'sun-java6-bin shared/accepted-sun-dlj-v1-1 boolean true' | /usr/bin/debconf-set-selections; echo 'sun-java6-jre shared/accepted-sun-dlj-v1-1 boolean true' | /usr/bin/debconf-set-selections; echo 'debconf shared/accepted-oracle-license-v1-1 select true' | sudo debconf-set-selections; echo 'debconf shared/accepted-oracle-license-v1-1 seen true' | sudo debconf-set-selections", + provider => shell, + logoutput => $contrail_logoutput + } + } + 'Centos', 'Fedora' : { + package { ['python-Fabric'] : + ensure => latest + } + } + default: { + } + } #Untill we upgrade to latest puppet , commenting this out #package {Fabric: ensure => present, provider => pip, install_options => ['--find-links=file://opt/contrail/python_packages']} # May need to install fabric-utils here. below commented out code is kept for reference, in case needed. @@ -19,9 +35,4 @@ # disabled sun-java-jre and sun-java-bin prompt during installation, add oracle license acceptance in debconf # disable prompts during java installation and oracle license acceptance - exec { "exec-disable-jre-prompts" : - command => "echo 'sun-java6-plugin shared/accepted-sun-dlj-v1-1 boolean true' | /usr/bin/debconf-set-selections; echo 'sun-java6-bin shared/accepted-sun-dlj-v1-1 boolean true' | /usr/bin/debconf-set-selections; echo 'sun-java6-jre shared/accepted-sun-dlj-v1-1 boolean true' | /usr/bin/debconf-set-selections; echo 'debconf shared/accepted-oracle-license-v1-1 select true' | sudo debconf-set-selections; echo 'debconf shared/accepted-oracle-license-v1-1 seen true' | sudo debconf-set-selections", - provider => shell, - logoutput => $contrail_logoutput - } } diff --git a/contrail/environment/modules/contrail/manifests/lib/contrail_setup_repo.pp b/contrail/environment/modules/contrail/manifests/lib/contrail_setup_repo.pp index 934018f8..8ee30082 100644 --- a/contrail/environment/modules/contrail/manifests/lib/contrail_setup_repo.pp +++ b/contrail/environment/modules/contrail/manifests/lib/contrail_setup_repo.pp @@ -7,7 +7,7 @@ if ($operatingsystem == "Centos" or $operatingsystem == "Fedora") { file { "/etc/yum.repos.d/cobbler-config.repo" : ensure => present, - content => template("contrail-common/contrail-yum-repo.erb") + content => template("${module_name}/contrail-yum-repo.erb") } } if ($operatingsystem == "Ubuntu") { diff --git a/contrail/environment/modules/contrail/manifests/lib/contrail_upgrade.pp b/contrail/environment/modules/contrail/manifests/lib/contrail_upgrade.pp index 1c564713..755a2e34 100644 --- a/contrail/environment/modules/contrail/manifests/lib/contrail_upgrade.pp +++ b/contrail/environment/modules/contrail/manifests/lib/contrail_upgrade.pp @@ -7,7 +7,7 @@ $upgrade_needed = $::contrail::params::upgrade_needed, ) { - if (($contrail_upgrade == true) or ($upgrade_needed == 1)) { + if ((($contrail_upgrade == true) or ($upgrade_needed == 1)) and ($::operatingsystem == "Ubuntu")) { Notify['contrail_upgrade_notify_2']->Notify['contrail_upgrade_notify_4'] notify {'contrail_upgrade_notify_4': name => '*** UPGRADING ***';} -> exec { "update_interface_file1": diff --git a/contrail/environment/modules/contrail/manifests/lib/post_openstack.pp b/contrail/environment/modules/contrail/manifests/lib/post_openstack.pp index 4dac82f7..67b770ff 100644 --- a/contrail/environment/modules/contrail/manifests/lib/post_openstack.pp +++ b/contrail/environment/modules/contrail/manifests/lib/post_openstack.pp @@ -64,6 +64,12 @@ provider => shell, logoutput => $contrail_logoutput, } + } elsif ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') { + exec { 'openstack-svc-restart': + command => "service openstack-nova-api restart && service openstack-nova-conductor restart && service openstack-nova-scheduler restart", + provider => shell, + logoutput => $contrail_logoutput, + } } } } diff --git a/contrail/environment/modules/contrail/manifests/monitor_interface.pp b/contrail/environment/modules/contrail/manifests/monitor_interface.pp new file mode 100644 index 00000000..3bd819e6 --- /dev/null +++ b/contrail/environment/modules/contrail/manifests/monitor_interface.pp @@ -0,0 +1,14 @@ +class contrail::monitor_interface () { + file { '/etc/monitor_intf.sh' : + ensure => present, + mode => 777, + content => template("${module_name}/monitor_intf.sh.erb") + } -> + file { '/usr/lib/systemd/system/monitor_intf.service' : + ensure => present, + content => template("${module_name}/monitor_intf.service.erb") + } -> + service { 'monitor_intf' : + enable => true + } +} diff --git a/contrail/environment/modules/contrail/manifests/profile/neutron/server.pp b/contrail/environment/modules/contrail/manifests/profile/neutron/server.pp index 45c87fd7..80e16fcf 100644 --- a/contrail/environment/modules/contrail/manifests/profile/neutron/server.pp +++ b/contrail/environment/modules/contrail/manifests/profile/neutron/server.pp @@ -5,16 +5,5 @@ $allowed_hosts = $::contrail::params::os_mysql_allowed_hosts, ) { - if (!("openstack" in $host_roles)) { - #openstack::resources::database { 'neutron': } - #contain contrail::profile::openstack::mysql - class { '::contrail::profile::openstack::mysql': - package_manage => 'true' - } -> - class {'::neutron::db::mysql': - password => $service_password, - allowed_hosts => $allowed_hosts, - } - } contain ::contrail::config::neutron } diff --git a/contrail/environment/modules/contrail/manifests/profile/neutron_db_sync.pp b/contrail/environment/modules/contrail/manifests/profile/neutron_db_sync.pp index e5362120..3f5fd08b 100644 --- a/contrail/environment/modules/contrail/manifests/profile/neutron_db_sync.pp +++ b/contrail/environment/modules/contrail/manifests/profile/neutron_db_sync.pp @@ -2,8 +2,14 @@ $contrail_logoutput = $::contrail::params::contrail_logoutput, $database_connection = $::openstack::resources::connectors::neutron ) { + if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') { + $cmd='/usr/bin/neutron-db-manage --database-connection ${database_connection} upgrade head' + } + if ($::operatingsystem == 'Ubuntu') { + $cmd='neutron-db-manage --database-connection ${database_connection} upgrade head' + } exec { 'openstack-neutron-db-sync': - command => "neutron-db-manage --database-connection ${database_connection} upgrade head", + command => $cmd, path => '/usr/bin', #require => Openstack::Resources::Database['neutron'] } diff --git a/contrail/environment/modules/contrail/manifests/profile/openstack/neutron.pp b/contrail/environment/modules/contrail/manifests/profile/openstack/neutron.pp index 970f49d4..4584cf81 100644 --- a/contrail/environment/modules/contrail/manifests/profile/openstack/neutron.pp +++ b/contrail/environment/modules/contrail/manifests/profile/openstack/neutron.pp @@ -11,8 +11,13 @@ class {'::neutron::db::mysql': password => $service_password, allowed_hosts => $allowed_hosts, - } -> - package { 'neutron-server': ensure => present } -> + } + if ($::operatingsystem == 'Ubuntu') { + package { 'neutron-server': ensure => present } + } + if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') { + package { 'openstack-neutron': ensure => present } + } class {'::contrail::profile::neutron_db_sync': database_connection => $keystone_db_conn } diff --git a/contrail/environment/modules/contrail/manifests/profile/openstack_controller.pp b/contrail/environment/modules/contrail/manifests/profile/openstack_controller.pp index 5e7d4679..ad44c5b2 100644 --- a/contrail/environment/modules/contrail/manifests/profile/openstack_controller.pp +++ b/contrail/environment/modules/contrail/manifests/profile/openstack_controller.pp @@ -20,6 +20,14 @@ $openstack_manage_amqp = $::contrail::params::openstack_manage_amqp, $neutron_ip_to_use = $::contrail::params::neutron_ip_to_use ) { + if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') { + $local_settings_file = "/etc/openstack-dashboard/local_settings" + $content_file = "local_settings_centos.erb" + } else { + $local_settings_file = "/etc/openstack-dashboard/local_settings.py" + $content_file = "local_settings.py.erb" + } + $processor_count_str = "${::processorcount}" if ($enable_module and 'openstack' in $host_roles and $is_there_roles_to_delete == false) { contrail::lib::report_status { 'openstack_started': state => 'openstack_started' } -> package {'contrail-openstack' : @@ -30,28 +38,29 @@ 'python-numpy', 'pm-utils', 'libguestfs-tools', 'python-mysqldb', 'python-keystone', 'python-cinderclient']] } -> - class { 'memcached': } -> + class { 'memcached': + processorcount => $processor_count_str + }-> class {'::nova::quota' : quota_instances => 10000, } -> + class {'::contrail::contrail_openstack' : } -> class {'::contrail::profile::openstack::mysql' : } -> Package['python-openstackclient'] -> class {'::contrail::profile::openstack::keystone' : } -> class {'::contrail::profile::openstack::glance' : } -> class {'::contrail::profile::openstack::cinder' : } -> - service { 'supervisor-openstack': enable => true, ensure => running } -> class {'::contrail::profile::openstack::nova' : } -> class {'::contrail::profile::openstack::neutron' : } -> class {'::contrail::profile::openstack::heat' : } -> class {'::contrail::profile::openstack::provision' : } -> class {'::contrail::profile::openstack::auth_file' : } -> - class {'::contrail::contrail_openstack' : } -> package { 'openstack-dashboard': ensure => present } -> - file {'/etc/openstack-dashboard/local_settings.py': + file { $local_settings_file : ensure => present, mode => '0755', group => root, - content => template("${module_name}/local_settings.py.erb") + content => template("${module_name}/${content_file}") } -> contrail::lib::report_status { 'openstack_completed': @@ -67,6 +76,22 @@ contain ::contrail::profile::openstack::neutron contain ::contrail::profile::openstack::heat + if ($::operatingsystem == 'Ubuntu') { + service { 'supervisor-openstack': enable => true, ensure => running } + Class['::contrail::profile::openstack::cinder'] -> Service['supervisor-openstack'] -> Class['::contrail::profile::openstack::nova'] + } + if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') { + class {'::contrail::rabbitmq' : + require => Class['::contrail::profile::openstack::mysql'], + before => Class['::contrail::profile::openstack::keystone'] + } + contain ::contrail::rabbitmq + Package['openstack-dashboard'] -> + service { 'httpd': + ensure => running, + enable => true, + } + } if ($enable_ceilometer) { class {'::contrail::profile::openstack::ceilometer' : before => Class['::contrail::profile::openstack::provision'] @@ -80,9 +105,8 @@ if ($openstack_manage_amqp and ! defined(Class['::contrail::rabbitmq']) ) { contain ::contrail::rabbitmq - Package['contrail-openstack'] -> Class['::contrail::rabbitmq'] -> Service['supervisor-openstack'] + Package['contrail-openstack'] -> Class['::contrail::rabbitmq'] -> Class['::contrail::profile::openstack::cinder'] } - } elsif ((!('openstack' in $host_roles)) and ($contrail_roles['openstack'] == true)) { notify { 'uninstalling openstack':; } contain ::contrail::uninstall_openstack diff --git a/contrail/environment/modules/contrail/manifests/provision_contrail.pp b/contrail/environment/modules/contrail/manifests/provision_contrail.pp index 06732ef1..aa12cfb7 100644 --- a/contrail/environment/modules/contrail/manifests/provision_contrail.pp +++ b/contrail/environment/modules/contrail/manifests/provision_contrail.pp @@ -123,5 +123,6 @@ contain '::contrail::provision_role_config' contain '::contrail::provision_role_database' contain '::contrail::provision_role_collector' - File['/opt/contrail/provision_role.py']->Class['::contrail::exec_provision_control']->Class['::contrail::setup_external_bgp']->Class['::contrail::provision_metadata_services']->Class['::contrail::provision_encap_type']->Class['::contrail::provision_role_config']->Class['::contrail::provision_role_database']->Class['::contrail::provision_role_collector'] + contain ::contrail::config::config_neutron_server + File['/opt/contrail/provision_role.py']->Class['::contrail::exec_provision_control']->Class['::contrail::setup_external_bgp']->Class['::contrail::provision_metadata_services']->Class['::contrail::provision_encap_type']->Class['::contrail::provision_role_config']->Class['::contrail::provision_role_database']->Class['::contrail::provision_role_collector']->Class['::contrail::config::config_neutron_server'] } diff --git a/contrail/environment/modules/contrail/manifests/rabbitmq.pp b/contrail/environment/modules/contrail/manifests/rabbitmq.pp index 76302559..528e1718 100644 --- a/contrail/environment/modules/contrail/manifests/rabbitmq.pp +++ b/contrail/environment/modules/contrail/manifests/rabbitmq.pp @@ -44,9 +44,14 @@ $rabbit_env = "NODE_IP_ADDRESS=${host_control_ip}\nNODENAME=rabbit@${::hostname}ctl\n" if !defined(Service['rabbitmq-server']) { + if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') { + $svc_en = false + } else { + $svc_en = true + } service { 'rabbitmq-server': ensure => running, - enable => true + enable => $svc_en } } @@ -76,7 +81,21 @@ host_control_ip => $host_control_ip, amqp_ip_list => $amqp_ip_list } - + # bringup rabbit only after interface is up, + # otherwise rabbit fails to start in centos after reboot + if ($::operatingsystem == 'Centos' or $::operatingsystem == 'Fedora') { + $sed_cmd = 'sed -i \'s/\(^After=.*\)/\1 monitor.service\nRequires=monitor.service/\'' + Class['::contrail::verify_rabbitmq'] -> + class { '::contrail::monitor_interface' : } -> + # For centos rabbitmq is started as required from monitor_intf, + # disable automatic up. + exec { 'fix-rabbit-svc-config' : + command => "${sed_cmd} /usr/lib/systemd/system/rabbitmq-server.service && echo exec-rabbit-svc-config-fix >> /etc/contrail/rabbit-exec.out", + provider => shell, + unless => "grep -qx exec-rabbit-svc-config-fix /etc/contrail/rabbit-exec.out", + logoutput => $contrail_logoutput + } + } contain ::contrail::verify_rabbitmq contain ::contrail::add_etc_hosts } diff --git a/contrail/environment/modules/contrail/templates/contrail-yum-repo.erb b/contrail/environment/modules/contrail/templates/contrail-yum-repo.erb index f102679f..c21b3b1c 100644 --- a/contrail/environment/modules/contrail/templates/contrail-yum-repo.erb +++ b/contrail/environment/modules/contrail/templates/contrail-yum-repo.erb @@ -2,7 +2,7 @@ name=<%= @contrail_repo_name %> baseurl=http://<%= @contrail_repo_ip %>/cobbler/repo_mirror/<%= @contrail_repo_name %> enabled=1 -priority=99 +priority=1 gpgcheck=0 diff --git a/contrail/environment/modules/contrail/templates/generate_haproxy.erb b/contrail/environment/modules/contrail/templates/generate_haproxy.erb index 0fec638f..fff68690 100755 --- a/contrail/environment/modules/contrail/templates/generate_haproxy.erb +++ b/contrail/environment/modules/contrail/templates/generate_haproxy.erb @@ -4,7 +4,23 @@ # import string import sys - +import platform + +(pdist, pdistversion, pdistrelease) = platform.dist() +if pdist in ['fedora', 'centos', 'redhat']: + stats_cmd = "stats socket /var/lib/haproxy/stats" + err_str="" +if pdist == 'Ubuntu': + stats_cmd = "stats socket /run/haproxy/admin.sock mode 660 level admin" + err_str="\ + errorfile 400 /etc/haproxy/errors/400.http\n\ + errorfile 403 /etc/haproxy/errors/403.http\n\ + errorfile 408 /etc/haproxy/errors/408.http\n\ + errorfile 500 /etc/haproxy/errors/500.http\n\ + errorfile 502 /etc/haproxy/errors/502.http\n\ + errorfile 503 /etc/haproxy/errors/503.http\n\ + errorfile 504 /etc/haproxy/errors/504.http\n" +#contrail-collector-marker-start haproxy_template = string.Template(""" global @@ -15,7 +31,7 @@ global log /dev/log local0 log /dev/log local1 notice chroot /var/lib/haproxy - stats socket /run/haproxy/admin.sock mode 660 level admin + %s stats timeout 30s user haproxy group haproxy @@ -37,14 +53,7 @@ defaults timeout connect 5000 timeout client 50000 timeout server 50000 - errorfile 400 /etc/haproxy/errors/400.http - errorfile 403 /etc/haproxy/errors/403.http - errorfile 408 /etc/haproxy/errors/408.http - errorfile 500 /etc/haproxy/errors/500.http - errorfile 502 /etc/haproxy/errors/502.http - errorfile 503 /etc/haproxy/errors/503.http - errorfile 504 /etc/haproxy/errors/504.http -#contrail-collector-marker-start + %s $__collector_ha_proxy #contrail-collector-marker-end @@ -60,7 +69,7 @@ $__config_ha_proxy $__toragent_ha_proxy #toragent-config-marker-end -""") +"""%(stats_cmd,err_str)) collector_ha_template = string.Template("""#contrail-collector-marker-start listen contrail-collector-stats :5938 diff --git a/contrail/environment/modules/contrail/templates/local_settings_centos.erb b/contrail/environment/modules/contrail/templates/local_settings_centos.erb new file mode 100644 index 00000000..218a078f --- /dev/null +++ b/contrail/environment/modules/contrail/templates/local_settings_centos.erb @@ -0,0 +1,644 @@ +import os + +from django.utils.translation import ugettext_lazy as _ + +from openstack_dashboard import exceptions + +DEBUG = False +TEMPLATE_DEBUG = DEBUG + + +# WEBROOT is the location relative to Webserver root +# should end with a slash. +WEBROOT = '/dashboard/' +# LOGIN_URL = WEBROOT + 'auth/login/' +# LOGOUT_URL = WEBROOT + 'auth/logout/' +# +# LOGIN_REDIRECT_URL can be used as an alternative for +# HORIZON_CONFIG.user_home, if user_home is not set. +# Do not set it to '/home/', as this will cause circular redirect loop +# LOGIN_REDIRECT_URL = WEBROOT + + +# Required for Django 1.5. +# If horizon is running in production (DEBUG is False), set this +# with the list of host/domain names that the application can serve. +# For more information see: +# https://docs.djangoproject.com/en/dev/ref/settings/#allowed-hosts +ALLOWED_HOSTS = ['*', ] +#ALLOWED_HOSTS = ['horizon.example.com', 'localhost'] + +# Set SSL proxy settings: +# For Django 1.4+ pass this header from the proxy after terminating the SSL, +# and don't forget to strip it from the client's request. +# For more information see: +# https://docs.djangoproject.com/en/1.4/ref/settings/#secure-proxy-ssl-header +#SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTOCOL', 'https') + +# If Horizon is being served through SSL, then uncomment the following two +# settings to better secure the cookies from security exploits +#CSRF_COOKIE_SECURE = True +#SESSION_COOKIE_SECURE = True + +# Overrides for OpenStack API versions. Use this setting to force the +# OpenStack dashboard to use a specific API version for a given service API. +# Versions specified here should be integers or floats, not strings. +# NOTE: The version should be formatted as it appears in the URL for the +# service API. For example, The identity service APIs have inconsistent +# use of the decimal point, so valid options would be 2.0 or 3. +#OPENSTACK_API_VERSIONS = { +# "data-processing": 1.1, +# "identity": 3, +# "volume": 2, +#} + +# Set this to True if running on multi-domain model. When this is enabled, it +# will require user to enter the Domain name in addition to username for login. +#OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT = False + +# Overrides the default domain used when running on single-domain model +# with Keystone V3. All entities will be created in the default domain. +#OPENSTACK_KEYSTONE_DEFAULT_DOMAIN = 'Default' + +# Set Console type: +# valid options would be "AUTO"(default), "VNC", "SPICE", "RDP", "SERIAL" or None +# Set to None explicitly if you want to deactivate the console. +#CONSOLE_TYPE = "AUTO" + +# Default OpenStack Dashboard configuration. +HORIZON_CONFIG = { + 'user_home': 'openstack_dashboard.views.get_user_home', + 'ajax_queue_limit': 10, + 'auto_fade_alerts': { + 'delay': 3000, + 'fade_duration': 1500, + 'types': ['alert-success', 'alert-info'] + }, + 'help_url': "http://docs.openstack.org", + 'exceptions': {'recoverable': exceptions.RECOVERABLE, + 'not_found': exceptions.NOT_FOUND, + 'unauthorized': exceptions.UNAUTHORIZED}, + 'modal_backdrop': 'static', + 'angular_modules': [], + 'js_files': [], + 'js_spec_files': [], +} + +# Specify a regular expression to validate user passwords. +#HORIZON_CONFIG["password_validator"] = { +# "regex": '.*', +# "help_text": _("Your password does not meet the requirements."), +#} + +# Disable simplified floating IP address management for deployments with +# multiple floating IP pools or complex network requirements. +#HORIZON_CONFIG["simple_ip_management"] = False + +# Turn off browser autocompletion for forms including the login form and +# the database creation workflow if so desired. +#HORIZON_CONFIG["password_autocomplete"] = "off" + +# Setting this to True will disable the reveal button for password fields, +# including on the login form. +#HORIZON_CONFIG["disable_password_reveal"] = False + + +# Set custom secret key: +# You can either set it to a specific value or you can let horizon generate a +# default secret key that is unique on this machine, e.i. regardless of the +# amount of Python WSGI workers (if used behind Apache+mod_wsgi): However, there +# may be situations where you would want to set this explicitly, e.g. when +# multiple dashboard instances are distributed on different machines (usually +# behind a load-balancer). Either you have to make sure that a session gets all +# requests routed to the same dashboard instance or you set the same SECRET_KEY +# for all of them. +LOCAL_PATH = '/tmp' +SECRET_KEY='d49b1e1ea36c24db6f50' + +# We recommend you use memcached for development; otherwise after every reload +# of the django development server, you will have to login again. To use +# memcached set CACHES to something like +CACHES = { + 'default': { + 'BACKEND': 'django.core.cache.backends.memcached.MemcachedCache', + 'LOCATION': '127.0.0.1:11211', + } +} + +#CACHES = { +# 'default': { +# 'BACKEND': 'django.core.cache.backends.locmem.LocMemCache', +# } +#} + +# Send email to the console by default +EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend' +# Or send them to /dev/null +#EMAIL_BACKEND = 'django.core.mail.backends.dummy.EmailBackend' + +# Configure these for your outgoing email host +#EMAIL_HOST = 'smtp.my-company.com' +#EMAIL_PORT = 25 +#EMAIL_HOST_USER = 'djangomail' +#EMAIL_HOST_PASSWORD = 'top-secret!' + +# For multiple regions uncomment this configuration, and add (endpoint, title). +#AVAILABLE_REGIONS = [ +# ('http://cluster1.example.com:5000/v2.0', 'cluster1'), +# ('http://cluster2.example.com:5000/v2.0', 'cluster2'), +#] + +OPENSTACK_HOST = "127.0.0.1" +OPENSTACK_KEYSTONE_URL = "http://%s:5000/v2.0" % OPENSTACK_HOST +OPENSTACK_KEYSTONE_DEFAULT_ROLE = "user" + +# Enables keystone web single-sign-on if set to True. +#WEBSSO_ENABLED = False + +# Determines which authentication choice to show as default. +#WEBSSO_INITIAL_CHOICE = "credentials" + +# The list of authentication mechanisms +# which include keystone federation protocols. +# Current supported protocol IDs are 'saml2' and 'oidc' +# which represent SAML 2.0, OpenID Connect respectively. +# Do not remove the mandatory credentials mechanism. +#WEBSSO_CHOICES = ( +# ("credentials", _("Keystone Credentials")), +# ("oidc", _("OpenID Connect")), +# ("saml2", _("Security Assertion Markup Language"))) + +# Disable SSL certificate checks (useful for self-signed certificates): +#OPENSTACK_SSL_NO_VERIFY = True + +# The CA certificate to use to verify SSL connections +#OPENSTACK_SSL_CACERT = '/path/to/cacert.pem' + +# The OPENSTACK_KEYSTONE_BACKEND settings can be used to identify the +# capabilities of the auth backend for Keystone. +# If Keystone has been configured to use LDAP as the auth backend then set +# can_edit_user to False and name to 'ldap'. +# +# TODO(tres): Remove these once Keystone has an API to identify auth backend. +OPENSTACK_KEYSTONE_BACKEND = { + 'name': 'native', + 'can_edit_user': True, + 'can_edit_group': True, + 'can_edit_project': True, + 'can_edit_domain': True, + 'can_edit_role': True, +} + +# Setting this to True, will add a new "Retrieve Password" action on instance, +# allowing Admin session password retrieval/decryption. +#OPENSTACK_ENABLE_PASSWORD_RETRIEVE = False + +# The Launch Instance user experience has been significantly enhanced. +# You can choose whether to enable the new launch instance experience, +# the legacy experience, or both. The legacy experience will be removed +# in a future release, but is available as a temporary backup setting to ensure +# compatibility with existing deployments. Further development will not be +# done on the legacy experience. Please report any problems with the new +# experience via the Launchpad tracking system. +# +# Toggle LAUNCH_INSTANCE_LEGACY_ENABLED and LAUNCH_INSTANCE_NG_ENABLED to +# determine the experience to enable. Set them both to true to enable +# both. +#LAUNCH_INSTANCE_LEGACY_ENABLED = True +#LAUNCH_INSTANCE_NG_ENABLED = False + +# The Xen Hypervisor has the ability to set the mount point for volumes +# attached to instances (other Hypervisors currently do not). Setting +# can_set_mount_point to True will add the option to set the mount point +# from the UI. +OPENSTACK_HYPERVISOR_FEATURES = { + 'can_set_mount_point': False, + 'can_set_password': False, +} + +# The OPENSTACK_CINDER_FEATURES settings can be used to enable optional +# services provided by cinder that is not exposed by its extension API. +OPENSTACK_CINDER_FEATURES = { + 'enable_backup': False, +} + +# The OPENSTACK_NEUTRON_NETWORK settings can be used to enable optional +# services provided by neutron. Options currently available are load +# balancer service, security groups, quotas, VPN service. +OPENSTACK_NEUTRON_NETWORK = { + 'enable_router': True, + 'enable_quotas': True, + 'enable_ipv6': True, + 'enable_distributed_router': False, + 'enable_ha_router': False, + 'enable_lb': True, + 'enable_firewall': True, + 'enable_vpn': True, + + # The profile_support option is used to detect if an external router can be + # configured via the dashboard. When using specific plugins the + # profile_support can be turned on if needed. + 'profile_support': None, + #'profile_support': 'cisco', + + # Set which provider network types are supported. Only the network types + # in this list will be available to choose from when creating a network. + # Network types include local, flat, vlan, gre, and vxlan. + 'supported_provider_types': ['*'], + + # Set which VNIC types are supported for port binding. Only the VNIC + # types in this list will be available to choose from when creating a + # port. + # VNIC types include 'normal', 'macvtap' and 'direct'. + 'supported_vnic_types': ['*'] +} + +# The OPENSTACK_IMAGE_BACKEND settings can be used to customize features +# in the OpenStack Dashboard related to the Image service, such as the list +# of supported image formats. +#OPENSTACK_IMAGE_BACKEND = { +# 'image_formats': [ +# ('', _('Select format')), +# ('aki', _('AKI - Amazon Kernel Image')), +# ('ami', _('AMI - Amazon Machine Image')), +# ('ari', _('ARI - Amazon Ramdisk Image')), +# ('iso', _('ISO - Optical Disk Image')), +# ('ova', _('OVA - Open Virtual Appliance')), +# ('qcow2', _('QCOW2 - QEMU Emulator')), +# ('raw', _('Raw')), +# ('vdi', _('VDI - Virtual Disk Image')), +# ('vhd', ('VHD - Virtual Hard Disk')), +# ('vmdk', _('VMDK - Virtual Machine Disk')), +# ] +#} + +# The IMAGE_CUSTOM_PROPERTY_TITLES settings is used to customize the titles for +# image custom property attributes that appear on image detail pages. +IMAGE_CUSTOM_PROPERTY_TITLES = { + "architecture": _("Architecture"), + "kernel_id": _("Kernel ID"), + "ramdisk_id": _("Ramdisk ID"), + "image_state": _("Euca2ools state"), + "project_id": _("Project ID"), + "image_type": _("Image Type"), +} + +# The IMAGE_RESERVED_CUSTOM_PROPERTIES setting is used to specify which image +# custom properties should not be displayed in the Image Custom Properties +# table. +IMAGE_RESERVED_CUSTOM_PROPERTIES = [] + +# OPENSTACK_ENDPOINT_TYPE specifies the endpoint type to use for the endpoints +# in the Keystone service catalog. Use this setting when Horizon is running +# external to the OpenStack environment. The default is 'publicURL'. +#OPENSTACK_ENDPOINT_TYPE = "publicURL" + +# SECONDARY_ENDPOINT_TYPE specifies the fallback endpoint type to use in the +# case that OPENSTACK_ENDPOINT_TYPE is not present in the endpoints +# in the Keystone service catalog. Use this setting when Horizon is running +# external to the OpenStack environment. The default is None. This +# value should differ from OPENSTACK_ENDPOINT_TYPE if used. +#SECONDARY_ENDPOINT_TYPE = "publicURL" + +# The number of objects (Swift containers/objects or images) to display +# on a single page before providing a paging element (a "more" link) +# to paginate results. +API_RESULT_LIMIT = 1000 +API_RESULT_PAGE_SIZE = 20 + +# The size of chunk in bytes for downloading objects from Swift +SWIFT_FILE_TRANSFER_CHUNK_SIZE = 512 * 1024 + +# Specify a maximum number of items to display in a dropdown. +DROPDOWN_MAX_ITEMS = 30 + +# The timezone of the server. This should correspond with the timezone +# of your entire OpenStack installation, and hopefully be in UTC. +TIME_ZONE = "UTC" + +# When launching an instance, the menu of available flavors is +# sorted by RAM usage, ascending. If you would like a different sort order, +# you can provide another flavor attribute as sorting key. Alternatively, you +# can provide a custom callback method to use for sorting. You can also provide +# a flag for reverse sort. For more info, see +# http://docs.python.org/2/library/functions.html#sorted +#CREATE_INSTANCE_FLAVOR_SORT = { +# 'key': 'name', +# # or +# 'key': my_awesome_callback_method, +# 'reverse': False, +#} + +# Set this to True to display an 'Admin Password' field on the Change Password +# form to verify that it is indeed the admin logged-in who wants to change +# the password. +# ENFORCE_PASSWORD_CHECK = False + +# Modules that provide /auth routes that can be used to handle different types +# of user authentication. Add auth plugins that require extra route handling to +# this list. +#AUTHENTICATION_URLS = [ +# 'openstack_auth.urls', +#] + +# The Horizon Policy Enforcement engine uses these values to load per service +# policy rule files. The content of these files should match the files the +# OpenStack services are using to determine role based access control in the +# target installation. + +# Path to directory containing policy.json files +# POLICY_FILES_PATH = os.path.join(ROOT_PATH, "conf") +POLICY_FILES_PATH = '/etc/openstack-dashboard' +# Map of local copy of service policy files +#POLICY_FILES = { +# 'identity': 'keystone_policy.json', +# 'compute': 'nova_policy.json', +# 'volume': 'cinder_policy.json', +# 'image': 'glance_policy.json', +# 'orchestration': 'heat_policy.json', +# 'network': 'neutron_policy.json', +# 'telemetry': 'ceilometer_policy.json', +#} + +# Trove user and database extension support. By default support for +# creating users and databases on database instances is turned on. +# To disable these extensions set the permission here to something +# unusable such as ["!"]. +# TROVE_ADD_USER_PERMS = [] +# TROVE_ADD_DATABASE_PERMS = [] + +# Change this patch to the appropriate static directory containing +# two files: _variables.scss and _styles.scss +#CUSTOM_THEME_PATH = 'static/themes/default' + +LOGGING = { + 'version': 1, + # When set to True this will disable all logging except + # for loggers specified in this configuration dictionary. Note that + # if nothing is specified here and disable_existing_loggers is True, + # django.db.backends will still log unless it is disabled explicitly. + 'disable_existing_loggers': False, + 'handlers': { + 'null': { + 'level': 'DEBUG', + 'class': 'django.utils.log.NullHandler', + }, + 'console': { + # Set the level to "DEBUG" for verbose output logging. + 'level': 'INFO', + 'class': 'logging.StreamHandler', + }, + }, + 'loggers': { + # Logging from django.db.backends is VERY verbose, send to null + # by default. + 'django.db.backends': { + 'handlers': ['null'], + 'propagate': False, + }, + 'requests': { + 'handlers': ['null'], + 'propagate': False, + }, + 'horizon': { + 'handlers': ['console'], + 'level': 'DEBUG', + 'propagate': False, + }, + 'openstack_dashboard': { + 'handlers': ['console'], + 'level': 'DEBUG', + 'propagate': False, + }, + 'novaclient': { + 'handlers': ['console'], + 'level': 'DEBUG', + 'propagate': False, + }, + 'cinderclient': { + 'handlers': ['console'], + 'level': 'DEBUG', + 'propagate': False, + }, + 'keystoneclient': { + 'handlers': ['console'], + 'level': 'DEBUG', + 'propagate': False, + }, + 'glanceclient': { + 'handlers': ['console'], + 'level': 'DEBUG', + 'propagate': False, + }, + 'neutronclient': { + 'handlers': ['console'], + 'level': 'DEBUG', + 'propagate': False, + }, + 'heatclient': { + 'handlers': ['console'], + 'level': 'DEBUG', + 'propagate': False, + }, + 'ceilometerclient': { + 'handlers': ['console'], + 'level': 'DEBUG', + 'propagate': False, + }, + 'troveclient': { + 'handlers': ['console'], + 'level': 'DEBUG', + 'propagate': False, + }, + 'swiftclient': { + 'handlers': ['console'], + 'level': 'DEBUG', + 'propagate': False, + }, + 'openstack_auth': { + 'handlers': ['console'], + 'level': 'DEBUG', + 'propagate': False, + }, + 'nose.plugins.manager': { + 'handlers': ['console'], + 'level': 'DEBUG', + 'propagate': False, + }, + 'django': { + 'handlers': ['console'], + 'level': 'DEBUG', + 'propagate': False, + }, + 'iso8601': { + 'handlers': ['null'], + 'propagate': False, + }, + 'scss': { + 'handlers': ['null'], + 'propagate': False, + }, + } +} + +# 'direction' should not be specified for all_tcp/udp/icmp. +# It is specified in the form. +SECURITY_GROUP_RULES = { + 'all_tcp': { + 'name': _('All TCP'), + 'ip_protocol': 'tcp', + 'from_port': '1', + 'to_port': '65535', + }, + 'all_udp': { + 'name': _('All UDP'), + 'ip_protocol': 'udp', + 'from_port': '1', + 'to_port': '65535', + }, + 'all_icmp': { + 'name': _('All ICMP'), + 'ip_protocol': 'icmp', + 'from_port': '-1', + 'to_port': '-1', + }, + 'ssh': { + 'name': 'SSH', + 'ip_protocol': 'tcp', + 'from_port': '22', + 'to_port': '22', + }, + 'smtp': { + 'name': 'SMTP', + 'ip_protocol': 'tcp', + 'from_port': '25', + 'to_port': '25', + }, + 'dns': { + 'name': 'DNS', + 'ip_protocol': 'tcp', + 'from_port': '53', + 'to_port': '53', + }, + 'http': { + 'name': 'HTTP', + 'ip_protocol': 'tcp', + 'from_port': '80', + 'to_port': '80', + }, + 'pop3': { + 'name': 'POP3', + 'ip_protocol': 'tcp', + 'from_port': '110', + 'to_port': '110', + }, + 'imap': { + 'name': 'IMAP', + 'ip_protocol': 'tcp', + 'from_port': '143', + 'to_port': '143', + }, + 'ldap': { + 'name': 'LDAP', + 'ip_protocol': 'tcp', + 'from_port': '389', + 'to_port': '389', + }, + 'https': { + 'name': 'HTTPS', + 'ip_protocol': 'tcp', + 'from_port': '443', + 'to_port': '443', + }, + 'smtps': { + 'name': 'SMTPS', + 'ip_protocol': 'tcp', + 'from_port': '465', + 'to_port': '465', + }, + 'imaps': { + 'name': 'IMAPS', + 'ip_protocol': 'tcp', + 'from_port': '993', + 'to_port': '993', + }, + 'pop3s': { + 'name': 'POP3S', + 'ip_protocol': 'tcp', + 'from_port': '995', + 'to_port': '995', + }, + 'ms_sql': { + 'name': 'MS SQL', + 'ip_protocol': 'tcp', + 'from_port': '1433', + 'to_port': '1433', + }, + 'mysql': { + 'name': 'MYSQL', + 'ip_protocol': 'tcp', + 'from_port': '3306', + 'to_port': '3306', + }, + 'rdp': { + 'name': 'RDP', + 'ip_protocol': 'tcp', + 'from_port': '3389', + 'to_port': '3389', + }, +} + +# Deprecation Notice: +# +# The setting FLAVOR_EXTRA_KEYS has been deprecated. +# Please load extra spec metadata into the Glance Metadata Definition Catalog. +# +# The sample quota definitions can be found in: +# /etc/metadefs/compute-quota.json +# +# The metadata definition catalog supports CLI and API: +# $glance --os-image-api-version 2 help md-namespace-import +# $glance-manage db_load_metadefs +# +# See Metadata Definitions on: http://docs.openstack.org/developer/glance/ + +# Indicate to the Sahara data processing service whether or not +# automatic floating IP allocation is in effect. If it is not +# in effect, the user will be prompted to choose a floating IP +# pool for use in their cluster. False by default. You would want +# to set this to True if you were running Nova Networking with +# auto_assign_floating_ip = True. +#SAHARA_AUTO_IP_ALLOCATION_ENABLED = False + +# The hash algorithm to use for authentication tokens. This must +# match the hash algorithm that the identity server and the +# auth_token middleware are using. Allowed values are the +# algorithms supported by Python's hashlib library. +#OPENSTACK_TOKEN_HASH_ALGORITHM = 'md5' + +# Hashing tokens from Keystone keeps the Horizon session data smaller, but it +# doesn't work in some cases when using PKI tokens. Uncomment this value and +# set it to False if using PKI tokens and there are 401 errors due to token +# hashing. +#OPENSTACK_TOKEN_HASH_ENABLED = True + +# AngularJS requires some settings to be made available to +# the client side. Some settings are required by in-tree / built-in horizon +# features. These settings must be added to REST_API_REQUIRED_SETTINGS in the +# form of ['SETTING_1','SETTING_2'], etc. +# +# You may remove settings from this list for security purposes, but do so at +# the risk of breaking a built-in horizon feature. These settings are required +# for horizon to function properly. Only remove them if you know what you +# are doing. These settings may in the future be moved to be defined within +# the enabled panel configuration. +# You should not add settings to this list for out of tree extensions. +# See: https://wiki.openstack.org/wiki/Horizon/RESTAPI +REST_API_REQUIRED_SETTINGS = ['OPENSTACK_HYPERVISOR_FEATURES'] + +# Additional settings can be made available to the client side for +# extensibility by specifying them in REST_API_ADDITIONAL_SETTINGS +# !! Please use extreme caution as the settings are transferred via HTTP/S +# and are not encrypted on the browser. This is an experimental API and +# may be deprecated in the future without notice. +#REST_API_ADDITIONAL_SETTINGS = [] diff --git a/contrail/environment/modules/contrail/templates/monitor_intf.service.erb b/contrail/environment/modules/contrail/templates/monitor_intf.service.erb new file mode 100644 index 00000000..09293503 --- /dev/null +++ b/contrail/environment/modules/contrail/templates/monitor_intf.service.erb @@ -0,0 +1,14 @@ +[Unit] +Description=Wait For INTF +Requisite=NetworkManager.service +After=NetworkManager.service +Wants=network.target rabbitmq-server.service +Before=network.target network-online.target + +[Service] +Type=oneshot +ExecStart=/etc/monitor_intf.sh + +[Install] +WantedBy=multi-user.target + diff --git a/contrail/environment/modules/contrail/templates/monitor_intf.sh.erb b/contrail/environment/modules/contrail/templates/monitor_intf.sh.erb new file mode 100755 index 00000000..4fa2db19 --- /dev/null +++ b/contrail/environment/modules/contrail/templates/monitor_intf.sh.erb @@ -0,0 +1,19 @@ +#!/bin/bash + +rm -rf /var/log/monitor.log && touch /var/log/monitor.log +chmod 777 /var/log/monitor.log +ipaddr="<%= @host_control_ip %>" +i=0 +while [ $i -lt 30 ] + do + (( i = i + 1)) + ifconfig |grep -q $ipaddr + if [ $? -ne 0 ]; then + echo "no ip address yet!! $i" >> /var/log/monitor.log + sleep 20 + else + echo "got the ip address" >> /var/log/monitor.log + exit 0 + fi + done +exit 1