Remove deprecated CentOS 6 and Ubuntu 14.04 code from library

Depends-On: Ia6504a73d89e3ef7ca79a874ebf2a86beed2b883
Change-Id: Ibbd4089e505369d7340a05662ecc9cb10852bf02
Partial-Bug: #1619027
Signed-off-by: Maksim Malchuk <mmalchuk@mirantis.com>
This commit is contained in:
Maksim Malchuk 2016-09-02 20:49:45 +03:00
parent d75641cc6e
commit 9e8889d85e
43 changed files with 96 additions and 517 deletions

View File

@ -78,28 +78,26 @@ class cluster::rabbitmq_fence(
require => Package['rabbitmq-server'],
}
if $::osfamily == 'Debian' and $::operatingsystemrelease =~ /^14/ {
Exec {
path => [ '/bin', '/usr/bin' ],
before => Service['corosync-notifyd'],
}
Exec {
path => [ '/bin', '/usr/bin' ],
before => Service['corosync-notifyd'],
}
exec { 'enable_corosync_notifyd':
command => 'sed -i s/START=no/START=yes/ /etc/default/corosync-notifyd',
unless => 'grep START=yes /etc/default/corosync-notifyd',
}
exec { 'enable_corosync_notifyd':
command => 'sed -i s/START=no/START=yes/ /etc/default/corosync-notifyd',
unless => 'grep START=yes /etc/default/corosync-notifyd',
}
#https://bugs.launchpad.net/ubuntu/+source/corosync/+bug/1437368
#FIXME(bogdando) remove these hacks after switched to systemd service.units
exec { 'fix_corosync_notifyd_init_args':
command => 'sed -i s/DAEMON_ARGS=\"\"/DAEMON_ARGS=\"-d\"/ /etc/init.d/corosync-notifyd',
onlyif => 'grep \'DAEMON_ARGS=""\' /etc/init.d/corosync-notifyd',
}
#https://bugs.launchpad.net/ubuntu/+source/corosync/+bug/1437368
#FIXME(bogdando) remove these hacks after switched to systemd service.units
exec { 'fix_corosync_notifyd_init_args':
command => 'sed -i s/DAEMON_ARGS=\"\"/DAEMON_ARGS=\"-d\"/ /etc/init.d/corosync-notifyd',
onlyif => 'grep \'DAEMON_ARGS=""\' /etc/init.d/corosync-notifyd',
}
#https://bugs.launchpad.net/ubuntu/+source/corosync/+bug/1437359
exec { 'fix_corosync_notifyd_init_pidfile':
command => 'sed -i \'/PIDFILE=\/var\/run\/corosync.pid/d\' /etc/init.d/corosync-notifyd',
onlyif => 'grep \'PIDFILE=/var/run/corosync.pid\' /etc/init.d/corosync-notifyd',
}
#https://bugs.launchpad.net/ubuntu/+source/corosync/+bug/1437359
exec { 'fix_corosync_notifyd_init_pidfile':
command => 'sed -i \'/PIDFILE=\/var\/run\/corosync.pid/d\' /etc/init.d/corosync-notifyd',
onlyif => 'grep \'PIDFILE=/var/run/corosync.pid\' /etc/init.d/corosync-notifyd',
}
}

View File

@ -18,7 +18,7 @@ def supported_os
},
{
'operatingsystem' => 'Ubuntu',
'operatingsystemrelease' => ['14.04', '16.04'],
'operatingsystemrelease' => ['16.04'],
},
]
end

View File

@ -17,20 +17,13 @@ class cobbler::packages {
case $::operatingsystem {
/(?i)(centos|redhat)/: {
$cobbler_package = 'cobbler'
$cobbler_web_package = 'cobbler-web'
$dnsmasq_package = 'dnsmasq'
$django_package = 'python-django'
$openssh_package = 'openssh-clients'
$pexpect_package = 'pexpect'
case $::operatingsystemrelease {
/6.+/: {
$cobbler_additional_packages = ['xinetd', 'tftp-server', 'syslinux', 'wget', 'python-ipaddr','fence-agents', 'bind-utils']
}
/7.+/: {
$cobbler_additional_packages = ['xinetd', 'tftp-server', 'syslinux', 'wget', 'python-ipaddr','fence-agents-all', 'bind-utils']
}
}
$cobbler_package = 'cobbler'
$cobbler_web_package = 'cobbler-web'
$dnsmasq_package = 'dnsmasq'
$django_package = 'python-django'
$openssh_package = 'openssh-clients'
$pexpect_package = 'pexpect'
$cobbler_additional_packages = ['xinetd', 'tftp-server', 'syslinux', 'wget', 'python-ipaddr','fence-agents-all', 'bind-utils']
}
/(?i)(debian|ubuntu)/: {
$cobbler_package = 'cobbler'
@ -42,6 +35,9 @@ class cobbler::packages {
$openssh_package = 'openssh-client'
$pexpect_package = 'python-pexpect'
}
default: {
fail("Unsupported operatingsystem: ${::operatingsystem}, module ${module_name} only support CentOS/RedHat and Ubuntu/Debian")
}
}
ensure_packages($cobbler_additional_packages)

View File

@ -25,7 +25,7 @@ def supported_os
},
{
'operatingsystem' => 'Ubuntu',
'operatingsystemrelease' => ['14.04'],
'operatingsystemrelease' => ['16.04'],
},
]
end

