Skip to content
Open
18 changes: 9 additions & 9 deletions manifests/compute_node.pp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
# Apache License Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0.html
#
class one::compute_node(
class one::compute_node (
$puppetdb = $one::puppetdb,
$oneid = $one::oneid,
$im_mad = $one::im_mad,
Expand All @@ -40,17 +40,17 @@
include one::compute_node::service
include one::compute_node::install

Class['one::prerequisites'] ->
Class['one::install'] ->
Class['one::config'] ->
Class['one::compute_node::install'] ->
Class['one::compute_node::config'] ~>
Class['one::compute_node::service'] ~>
Class['one::service']
Class['one::prerequisites']
-> Class['one::install']
-> Class['one::config']
-> Class['one::compute_node::install']
~> Class['one::compute_node::config']
~> Class['one::compute_node::service']
~> Class['one::service']

if ($puppetdb == true) {
# Register the node as a onehost in the puppetdb
@@onehost { $::fqdn :
@@onehost { $facts['networking']['fqdn'] :
tag => $oneid,
im_mad => $im_mad,
vm_mad => $vm_mad,
Expand Down
2 changes: 1 addition & 1 deletion manifests/compute_node/add_kickstart.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# defines the kickstart.ks file
#
define one::compute_node::add_kickstart(
define one::compute_node::add_kickstart (
$kickstart_tmpl = 'one/kickstart.ks.erb',
$networkconfig = $one::compute_node::config::networkconfig,
$partitions = $one::compute_node::config::partitions,
Expand Down
2 changes: 1 addition & 1 deletion manifests/compute_node/add_preseed.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#
# configure Debian preseed file
#
define one::compute_node::add_preseed(
define one::compute_node::add_preseed (
$preseed_tmpl = 'one/preseed.cfg.erb',
$debian_mirror_url = $one::compute_node::config::debian_mirror_url,
$data = undef
Expand Down
43 changes: 21 additions & 22 deletions manifests/compute_node/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,11 @@
$manage_sudoer_config = $one::manage_sudoer_config,
$oneadmin_sudoers_file = $one::oneadmin_sudoers_file,
$imaginator_sudoers_file = $one::imaginator_sudoers_file
){

) {
validate_string ($debian_mirror_url)
validate_hash ($preseed_data)

$_polkit_file_path = $::osfamily ? {
$_polkit_file_path = $facts['os']['family'] ? {
'RedHat' => '/etc/polkit-1/localauthority/50-local.d/50-org.libvirt.unix.manage-opennebula.pkla',
'Debian' => '/var/lib/polkit-1/localauthority/50-local.d/50-org.libvirt.unix.manage-opennebula.pkla',
}
Expand All @@ -51,70 +50,70 @@
owner => 'root',
group => 'root',
notify => Service[$libvirtd_srv],
} ->
}

file { $libvirtd_cfg:
-> file { $libvirtd_cfg:
ensure => file,
source => $libvirtd_source,
owner => 'root',
group => 'root',
notify => Service[$libvirtd_srv],
} ->
}

file { '/etc/udev/rules.d/80-kvm.rules':
-> file { '/etc/udev/rules.d/80-kvm.rules':
ensure => file,
owner => 'root',
group => 'root',
source => 'puppet:///modules/one/udev-kvm-rules',
} ->
}

file { 'polkit-opennebula':
-> file { 'polkit-opennebula':
ensure => file,
path => $_polkit_file_path,
owner => 'root',
group => 'root',
source => 'puppet:///modules/one/50-org.libvirt.unix.manage-opennebula.pkla',
} ->
}

file { '/etc/libvirt/qemu.conf':
-> file { '/etc/libvirt/qemu.conf':
ensure => file,
owner => 'root',
group => 'root',
source => 'puppet:///modules/one/qemu.conf',
} ->
}

file { '/var/lib/one/.virtinst':
-> file { '/var/lib/one/.virtinst':
ensure => directory,
owner => 'oneadmin',
group => 'oneadmin',
mode => '0755',
} ->
}

file { '/var/lib/one/.libvirt':
-> file { '/var/lib/one/.libvirt':
ensure => directory,
owner => 'oneadmin',
group => 'oneadmin',
mode => '0755',
} ->
}

file { '/var/lib/libvirt/boot':
-> file { '/var/lib/libvirt/boot':
ensure => directory,
owner => 'oneadmin',
group => 'oneadmin',
mode => '0771',
} ->
}

file { ['/var/lib/one/etc/kickstart.d', '/var/lib/one/etc/preseed.d']:
-> file { ['/var/lib/one/etc/kickstart.d', '/var/lib/one/etc/preseed.d']:
ensure => directory,
owner => 'oneadmin',
group => 'oneadmin',
purge => true,
recurse => true,
force => true,
mode => '0755',
} ->
}

file { '/var/lib/one/bin/imaginator':
-> file { '/var/lib/one/bin/imaginator':
ensure => file,
owner => 'root',
group => 'oneadmin',
Expand All @@ -140,7 +139,7 @@
}
}

if ($::osfamily == 'Debian') or ($::osfamily == 'RedHat' and versioncmp($::operatingsystemmajrelease, '7') < 0) {
if ($facts['os']['family'] == 'Debian') or ($facts['os']['family'] == 'RedHat' and versioncmp($facts['os']['release']['major'], '7') < 0) {
file { '/sbin/brctl':
ensure => link,
target => '/usr/sbin/brctl',
Expand Down
2 changes: 1 addition & 1 deletion manifests/compute_node/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# Apache License Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0.html
#
class one::compute_node::install(
class one::compute_node::install (
$node_packages = $one::node_packages
) {
package { $node_packages:
Expand Down
4 changes: 2 additions & 2 deletions manifests/compute_node/service.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
# Apache License Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0.html
#
class one::compute_node::service(
class one::compute_node::service (
$libvirtd_srv = $one::libvirtd_srv
) {
service { $libvirtd_srv:
ensure => running,
hasstatus => true,
enable => true,
}
case $::osfamily {
case $facts['os']['family'] {
'RedHat': {
service { 'ksmtuned':
ensure => stopped,
Expand Down
31 changes: 15 additions & 16 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
class one::config (
$ssh_pub_key = $one::ssh_pub_key,
$ssh_priv_key = $one::ssh_priv_key_param,
){

) {
validate_string($ssh_pub_key)
validate_string($ssh_priv_key)

Expand All @@ -16,44 +15,44 @@
file { '/var/lib/one':
ensure => directory,
mode => '0750',
} ->
}

file { '/var/lib/one/.ssh':
-> file { '/var/lib/one/.ssh':
ensure => directory,
mode => '0700',
recurse => true,
} ->
}

file { '/var/lib/one/.ssh/id_dsa':
-> file { '/var/lib/one/.ssh/id_dsa':
ensure => file,
content => $ssh_priv_key,
mode => '0600',
} ->
}

file { '/var/lib/one/.ssh/id_dsa.pub':
-> file { '/var/lib/one/.ssh/id_dsa.pub':
ensure => file,
content => $ssh_pub_key,
mode => '0644',
} ->
}

file { '/var/lib/one/.ssh/authorized_keys':
-> file { '/var/lib/one/.ssh/authorized_keys':
ensure => file,
mode => '0644',
content => $ssh_pub_key,
} ->
}

file { '/var/lib/one/.ssh/config':
-> file { '/var/lib/one/.ssh/config':
ensure => file,
mode => '0644',
source => 'puppet:///modules/one/ssh_one_config',
} ->
}

file { '/var/lib/one/bin':
-> file { '/var/lib/one/bin':
ensure => directory,
mode => '0755',
} ->
}

file { '/var/lib/one/etc':
-> file { '/var/lib/one/etc':
ensure => directory,
mode => '0755',
}
Expand Down
9 changes: 4 additions & 5 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,6 @@
$default_cdrom_device_prefix = $one::params::default_cdrom_device_prefix,
$one_version = $one::params::one_version,
) inherits one::params {

# Data Validation

validate_absolute_path($oneadmin_sudoers_file)
Expand Down Expand Up @@ -551,10 +550,10 @@
include one::config
include one::service

Class['one::prerequisites']->
Class['one::install']->
Class['one::config']->
Class['one::service']
Class['one::prerequisites']
-> Class['one::install']
-> Class['one::config']
-> Class['one::service']

if ($oned) {
if ( member(['kvm','xen','vmware','ec2', 'ganglia','dummy'], $im_mad) ) {
Expand Down
6 changes: 3 additions & 3 deletions manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
class one::install (
$http_proxy = $one::http_proxy,
$dbus_pkg = $one::dbus_pkg,
){
) {
File['/etc/gemrc'] -> Package <| provider == 'gem' |>

file { '/etc/gemrc':
ensure => file,
content => "---\nhttp_proxy: ${http_proxy}\n",
} ->
}

package { $dbus_pkg:
-> package { $dbus_pkg:
ensure => latest,
}
}
14 changes: 7 additions & 7 deletions manifests/oned.pp
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@
include one::oned::config
include one::oned::service

Class['one::prerequisites'] ->
Class['one::install'] ->
Class['one::config'] ->
Class['one::oned::install'] ->
Class['one::oned::config'] ~>
Class['one::oned::service'] ~>
Class['one::service']
Class['one::prerequisites']
-> Class['one::install']
-> Class['one::config']
-> Class['one::oned::install']
-> Class['one::oned::config']
~> Class['one::oned::service']
~> Class['one::service']

# lint:ignore:strict_indent
if ( $backend != 'mysql' and $backend != 'sqlite') {
Expand Down
11 changes: 5 additions & 6 deletions manifests/oned/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Apache License Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0.html
#
class one::oned::config(
class one::oned::config (
$hook_scripts_path = $one::hook_scripts_path,
$hook_scripts = $one::hook_scripts,
$vm_hook_scripts = $one::vm_hook_scripts,
Expand Down Expand Up @@ -59,7 +59,6 @@
$default_device_prefix = $one::default_device_prefix,
$default_cdrom_device_prefix = $one::default_cdrom_device_prefix,
) {

if ! member(['YES', 'NO'], $oned_vm_submit_on_hold) {
fail("oned_vm_submit_on_hold must be one of 'YES' or 'NO'. Actual value: ${oned_vm_submit_on_hold}")
}
Expand Down Expand Up @@ -115,14 +114,14 @@
owner => 'root',
mode => '0640',
content => template('one/sched.conf.erb'),
} ->
}

file { '/usr/share/one':
-> file { '/usr/share/one':
ensure => directory,
mode => '0755',
} ->
}

file { '/usr/share/one/hooks':
-> file { '/usr/share/one/hooks':
ensure => directory,
ignore => 'tests/*',
mode => '0750',
Expand Down
10 changes: 5 additions & 5 deletions manifests/oned/oneflow.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
# Apache License Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0.html
#
class one::oned::oneflow {
class one::oned::oneflow {
include one::prerequisites
include one::oned::oneflow::install
include one::oned::oneflow::config
include one::oned::oneflow::service
Class['one::prerequisites'] ->
Class['one::oned::oneflow::install'] ->
Class['one::oned::oneflow::config'] ~>
Class['one::oned::oneflow::service']
Class['one::prerequisites']
-> Class['one::oned::oneflow::install']
-> Class['one::oned::oneflow::config']
~> Class['one::oned::oneflow::service']
}
2 changes: 1 addition & 1 deletion manifests/oned/oneflow/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# Apache License Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0.html
#
class one::oned::oneflow::install(
class one::oned::oneflow::install (
$oned_oneflow_packages = $one::oned_oneflow_packages,
) {
package { $oned_oneflow_packages:
Expand Down
Loading