summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fuel/build/f_ntp/puppet/modules/opnfv/manifests/ntp.pp11
-rw-r--r--fuel/build/f_odl_docker/puppet/modules/opnfv/manifests/odl_docker.pp93
-rw-r--r--fuel/build/f_resolvconf/puppet/modules/opnfv/manifests/resolver.pp20
3 files changed, 78 insertions, 46 deletions
diff --git a/fuel/build/f_ntp/puppet/modules/opnfv/manifests/ntp.pp b/fuel/build/f_ntp/puppet/modules/opnfv/manifests/ntp.pp
index 8180e3d..c5dce1b 100644
--- a/fuel/build/f_ntp/puppet/modules/opnfv/manifests/ntp.pp
+++ b/fuel/build/f_ntp/puppet/modules/opnfv/manifests/ntp.pp
@@ -31,6 +31,15 @@ class opnfv::ntp(
$file='/etc/ntp.conf'
) {
+ case $::operatingsystem {
+ centos, redhat: {
+ $service_name = 'ntpd'
+ }
+ debian, ubuntu: {
+ $service_name = 'ntp'
+ }
+ }
+
if $::fuel_settings['role'] {
if ($::fuel_settings['opnfv'] and
$::fuel_settings['opnfv']['ntp']) {
@@ -63,9 +72,9 @@ class opnfv::ntp(
service { 'ntp':
ensure => running,
+ name => $service_name,
enable => true,
require => [ Package['ntp'], File[$file]]
}
}
}
-
diff --git a/fuel/build/f_odl_docker/puppet/modules/opnfv/manifests/odl_docker.pp b/fuel/build/f_odl_docker/puppet/modules/opnfv/manifests/odl_docker.pp
index 922ab41..b44ef26 100644
--- a/fuel/build/f_odl_docker/puppet/modules/opnfv/manifests/odl_docker.pp
+++ b/fuel/build/f_odl_docker/puppet/modules/opnfv/manifests/odl_docker.pp
@@ -1,44 +1,45 @@
class opnfv::odl_docker
{
- case $::fuel_settings['role'] {
- /controller/: {
-
- file { "/opt":
- ensure => "directory",
- }
-
- file { "/opt/opnfv":
- ensure => "directory",
- owner => "root",
- group => "root",
- mode => 777,
- }
-
- file { "/opt/opnfv/odl":
- ensure => "directory",
- }
-
- file { "/opt/opnfv/odl/odl_docker_image.tar":
- ensure => present,
- source => "/etc/puppet/modules/opnfv/odl_docker/odl_docker_image.tar",
- mode => 750,
- }
-
- file { "/opt/opnfv/odl/docker-latest":
- ensure => present,
- source => "/etc/puppet/modules/opnfv/odl_docker/docker-latest",
- mode => 750,
- }
-
- file { "/opt/opnfv/odl/start_odl_conatiner.sh":
- ensure => present,
- source => "/etc/puppet/modules/opnfv/scripts/start_odl_container.sh",
- mode => 750,
- }
-
- # fix failed to find the cgroup root issue
- # https://github.com/docker/docker/issues/8791
- if $::operatingsystem == 'Ubuntu' {
+ case $::fuel_settings['role'] {
+ /controller/: {
+
+ file { '/opt':
+ ensure => 'directory',
+ }
+
+ file { '/opt/opnfv':
+ ensure => 'directory',
+ owner => 'root',
+ group => 'root',
+ mode => 777,
+ }
+
+ file { '/opt/opnfv/odl':
+ ensure => 'directory',
+ }
+
+ file { '/opt/opnfv/odl/odl_docker_image.tar':
+ ensure => present,
+ source => '/etc/puppet/modules/opnfv/odl_docker/odl_docker_image.tar',
+ mode => 750,
+ }
+
+ file { '/opt/opnfv/odl/docker-latest':
+ ensure => present,
+ source => '/etc/puppet/modules/opnfv/odl_docker/docker-latest',
+ mode => 750,
+ }
+
+ file { '/opt/opnfv/odl/start_odl_conatiner.sh':
+ ensure => present,
+ source => '/etc/puppet/modules/opnfv/scripts/start_odl_container.sh',
+ mode => 750,
+ }
+
+ # fix failed to find the cgroup root issue
+ # https://github.com/docker/docker/issues/8791
+ case $::operatingsystem {
+ 'ubuntu': {
package {'cgroup-lite':
ensure => present,
}
@@ -49,6 +50,18 @@ class opnfv::odl_docker
require => Package['cgroup-lite'],
}
}
+ 'centos': {
+ package {'docker-io':
+ ensure => latest,
+ }
+
+ service {'docker':
+ ensure => running,
+ enable => true,
+ require => Package['docker-io'],
+ }
+ }
+ }
+ }
}
- }
}
diff --git a/fuel/build/f_resolvconf/puppet/modules/opnfv/manifests/resolver.pp b/fuel/build/f_resolvconf/puppet/modules/opnfv/manifests/resolver.pp
index be4e67d..44f36a2 100644
--- a/fuel/build/f_resolvconf/puppet/modules/opnfv/manifests/resolver.pp
+++ b/fuel/build/f_resolvconf/puppet/modules/opnfv/manifests/resolver.pp
@@ -48,16 +48,26 @@ class opnfv::resolver()
mode => '0644',
content => template('opnfv/resolv.conf.erb'),
}
-# /etc/resolv.conf is re-generated at each boot by resolvconf, so we
-# need to store there as well.
- file { '/etc/resolvconf/resolv.conf.d/head':
+
+ # /etc/resolv.conf is re-generated at each boot by resolvconf, so we
+ # need to store there as well.
+
+ case $::operatingsystem {
+ 'ubuntu': {
+ file { '/etc/resolvconf/resolv.conf.d/head':
owner => root,
group => root,
mode => '0644',
content => template('opnfv/resolv.conf.erb'),
+ }
+ }
+ 'centos': {
+ exec { 'for file in ifcfg-eth*; do grep -q -F "PEERDNS=" $file || echo "PEERDNS=no" >> $file; done ':
+ provider => 'shell',
+ cwd => '/etc/sysconfig/network-scripts',
+ }
+ }
}
}
}
}
-
-