View File

@ -1,104 +0,0 @@
#!/usr/bin/python
import atexit
import exceptions
import pexpect
import sys
import time
sys.path.append("/usr/share/fence")
from fencing import all_opt
from fencing import atexit_handler
from fencing import check_input
from fencing import fence_action
from fencing import fence_login
from fencing import process_input
from fencing import show_docs
# BEGIN_VERSION_GENERATION
RELEASE_VERSION = "0.1.0"
BUILD_DATE = "(built Wed Oct 31 11:20:18 UTC 2012)"
MIRANTIS_COPYRIGHT = "Copyright (C) Mirantis, Inc. 2012 All rights reserved."
# END_VERSION_GENERATION
def get_power_status(conn, options):
try:
conn.sendline("/bin/echo 1")
conn.log_expect(options, options["-c"], int(options["-Y"]))
except Exception:
return "off"
return "on"
def set_power_status(conn, options):
if options["-o"] == "off":
try:
conn.sendline("sh -c '(sleep 1;/sbin/reboot -f)' &>/dev/null &")
conn.log_expect(options, options["-c"], int(options["-g"]))
time.sleep(2)
except Exception:
pass
def main():
device_opt = ["help", "version", "agent", "quiet", "verbose", "debug",
"action", "ipaddr", "login", "passwd", "passwd_script",
"secure", "identity_file", "test", "port", "separator",
"inet4_only", "inet6_only", "ipport",
"power_timeout", "shell_timeout",
"login_timeout", "power_wait"]
atexit.register(atexit_handler)
all_opt["login_timeout"]["default"] = 60
pinput = process_input(device_opt)
# use ssh to manipulate node
pinput["-x"] = 1
options = check_input(device_opt, pinput)
if options["-o"] != "off":
sys.exit(0)
options["-c"] = "\[EXPECT\]#\ "
# this string will be appended to the end of ssh command
strict = "-t -o 'StrictHostKeyChecking=no'"
serveralive = "-o 'ServerAliveInterval 2'"
no_stdin = "-n"
bash = "/bin/bash --noprofile --norc"
options["ssh_options"] = "{0} {1} {2} '/bin/bash -c " \
"\"PS1={3} {4}\"'".format(
strict, serveralive, no_stdin, options["-c"],
bash)
options["-X"] = "{0} {1} {2} '/bin/bash -c " \
"\"PS1={3} {4}\"'".format(
strict, serveralive, no_stdin, options["-c"], bash)
docs = {}
docs["shortdesc"] = "Fence agent that can just reboot node via ssh"
docs["longdesc"] = "fence_ssh is an I/O Fencing agent \
which can be used to reboot nodes via ssh."
show_docs(options, docs)
# Operate the fencing device
# this method will actually launch ssh command
conn = fence_login(options)
result = fence_action(conn, options, set_power_status,
get_power_status, None)
try:
conn.close()
except exceptions.OSError:
pass
except pexpect.ExceptionPexpect:
pass
sys.exit(result)
if __name__ == "__main__":
main()

View File

