Add support for OracleLinux (RedHat family)

Update l23network module to support OracleLinux.
Deployment cases are the same as for centos and redhat.

Additional changes:
  * remove installation of cpufreq-init package.
    It doesn't exist anymore for CentOS.
  * update README with list of supported OS

Blueprint: oracle-linux-compute-nodes

Change-Id: Icba00728422326361208cd5a40a753e0310409d3
This commit is contained in:
iberezovskiy 2016-02-24 16:26:49 +03:00
parent b3a60ac924
commit ed021365bb
14 changed files with 76 additions and 18 deletions

View File

@ -586,6 +586,15 @@ version, and the specific network provider (native linux, ovs, etc...)
## Supported operating systems
* CentOS 6 and 7
* RedHat 7
* OracleLinux 7
* Ubuntu
## References
* [Transformations. How they work.](https://docs.google.com/document/d/12RvBjOYO83_yqeiAgxttrRaa90-8un80aEO8OzDlQ9Y)

View File

@ -20,6 +20,11 @@ Facter.add(:l23_os) do
when /7/
'redhat7'
end
when /(?i)oraclelinux/
case Facter.value(:operatingsystemmajrelease)
when /7/
'oraclelinux7'
end
when /(?i)darwin/
'osx'
end

View File

@ -0,0 +1,16 @@
require 'puppetx/filemapper'
require File.join(File.dirname(__FILE__), '..','..','..','puppet/provider/l23_stored_config_centos')
Puppet::Type.type(:l23_stored_config).provide(:lnx_oraclelinux7, :parent => Puppet::Provider::L23_stored_config_centos) do
include PuppetX::FileMapper
confine :l23_os => :oraclelinux7
defaultfor :l23_os => :oraclelinux7
has_feature :provider_options
self.unlink_empty_files = true
end
# vim: set ts=2 sw=2 et :

View File

@ -0,0 +1,16 @@
require 'puppetx/filemapper'
require File.join(File.dirname(__FILE__), '..','..','..','puppet/provider/l23_stored_config_ovs_centos')
Puppet::Type.type(:l23_stored_config).provide(:ovs_oraclelinux7, :parent => Puppet::Provider::L23_stored_config_ovs_centos) do
include PuppetX::FileMapper
confine :l23_os => :oraclelinux7
has_feature :provider_options
self.unlink_empty_files = true
end
# vim: set ts=2 sw=2 et :

View File

@ -0,0 +1,16 @@
require 'puppetx/filemapper'
require File.join(File.dirname(__FILE__), '..','..','..','puppet/provider/l23_stored_config_sriov_centos')
Puppet::Type.type(:l23_stored_config).provide(:sriov_oraclelinux7, :parent => Puppet::Provider::L23_stored_config_sriov_centos) do
include PuppetX::FileMapper
confine :l23_os => :oraclelinux7
has_feature :provider_options
self.unlink_empty_files = true
end
# vim: set ts=2 sw=2 et :

View File

@ -111,7 +111,7 @@ class l23network (
Anchor['l23network::l2::init'] -> File<| title == $::l23network::params::interfaces_file |>
# Centos interface up-n-down scripts
if $::l23_os =~ /(?i:redhat|centos)/ {
if $::l23_os =~ /(?i:redhat|centos|oraclelinux)/ {
class{'::l23network::l2::centos_upndown_scripts': } -> Anchor['l23network::init']
Anchor <| title == 'l23network::l2::centos_upndown_scripts' |> -> Anchor['l23network::init']
}
@ -133,7 +133,7 @@ class l23network (
# It is not enough to just remove package, we have to stop the service as well.
# Because SystemD continues running the service after package removing,
# with Upstart - all is ok.
if $::l23_os =~ /(?i)redhat7|centos7/ {
if $::l23_os =~ /(?i)redhat7|centos7|oraclelinux7/ {
service{$::l23network::params::network_manager_name:
ensure => 'stopped',
}

View File

@ -264,7 +264,7 @@ define l23network::l2::bond (
}
if $::l23_os =~ /(?i:redhat|centos)/ {
if $::l23_os =~ /(?i:redhat|centos|oraclelinux)/ {
if $delay_while_up {
file {"${::l23network::params::interfaces_dir}/interface-up-script-${bond}":
ensure => present,

View File

@ -69,7 +69,7 @@ define l23network::l2::bridge (
Anchor['l23network::init'] -> K_mod<||> -> L2_bridge<||>
}
if $::l23_os =~ /(?i:redhat|centos)/ {
if $::l23_os =~ /(?i:redhat|centos|oraclelinux)/ {
if $delay_while_up {
file {"${::l23network::params::interfaces_dir}/interface-up-script-${name}":
ensure => present,

View File

@ -169,7 +169,7 @@ define l23network::l2::port (
Anchor['l23network::init'] -> K_mod<||> -> L2_port<||>
}
if $::l23_os =~ /(?i:redhat|centos)/ {
if $::l23_os =~ /(?i:redhat|centos|oraclelinux)/ {
if $delay_while_up {
file {"${::l23network::params::interfaces_dir}/interface-up-script-${port_name}":
ensure => present,

View File

@ -18,7 +18,7 @@ define l23network::l3::defaultroute (
unless => "netstat -r | grep -q 'default.*${gateway}'",
}
}
/(?i:redhat|centos)/: {
/(?i:redhat|centos|oraclelinux)/: {
Cfg <| name == $gateway |>
if ! defined(Cfg[$gateway]) {
cfg { $gateway:

View File

@ -30,7 +30,7 @@ class l23network::params {
$ovs_socket_mem = 256
$ovs_memory_channels = 2
}
/(?i)redhat|centos/: {
/(?i)redhat|centos|oraclelinux/: {
$interfaces_dir = '/etc/sysconfig/network-scripts'
$interfaces_file = undef
$ovs_service_name = 'openvswitch'
@ -47,7 +47,10 @@ class l23network::params {
$dpdk_interfaces_file = undef
$ovs_socket_dir_group = undef
$ovs_socket_dir = undef
$ovs_datapath_package_name = 'kmod-openvswitch'
$ovs_datapath_package_name = $::l23_os ? {
/(?i)oraclelinux/ => 'kmod-openvswitch-uek',
default => 'kmod-openvswitch',
}
$ovs_common_package_name = 'openvswitch'
$ovs_kern_module_name = 'openvswitch'
$network_manager_name = 'NetworkManager'
@ -55,7 +58,6 @@ class l23network::params {
$ovs_core_mask = 0x1
$ovs_socket_mem = 256
$ovs_memory_channels = 2
}
/(?i)darwin/: {
$interfaces_dir = '/tmp/1'

View File

@ -3,7 +3,7 @@ class openstack::checksum_udp ($port = '514') {
Exec {path => '/usr/bin:/bin:/usr/sbin:/sbin'}
case $operatingsystem {
/(?i)(centos|redhat)/ : {
/(?i)(centos|redhat|oraclelinux)/ : {
exec { "checksum_fill_udp":
command => "iptables -t mangle -A POSTROUTING -p udp --dport ${port} -j CHECKSUM --checksum-fill; /etc/init.d/iptables save",
unless => "iptables -t mangle -S POSTROUTING | grep -q \"^-A POSTROUTING -p udp -m udp --dport ${port} -j CHECKSUM --checksum-fill\""

View File

@ -415,12 +415,6 @@ class openstack::compute (
}
}
if $::operatingsystem == 'Centos' {
package { 'cpufreq-init':
ensure => present;
}
}
package { $libvirt_type_kvm:
ensure => present,
before => Package[$::nova::params::compute_package_name],

View File

@ -13,8 +13,8 @@ if ( $::l23_os =~ /(?i:centos6)/ and $::kernelmajversion == '3.10' ) {
class { 'l23network' :
use_ovs => hiera('use_ovs', false),
use_ovs_dkms_datapath_module => $::l23_os ? {
/(?i:redhat7|centos7)/ => false,
default => true
/(?i:redhat7|centos7|oraclelinux7)/ => false,
default => true
},
ovs_datapath_package_name => $ovs_datapath_package_name,
}