@ -32,19 +32,7 @@ class fuel::cobbler(
$real_server = $next_server
if $::osfamily == 'RedHat' {
case $operatingsystemmajrelease {
'6': {
$fence_ssh_source = 'puppet:///modules/fuel/cobbler/fence_ssh.centos6.py'
}
'7': {
$fence_ssh_source = 'puppet:///modules/fuel/cobbler/fence_ssh.centos7.py'
}
default: {
$fence_ssh_source = 'puppet:///modules/fuel/cobbler/fence_ssh.centos6.py'
}
}
}
$fence_ssh_source = 'puppet:///modules/fuel/cobbler/fence_ssh.centos7.py'
class { '::cobbler':
server => $server,

View File

@ -41,24 +41,9 @@ class fuel::mcollective(
}
}
if $::osfamily == 'RedHat' {
case $operatingsystemmajrelease {
'6': {
$mco_packages = ['ruby21-rubygem-mcollective-client',
'ruby21-nailgun-mcagents']
}
'7': {
$mco_packages = ['mcollective-client',
'rubygem-mcollective-client',
'nailgun-mcagents']
}
default: {
fail("Unsupported ${::osfamily} release: ${::operatingsystemmajrelease}")
}
}
}
$mco_packages = ['mcollective-client', 'rubygem-mcollective-client', 'nailgun-mcagents']
ensure_packages($mco_packages)
ensure_packages($mco_packages_extra)
class { '::mcollective':

View File

@ -38,7 +38,6 @@ describe "fuel::keystone" do
:priority => '05',
:threads => 3,
:vhost_custom_fragment => 'LimitRequestFieldSize 81900',
:workers => 1,
:access_log_format => 'forwarded',
)
end
@ -47,11 +46,16 @@ describe "fuel::keystone" do
end
on_supported_os(supported_os: supported_os).each do |os, facts|
context "on #{os}" do
let(:facts) { facts.merge!(@default_facts) }
it_configures "keystone configuration"
context 'on RedHat platforms' do
let :facts do
@default_facts.merge({
:osfamily => 'RedHat',
:operatingsystem => 'CentOS',
:operatingsystemrelease => '7.0',
:puppetversion => Puppet.version,
})
end
it_configures "keystone configuration"
end
end

View File

@ -18,7 +18,7 @@ def supported_os
{ 'operatingsystem' => 'CentOS',
'operatingsystemrelease' => [ '7.0' ] },
{ 'operatingsystem' => 'Ubuntu',
'operatingsystemrelease' => [ '14.04' ] }
'operatingsystemrelease' => [ '16.04' ] }
]
end

View File

@ -14,10 +14,7 @@ class l23network::params {
$lnx_bond_tools = 'ifenslave'
$lnx_ethernet_tools = 'ethtool'
$lnx_bridge_tools = 'bridge-utils'
$ovs_datapath_package_name = $::operatingsystemmajrelease ? {
/^14\./ =>'openvswitch-datapath-dkms',
default => undef
}
$ovs_datapath_package_name = undef
$ovs_common_package_name = 'openvswitch-switch'
$ovs_dpdk_package_name = 'openvswitch-switch-dpdk'
$ovs_dpdk_dkms_package_name = 'dpdk-dkms'
@ -81,7 +78,7 @@ class l23network::params {
$ovs_memory_channels = undef
}
default: {
fail("Unsupported OS: ${l23_os}/${::operatingsystem}")
fail("Unsupported OS: ${::l23_os}/${::operatingsystem}")
}
}
}

View File

@ -149,138 +149,6 @@ describe 'l23network::l2' do
end
context 'Ubuntu-14.04' do
let (:facts) do
{ :l23_os => 'ubuntu',
:l3_fqdn_hostname => 'my_name',
:operatingsystemmajrelease => '14.04'
}
end
let :pre_condition do
'K_mod <| |>'
end
puppet_debug_override
context 'with a default params' do
let :params do
{
:modprobe_bonding => true,
:modprobe_8021q => true,
:modprobe_bridge => true,
}
end
it { should compile.with_all_deps }
it { should_not contain_package('openvswitch-datapath') }
it { should_not contain_package('openvswitch-common') }
it { should_not contain_package('openvswitch-dpdk').with_name('openvswitch-switch-dpdk') }
it { should_not contain_service('openvswitch-service') }
it { should_not contain_service('dpdk') }
it { should_not contain_k_mod('openvswitch').with_ensure('present') }
it { should contain_k_mod('bonding') }
it { should contain_k_mod('8021q') }
it { should contain_k_mod('bridge') }
end
context 'use_ovs with default parameters' do
let :params do
{ :ensure_package => 'present',
:use_lnx => true,
:use_ovs => true,
}
end
it { should compile.with_all_deps }
it { should contain_package('openvswitch-datapath').with_name('openvswitch-datapath-dkms') }
it { should contain_package('openvswitch-datapath').that_comes_before('Service[openvswitch-service]') }
it { should contain_package('openvswitch-common').with_name('openvswitch-switch') }
it { should contain_package('openvswitch-common').that_notifies('Service[openvswitch-service]') }
it { should contain_service('openvswitch-service') }
it { should contain_k_mod('openvswitch').with_ensure('present') }
end
context 'use_ovs and custom ovs_datapath_package_name and custom ovs_module_name and ovs_common_package_name' do
let :params do
{ :ensure_package => 'present',
:use_lnx => true,
:use_ovs => true,
:ovs_module_name => 'custom_ovs_module_name',
:ovs_datapath_package_name => 'custom_ovs_datapath_package_name',
:ovs_common_package_name => 'test_ovs_common_package_name',
}
end
it { should compile.with_all_deps }
it { should contain_package('openvswitch-datapath').with_name('custom_ovs_datapath_package_name') }
it { should contain_package('openvswitch-datapath').that_comes_before('Service[openvswitch-service]') }
it { should contain_package('openvswitch-common').with_name('test_ovs_common_package_name') }
it { should contain_package('openvswitch-common').that_notifies('Service[openvswitch-service]') }
it { should contain_service('openvswitch-service') }
it { should contain_k_mod('custom_ovs_module_name').with_ensure('present') }
end
context 'use_ovs, use_dpdk with default parameters' do
let :params do
{ :ensure_package => 'present',
:use_lnx => true,
:use_ovs => true,
:use_dpdk => true,
}
end
it { should compile.with_all_deps }
it { should contain_package('openvswitch-datapath').with_name('openvswitch-datapath-dkms') }
it { should contain_package('openvswitch-datapath').that_comes_before('Service[openvswitch-service]') }
it { should contain_package('openvswitch-common').with_name('openvswitch-switch') }
it { should contain_package('openvswitch-common').that_notifies('Service[openvswitch-service]') }
it { should contain_package('dpdk-dkms').with_name('dpdk-dkms') }
it { should contain_package('dpdk-dkms').that_comes_before('Service[dpdk]') }
it { should contain_file('/etc/dpdk/interfaces').that_comes_before('File[/etc/default/openvswitch-switch]') }
it { should contain_file('/etc/dpdk/interfaces').that_notifies('Service[dpdk]') }
it { should contain_file('/etc/dpdk/interfaces').that_notifies('Service[openvswitch-service]') }
it { should contain_package('openvswitch-dpdk').with_name('openvswitch-switch-dpdk') }
it { should contain_package('openvswitch-dpdk').that_notifies('Service[openvswitch-service]') }
it { should contain_package('openvswitch-dpdk').that_comes_before('File[/etc/default/openvswitch-switch]') }
it { should contain_file('/etc/default/openvswitch-switch').that_notifies('Service[openvswitch-service]') }
it { should contain_service('openvswitch-service') }
it { should contain_k_mod('openvswitch').with_ensure('present') }
end
end
context 'Ubuntu-16.04' do
let (:facts) do
{ :l23_os => 'ubuntu',

View File

@ -11,7 +11,7 @@ def supported_os
},
{
'operatingsystem' => 'Ubuntu',
'operatingsystemrelease' => ['14.04', '16.04'],
'operatingsystemrelease' => ['16.04'],
},
]
end

View File

@ -63,14 +63,7 @@ class openstack::galera::client (
$mysql_client_name = 'MySQL-client-wsrep'
}
'Debian': {
# TODO(dmburmistrov): after dropping trusty support
# remove this if, only 'mysql-wsrep-client-5.6' should
# be preserved
if $::operatingsystemrelease =~ /^14/ {
$mysql_client_name = 'mysql-client-5.6'
} else {
$mysql_client_name = 'mysql-wsrep-client-5.6'
}
$mysql_client_name = 'mysql-wsrep-client-5.6'
}
default: {
fail("Unsupported osfamily: ${::osfamily} operatingsystem: ${::operatingsystem}, module ${module_name} only support osfamily RedHat and Debian")

View File

@ -7,11 +7,7 @@ describe 'openstack::galera::client' do
let(:mysql_client_name) do
case facts[:osfamily]
when 'Debian'
if facts[:operatingsystemrelease] =~ /^14/
'mysql-client-5.6'
else
'mysql-wsrep-client-5.6'
end
'mysql-wsrep-client-5.6'
when 'RedHat'
'MySQL-client-wsrep'
else

View File

@ -18,7 +18,7 @@ def supported_os
},
{
'operatingsystem' => 'Ubuntu',
'operatingsystemrelease' => ['14.04', '16.04'],
'operatingsystemrelease' => ['16.04'],
},
]
end

View File

@ -31,17 +31,10 @@ class openstack_tasks::openstack_network::compute_nova {
$nova_migration_ip = get_network_role_property('nova/migration', 'ipaddr')
if $::operatingsystemmajrelease == '16.04' {
# This override is required only for 16.04 Ubuntu because we are using UCA libvirt package.
$libvirt_service_name = 'libvirt-bin'
} else {
$libvirt_service_name = $::nova::params::libvirt_service_name
}
service { 'libvirt' :
ensure => 'running',
enable => true,
name => $libvirt_service_name,
name => 'libvirt-bin',
provider => $::nova::params::special_service_provider,
}

View File

@ -376,17 +376,6 @@ class openstack_tasks::roles::compute {
$disk_cachemodes = ['"file=directsync,block=none"']
}
if $::operatingsystemmajrelease == '16.04' {
# This override is required only for 16.04 Ubuntu because we are using UCA libvirt package.
$libvirt_service_name = 'libvirt-bin'
$virtlock_service_name = 'virtlockd'
$virtlog_service_name = 'virtlogd'
} else {
$libvirt_service_name = $::nova::params::libvirt_service_name
$virtlock_service_name = $::nova::params::virtlock_service_name
$virtlog_service_name = $::nova::params::virtlog_service_name
}
# Configure libvirt for nova-compute
class { '::nova::compute::libvirt':
libvirt_virt_type => $libvirt_type,
@ -395,9 +384,9 @@ class openstack_tasks::roles::compute {
libvirt_inject_partition => $libvirt_inject_partition,
vncserver_listen => '0.0.0.0',
remove_unused_original_minimum_age_seconds => pick($nova_hash_real['remove_unused_original_minimum_age_seconds'], '86400'),
libvirt_service_name => $libvirt_service_name,
virtlock_service_name => $virtlock_service_name,
virtlog_service_name => $virtlog_service_name,
libvirt_service_name => 'libvirt-bin',
virtlock_service_name => 'virtlockd',
virtlog_service_name => 'virtlogd',
}
class { '::nova::migration::libvirt':

View File

@ -124,25 +124,18 @@ class openstack_tasks::roles::ironic_conductor {
require => Class['::ironic'],
}
if $::operatingsystemmajrelease == '16.04' {
$pxelinux_source = '/usr/lib/PXELINUX/pxelinux.0'
$pxelinux_package = ['syslinux', 'pxelinux']
# TODO(vsaienko) remove provider hack when puppetlabs-tftp fixed issue with
# default provider.
Service <| title == 'tftpd-hpa' |> { provider => 'systemd'}
} else {
$pxelinux_source = '/usr/lib/syslinux/pxelinux.0'
$pxelinux_package = 'syslinux'
}
# TODO(vsaienko) remove provider hack when puppetlabs-tftp fixed issue with
# default provider.
Service <| title == 'tftpd-hpa' |> { provider => 'systemd'}
package { $pxelinux_package:
ensure_packages(['syslinux', 'pxelinux'], {
ensure => 'present',
before => File["${tftp_root}/pxelinux.0"]
}
})
file { "${tftp_root}/pxelinux.0":
ensure => present,
source => $pxelinux_source,
ensure => present,
source => '/usr/lib/PXELINUX/pxelinux.0',
}
file { "${tftp_root}/map-file":

View File

@ -24,16 +24,9 @@ class osnailyfacter::ceph_nova_compute (
content => template('osnailyfacter/ceph_secret.erb')
}
if ($::operatingsystem == 'Ubuntu') and ($::operatingsystemrelease =~ /^16/) {
# This override is required only for 16.04 Ubuntu because we are using UCA libvirt package.
$libvirt_service_name = 'libvirt-bin'
} else {
$libvirt_service_name = $::nova::params::libvirt_service_name
}
ensure_resource('service', 'libvirt', {
ensure => 'running',
name => $libvirt_service_name,
name => 'libvirt-bin',
})
exec {'Set Ceph RBD secret for Nova':
@ -41,8 +34,8 @@ class osnailyfacter::ceph_nova_compute (
command => "virsh secret-define --file ${secret_xml} && \
virsh secret-set-value --secret ${rbd_secret_uuid} \
--base64 $(ceph auth get-key client.${user})",
path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
unless => "virsh secret-list | fgrep -qw ${rbd_secret_uuid}",
path => '/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin',
unless => "virsh secret-list | fgrep -qw ${rbd_secret_uuid}",
}
Nova_config<||> ~>

View File

@ -109,15 +109,8 @@ class osnailyfacter::database::database {
$vendor_type = 'MOS'
$galera_package_name = 'galera-3'
# TODO(dmburmistrov): after dropping trusty support
# remove this if, only 'mysql-wsrep-*' should be preserved
if $::operatingsystemrelease =~ /^14/ {
$mysql_package_name = 'mysql-server-wsrep-5.6'
$client_package_name = 'mysql-client-5.6'
} else {
$mysql_package_name = 'mysql-wsrep-server-5.6'
$client_package_name = 'mysql-wsrep-client-5.6'
}
$mysql_package_name = 'mysql-wsrep-server-5.6'
$client_package_name = 'mysql-wsrep-client-5.6'
$vendor_override_options = {
'mysqld' => {

View File

@ -17,14 +17,7 @@ class osnailyfacter::generate_vms::generate_vms {
ensure => 'installed',
}
if ($::operatingsystem == 'Ubuntu') and ($::operatingsystemrelease =~ /^16/) {
# This override is required only for 16.04 Ubuntu because we are using UCA libvirt package.
$libvirt_service_name = 'libvirt-bin'
} else {
$libvirt_service_name = $::nova::params::libvirt_service_name
}
service { $libvirt_service_name:
service { 'libvirt-bin':
ensure => 'running',
require => Package[$packages],
before => Exec['generate_vms'],

View File

@ -65,13 +65,11 @@ class osnailyfacter::globals::globals {
# TODO (iberezovskiy): Remove this workaround when
# https://bugs.launchpad.net/ubuntu/+source/puppet/+bug/1570472 is resolved
if $::operatingsystemmajrelease == '16.04' {
file { "${facter_os_package_type_dir}/service_provider.txt":
ensure => 'present',
mode => '0640',
content => 'service_provider=systemd',
require => File[$facter_os_package_type_dir],
}
file { "${facter_os_package_type_dir}/service_provider.txt":
ensure => 'present',
mode => '0640',
content => 'service_provider=systemd',
require => File[$facter_os_package_type_dir],
}
}

View File

@ -21,33 +21,6 @@ class osnailyfacter::tools::tools {
class { '::osnailyfacter::ssh': }
#TODO(mmalchuk) the whole block should be removed together with
# the postfix package in the bootsrap after switch to the Xenial
unless (versioncmp($::operatingsystemmajrelease, '16') >= 0) {
ensure_packages(['postfix'])
service { 'postfix':
ensure => running,
enable => true,
require => Package['postfix'],
}
augeas { 'configure postfix':
context => '/files/etc/postfix/main.cf',
changes => [
"set /files/etc/postfix/main.cf/mydestination ${::fqdn},localhost",
"set /files/etc/postfix/main.cf/myhostname ${::fqdn}",
'set /files/etc/postfix/main.cf/inet_interfaces loopback-only',
'set /files/etc/postfix/main.cf/default_transport error',
'set /files/etc/postfix/main.cf/relay_transport error',
],
notify => Service['postfix'],
require => Package['postfix'],
}
}
if $::virtual != 'physical' {
class { '::osnailyfacter::acpid': }
}

View File

@ -5,7 +5,7 @@ describe 'osnailyfacter::apache' do
{
:osfamily => 'Debian',
:operatingsystem => 'Ubuntu',
:operatingsystemrelease => '14.04',
:operatingsystemrelease => '16.04',
:concat_basedir => '/var/lib/puppet/concat'
}
end

View File

@ -5,7 +5,7 @@ describe 'osnailyfacter::dnsmasq' do
{
:osfamily => 'Debian',
:operatingsystem => 'Ubuntu',
:operatingsystemrelease => '14.04',
:operatingsystemrelease => '16.04',
:concat_basedir => '/var/lib/puppet/concat',
:domain => 'example.com'
}

View File

@ -5,7 +5,7 @@ describe 'osnailyfacter::mysql_user_access' do
{
:osfamily => 'Debian',
:operatingsystem => 'Ubuntu',
:operatingsystemrelease => '14.04',
:operatingsystemrelease => '16.04',
:concat_basedir => '/var/lib/puppet/concat'
}
end

View File

@ -5,7 +5,7 @@ describe 'osnailyfacter::wait_for_nova_backends' do
{
:osfamily => 'Debian',
:operatingsystem => 'Ubuntu',
:operatingsystemrelease => '14.04',
:operatingsystemrelease => '16.04',
:concat_basedir => '/var/lib/puppet/concat'
}
end

View File

@ -6,7 +6,7 @@ describe 'osnailyfacter::mysql_grant' do
{
:osfamily => 'Debian',
:operatingsystem => 'Ubuntu',
:operatingsystemrelease => '14.04',
:operatingsystemrelease => '16.04',
:concat_basedir => '/var/lib/puppet/concat'
}
end

View File

@ -6,7 +6,7 @@ describe 'osnailyfacter::openstack::manage_cinder_types' do
{
:osfamily => 'Debian',
:operatingsystem => 'Ubuntu',
:operatingsystemrelease => '14.04',
:operatingsystemrelease => '16.04',
:concat_basedir => '/var/lib/puppet/concat'
}
end

View File

@ -8,19 +8,19 @@ describe 'generate_apt_sources' do
'section' => 'main universe multiverse',
'uri' => 'http://archive.ubuntu.com/ubuntu/',
'priority' => nil,
'suite' => 'trusty',
'suite' => 'xenial',
'type' => 'deb'},
{'name' => 'ubuntu-updates',
'section' => 'main universe multiverse',
'uri' => 'http://archive.ubuntu.com/ubuntu/',
'priority' => nil,
'suite' => 'trusty-updates',
'suite' => 'xenial-updates',
'type' => 'deb'},
{'name' => 'ubuntu-security',
'section' => 'main universe multiverse',
'uri' => 'http://archive.ubuntu.com/ubuntu/',
'priority' => nil,
'suite' => 'trusty-security',
'suite' => 'xenial-security',
'type' => 'deb'},
]
}
@ -30,19 +30,19 @@ describe 'generate_apt_sources' do
'ubuntu' =>
{
'repos' => 'main universe multiverse',
'release' => 'trusty',
'release' => 'xenial',
'location' => 'http://archive.ubuntu.com/ubuntu/'
},
'ubuntu-updates' =>
{
'repos' => 'main universe multiverse',
'release' => 'trusty-updates',
'release' => 'xenial-updates',
'location' => 'http://archive.ubuntu.com/ubuntu/'
},
'ubuntu-security' =>
{
'repos' => 'main universe multiverse',
'release' => 'trusty-security',
'release' => 'xenial-security',
'location' => 'http://archive.ubuntu.com/ubuntu/'
},
}

View File

@ -123,19 +123,11 @@ describe manifest do
end
let(:mysql_client_pkg) do
if facts[:operatingsystemrelease] =~ /^14/
'mysql-client-5.6'
else
'mysql-wsrep-client-5.6'
end
'mysql-wsrep-client-5.6'
end
let(:mysql_server_pkg) do
if facts[:operatingsystemrelease] =~ /^14/
'mysql-server-wsrep-5.6'
else
'mysql-wsrep-server-5.6'
end
'mysql-wsrep-server-5.6'
end
it 'should contain galera' do

View File

@ -45,12 +45,7 @@ describe manifest do
end
it "should start libvirt service service" do
if facts[:operatingsystem] == 'Ubuntu' and facts[:operatingsystemrelease] =~ /^16/
libvirt_service = 'libvirt-bin'
else
libvirt_service = 'libvirtd'
end
should contain_service(libvirt_service).with(
should contain_service('libvirt-bin').with(
'ensure' => 'running',
'before' => 'Exec[generate_vms]',
)

View File

@ -15,11 +15,7 @@ describe manifest do
if facts[:osfamily] == 'RedHat'
pkg_name = 'MySQL-client-wsrep'
elsif facts[:osfamily] == 'Debian'
if facts[:operatingsystemrelease] =~ /^14/
pkg_name = 'mysql-client-5.6'
else
pkg_name = 'mysql-wsrep-client-5.6'
end
pkg_name = 'mysql-wsrep-client-5.6'
end
should contain_class('mysql::client').with(
'package_name' => pkg_name,

View File

@ -15,11 +15,7 @@ describe manifest do
if facts[:osfamily] == 'RedHat'
pkg_name = 'MySQL-client-wsrep'
elsif facts[:osfamily] == 'Debian'
if facts[:operatingsystemrelease] =~ /^14/
pkg_name = 'mysql-client-5.6'
else
pkg_name = 'mysql-wsrep-client-5.6'
end
pkg_name = 'mysql-wsrep-client-5.6'
end
should contain_class('mysql::client').with(
'package_name' => pkg_name,

View File

@ -18,11 +18,7 @@ describe manifest do
if facts[:osfamily] == 'RedHat'
pkg_name = 'MySQL-client-wsrep'
elsif facts[:osfamily] == 'Debian'
if facts[:operatingsystemrelease] =~ /^14/
pkg_name = 'mysql-client-5.6'
else
pkg_name = 'mysql-wsrep-client-5.6'
end
pkg_name = 'mysql-wsrep-client-5.6'
end
should contain_class('mysql::client').with(
'package_name' => pkg_name,

View File

@ -15,11 +15,7 @@ describe manifest do
if facts[:osfamily] == 'RedHat'
pkg_name = 'MySQL-client-wsrep'
elsif facts[:osfamily] == 'Debian'
if facts[:operatingsystemrelease] =~ /^14/
pkg_name = 'mysql-client-5.6'
else
pkg_name = 'mysql-wsrep-client-5.6'
end
pkg_name = 'mysql-wsrep-client-5.6'
end
should contain_class('mysql::client').with(
'package_name' => pkg_name,

View File

@ -12,11 +12,7 @@ describe manifest do
if facts[:osfamily] == 'RedHat'
pkg_name = 'MySQL-client-wsrep'
elsif facts[:osfamily] == 'Debian'
if facts[:operatingsystemrelease] =~ /^14/
pkg_name = 'mysql-client-5.6'
else
pkg_name = 'mysql-wsrep-client-5.6'
end
pkg_name = 'mysql-wsrep-client-5.6'
end
should contain_class('mysql::client').with(
'package_name' => pkg_name,

View File

@ -15,11 +15,7 @@ describe manifest do
if facts[:osfamily] == 'RedHat'
pkg_name = 'MySQL-client-wsrep'
elsif facts[:osfamily] == 'Debian'
if facts[:operatingsystemrelease] =~ /^14/
pkg_name = 'mysql-client-5.6'
else
pkg_name = 'mysql-wsrep-client-5.6'
end
pkg_name = 'mysql-wsrep-client-5.6'
end
should contain_class('mysql::client').with(
'package_name' => pkg_name,

View File

@ -19,11 +19,7 @@ describe manifest do
if facts[:osfamily] == 'RedHat'
pkg_name = 'MySQL-client-wsrep'
elsif facts[:osfamily] == 'Debian'
if facts[:operatingsystemrelease] =~ /^14/
pkg_name = 'mysql-client-5.6'
else
pkg_name = 'mysql-wsrep-client-5.6'
end
pkg_name = 'mysql-wsrep-client-5.6'
end
should contain_class('mysql::client').with(
'package_name' => pkg_name,

View File

@ -11,17 +11,12 @@ describe manifest do
neutron_db_user = 'neutron'
neutron_db_password = Noop.hiera'neutron_db_password'
neutron_db_dbname = 'neutron'
it 'should install proper mysql-client' do
if facts[:osfamily] == 'RedHat'
pkg_name = 'MySQL-client-wsrep'
elsif facts[:osfamily] == 'Debian'
if facts[:operatingsystemrelease] =~ /^14/
pkg_name = 'mysql-client-5.6'
else
pkg_name = 'mysql-wsrep-client-5.6'
end
pkg_name = 'mysql-wsrep-client-5.6'
end
should contain_class('mysql::client').with(
'package_name' => pkg_name,

View File

@ -93,7 +93,7 @@ describe manifest do
it "should create #{tftp_root}/pxelinux.0" do
should contain_file("#{tftp_root}/pxelinux.0").with(
'ensure' => 'present',
'source' => '/usr/lib/syslinux/pxelinux.0'
'source' => '/usr/lib/PXELINUX/pxelinux.0'
).that_requires('Package[syslinux]')
end

View File

@ -12,11 +12,7 @@ describe manifest do
if facts[:osfamily] == 'RedHat'
pkg_name = 'MySQL-client-wsrep'
elsif facts[:osfamily] == 'Debian'
if facts[:operatingsystemrelease] =~ /^14/
pkg_name = 'mysql-client-5.6'
else
pkg_name = 'mysql-wsrep-client-5.6'
end
pkg_name = 'mysql-wsrep-client-5.6'
end
should contain_class('mysql::client').with(
'package_name' => pkg_name,

View File

@ -68,23 +68,6 @@ describe manifest do
)
end
it 'should configure postfix with correct settings unless ubuntu xenial' do
unless (Puppet::Util::Package.versioncmp(facts[:operatingsystemmajrelease], '16') >= 0)
should contain_package('postfix')
should contain_service('postfix')
should contain_augeas('configure postfix').with(
'context' => '/files/etc/postfix/main.cf',
'changes' => [
"set /files/etc/postfix/main.cf/mydestination #{facts[:fqdn]},localhost",
"set /files/etc/postfix/main.cf/myhostname #{facts[:fqdn]}",
"set /files/etc/postfix/main.cf/inet_interfaces loopback-only",
"set /files/etc/postfix/main.cf/default_transport error",
"set /files/etc/postfix/main.cf/relay_transport error",
],
).that_notifies('Service[postfix]')
end
end
it 'should declare osnailyfacter::acpid on virtual machines' do
facts[:virtual] = 'kvm'
should contain_class('osnailyfacter::acpid')