Puppet4 propper support in the cobbler module

* Adapt to Puppet 4
* Code cleanup

This module contains some code which should be removed because
not used after switching to IBP, but this needs deeper investigation.
This commit intended only to fix errors and warnings during
syntax checks.

Change-Id: I43fe9d2ccc0f30f8c9883161bc1454f6f23e3316
Closes-Bug: #1533354
This commit is contained in:
Maksim Malchuk 2016-01-14 23:05:13 +03:00
parent af93a3a3eb
commit bda7aac0c2
23 changed files with 364 additions and 881 deletions

View File

@ -6,13 +6,13 @@ group :development, :test do
gem 'metadata-json-lint', :require => 'false'
# TODO(aschultz): fix linting and enable these
#gem 'puppet-lint-param-docs', :require => 'false'
#gem 'puppet-lint-absolute_classname-check', :require => 'false'
#gem 'puppet-lint-absolute_template_path', :require => 'false'
#gem 'puppet-lint-trailing_newline-check', :require => 'false'
#gem 'puppet-lint-unquoted_string-check', :require => 'false'
#gem 'puppet-lint-leading_zero-check', :require => 'false'
#gem 'puppet-lint-variable_contains_upcase', :require => 'false'
#gem 'puppet-lint-numericvariable', :require => 'false'
gem 'puppet-lint-absolute_classname-check', :require => 'false'
gem 'puppet-lint-absolute_template_path', :require => 'false'
gem 'puppet-lint-trailing_newline-check', :require => 'false'
gem 'puppet-lint-unquoted_string-check', :require => 'false'
gem 'puppet-lint-leading_zero-check', :require => 'false'
gem 'puppet-lint-variable_contains_upcase', :require => 'false'
gem 'puppet-lint-numericvariable', :require => 'false'
gem 'json', :require => 'false'
end

View File

@ -17,8 +17,6 @@ PuppetLint::RakeTask.new :lint do |config|
"class_inherits_from_params_class",
"class_parameter_defaults",
"only_variable_string",
"autoloader_layout", # TODO(aschultz): this is from included defines in classes, should be fixed and this should be removed.
"only_variable_string",
"2sp_soft_tabs",
"hard_tabs",
"tailing_whitespace",
@ -27,6 +25,6 @@ PuppetLint::RakeTask.new :lint do |config|
"arrow_alignment",
"documentation",
"leading_zero",
"case_without_default",
]
end

View File

@ -1,5 +1,5 @@
fuel-01:
profile: "centos63-x86_64"
profile: "centos63_x86_64"
netboot-enabled: "1"
ksmeta: "puppet_auto_setup=1 \
puppet_master=fuel-pm.mirantis.com \
@ -37,7 +37,7 @@ mco_enable=1"
userctl: "yes"
peerdns: "no"
fuel-02:
profile: "centos63-x86_64"
profile: "centos63_x86_64"
netboot-enabled: "1"
ksmeta: "puppet_auto_setup=1 \
puppet_master=fuel-pm.mirantis.com \
@ -75,7 +75,7 @@ mco_enable=1"
userctl: "yes"
peerdns: "no"
fuel-03:
profile: "centos63-x86_64"
profile: "centos63_x86_64"
netboot-enabled: "1"
ksmeta: "puppet_auto_setup=1 \
puppet_master=fuel-pm.mirantis.com \
@ -113,7 +113,7 @@ mco_enable=1"
userctl: "yes"
peerdns: "no"
fuel-04:
profile: "centos63-x86_64"
profile: "centos63_x86_64"
netboot-enabled: "1"
ksmeta: "puppet_auto_setup=1 \
puppet_master=fuel-pm.mirantis.com \

View File

@ -15,19 +15,19 @@ stage {'openstack-custom-repo': before => Stage['main']}
case $::osfamily {
'Debian': {
class { 'apt':
class { '::apt':
stage => 'openstack-ci-repo'
}->
class { 'openstack::repo::apt':
key => '420851BC',
location => 'http://172.18.66.213/deb',
class { '::openstack::repo::apt':
key => '420851BC',
location => 'http://172.18.66.213/deb',
key_source => 'http://172.18.66.213/gpg.pub',
origin => '172.18.66.213',
stage => 'openstack-ci-repo'
origin => '172.18.66.213',
stage => 'openstack-ci-repo'
}
}
'RedHat': {
class { 'openstack::repo::yum':
class { '::openstack::repo::yum':
repo_name => 'openstack-epel-fuel',
location => 'http://download.mirantis.com/epel-fuel',
key_source => 'https://fedoraproject.org/static/0608B895.txt',
@ -40,45 +40,45 @@ case $::osfamily {
}
node fuel-cobbler {
class { cobbler::server:
server => $server,
class { '::cobbler::server':
server => $server,
domain_name => $domain_name,
name_server => $name_server,
next_server => $next_server,
domain_name => $domain_name,
name_server => $name_server,
next_server => $next_server,
dhcp_start_address => $dhcp_start_address,
dhcp_end_address => $dhcp_end_address,
dhcp_netmask => $dhcp_netmask,
dhcp_gateway => $dhcp_gateway,
dhcp_interface => $dhcp_interface,
dhcp_start_address => $dhcp_start_address,
dhcp_end_address => $dhcp_end_address,
dhcp_netmask => $dhcp_netmask,
dhcp_gateway => $dhcp_gateway,
dhcp_interface => $dhcp_interface,
cobbler_user => $cobbler_user,
cobbler_password => $cobbler_password ,
cobbler_user => $cobbler_user,
cobbler_password => $cobbler_password,
pxetimeout => $pxetimeout,
pxetimeout => $pxetimeout,
}
Class[cobbler::server] ->
Class[cobbler::distro::centos63-x86_64]
Class[cobbler::distro::centos63_x86_64]
# class { cobbler::distro::centos63-x86_64:
# class { cobbler::distro::centos63_x86_64:
# http_iso => "http://10.100.0.1/iso/CentOS-6.3-x86_64-netinstall.iso",
# ks_url => "http://172.18.8.52/~hex/centos/6.3/os/x86_64",
# }
class { cobbler::distro::centos63-x86_64:
http_iso => "http://172.18.67.168/CentOS-6.3-x86_64-minimal.iso",
ks_url => "cobbler",
class { '::cobbler::distro::centos63_x86_64':
http_iso => 'http://172.18.67.168/CentOS-6.3-x86_64-minimal.iso',
ks_url => 'cobbler',
}
Class[cobbler::distro::centos63-x86_64] ->
Class[cobbler::profile::centos63-x86_64]
Class[cobbler::distro::centos63_x86_64] ->
Class[cobbler::profile::centos63_x86_64]
class { cobbler::profile::centos63-x86_64: }
class { '::cobbler::profile::centos63_x86_64': }
# IT IS NEEDED IN ORDER TO USE cobbler_system.py SCRIPT
# WHICH USES argparse PYTHON MODULE
package {"python-argparse": }
package {'python-argparse': }
}

View File

@ -5,64 +5,62 @@ node default {
node /^(fuel-pm|fuel-cobbler).mirantis.com/ {
Exec {path => '/usr/bin:/bin:/usr/sbin:/sbin'}
exec { "enable_forwarding":
command => "echo 1 > /proc/sys/net/ipv4/ip_forward",
unless => "cat /proc/sys/net/ipv4/ip_forward | grep -q 1",
exec { 'enable_forwarding':
command => 'echo 1 > /proc/sys/net/ipv4/ip_forward',
unless => 'fgrep -qx 1 /proc/sys/net/ipv4/ip_forward',
}
exec { "enable_nat_all":
command => "iptables -t nat -I POSTROUTING 1 -s 10.0.0.0/24 ! -d 10.0.0.0/24 -j MASQUERADE; \
/etc/init.d/iptables save",
unless => "iptables -t nat -S POSTROUTING | grep -q \"^-A POSTROUTING -s 10.0.0.0/24 ! -d 10.0.0.0/24 -j MASQUERADE\""
exec { 'enable_nat_all':
command => 'iptables -t nat -I POSTROUTING 1 -s 10.0.0.0/24 ! -d 10.0.0.0/24 -j MASQUERADE; /etc/init.d/iptables save',
unless => 'iptables -t nat -S POSTROUTING | grep -q "^-A POSTROUTING -s 10.0.0.0/24 ! -d 10.0.0.0/24 -j MASQUERADE"'
}
exec { "enable_nat_filter":
command => "iptables -t filter -I FORWARD 1 -j ACCEPT; \
/etc/init.d/iptables save",
unless => "iptables -t filter -S FORWARD | grep -q \"^-A FORWARD -j ACCEPT\""
exec { 'enable_nat_filter':
command => 'iptables -t filter -I FORWARD 1 -j ACCEPT; /etc/init.d/iptables save',
unless => 'iptables -t filter -S FORWARD | grep -q "^-A FORWARD -j ACCEPT"'
}
class { cobbler::server:
server => '10.0.0.100',
domain_name => 'mirantis.com',
name_server => '10.0.0.100',
next_server => '10.0.0.100',
class { '::cobbler::server':
server => '10.0.0.100',
dhcp_start_address => '10.0.0.201',
dhcp_end_address => '10.0.0.254',
dhcp_netmask => '255.255.255.0',
dhcp_gateway => '10.0.0.100',
dhcp_interface => 'eth1',
cobbler_user => 'cobbler',
cobbler_password => 'cobbler',
domain_name => 'mirantis.com',
name_server => '10.0.0.100',
next_server => '10.0.0.100',
pxetimeout => '0'
dhcp_start_address => '10.0.0.201',
dhcp_end_address => '10.0.0.254',
dhcp_netmask => '255.255.255.0',
dhcp_gateway => '10.0.0.100',
dhcp_interface => 'eth1',
cobbler_user => 'cobbler',
cobbler_password => 'cobbler',
pxetimeout => '0'
}
Class[cobbler::server] ->
Class[cobbler::distro::centos63-x86_64]
Class[cobbler::distro::centos63_x86_64]
# class { cobbler::distro::centos63-x86_64:
# class { cobbler::distro::centos63_x86_64:
# http_iso => "http://10.100.0.1/iso/CentOS-6.3-x86_64-netinstall.iso",
# ks_url => "http://172.18.8.52/~hex/centos/6.3/os/x86_64",
# }
class { cobbler::distro::centos63-x86_64:
http_iso => "http://10.0.0.1/iso/CentOS-6.3-x86_64-minimal.iso",
ks_url => "cobbler",
class { '::cobbler::distro::centos63_x86_64':
http_iso => 'http://10.0.0.1/iso/CentOS-6.3-x86_64-minimal.iso',
ks_url => 'cobbler',
}
Class[cobbler::distro::centos63-x86_64] ->
Class[cobbler::profile::centos63-x86_64]
class { cobbler::profile::centos63-x86_64: }
Class[cobbler::distro::centos63_x86_64] ->
Class[cobbler::profile::centos63_x86_64]
class { '::cobbler::profile::centos63_x86_64': }
# IT IS NEEDED IN ORDER TO USE cobbler_system.py SCRIPT
# WHICH USES argparse PYTHON MODULE
package {"python-argparse": }
package {'python-argparse': }
}

View File

@ -1,104 +0,0 @@
# Copyright 2013 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
#
#
# This class is intended to make cobbler distro centos63-x86_64. It will
# download and mount centos ISO image.
#
# [http_iso] This is the url from where to download centos 6.3 ISO image.
# This ISO image is needed to mount it and use its vmlinuz and initrd.img files.
# If it also contains RPM packages including ruby, wget and so on, then you
# can install system completely from this ISO image.
# [ks_url] This is the url of RPM repository from where to install system.
# This will be used as the url parameter in kickstart file. You can also
# use here the key word 'cobbler' in order to use mounted ISO image as main
# repository.
class cobbler::distro::centos63-x86_64(
$http_iso = "http://mirror.stanford.edu/yum/pub/centos/6.3/isos/x86_64/CentOS-6.3-x86_64-minimal.iso",
$ks_url = "http://mirror.stanford.edu/yum/pub/centos/6.3/os/x86_64"
) {
Exec {path => '/usr/bin:/bin:/usr/sbin:/sbin'}
$ks_mirror = '/var/www/cobbler/ks_mirror'
# CentOS-6.3-x86_64-minimal
$iso_name = extension_basename($http_iso, "true")
# CentOS-6.3-x86_64-minimal.iso
$iso_basename = extension_basename($http_iso)
# /var/www/cobbler/ks_mirror/CentOS-6.3-x86_64-minimal.iso
$iso = "${ks_mirror}/${iso_basename}"
# /var/www/cobbler/ks_mirror/CentOS-6.3-x86_64-minimal
$iso_mnt = "${ks_mirror}/${iso_name}"
# /var/www/cobbler/links/CentOS-6.3-x86_64-minimal
$iso_link = "/var/www/cobbler/links/$iso_name"
if $ks_url == "cobbler" {
$tree = "http://@@server@@/cblr/links/${iso_name}"
}
else {
$tree = $ks_url
}
file { $iso_mnt:
ensure => directory,
owner => root,
group => root,
mode => 0555,
}
if $http_iso =~ /^http:\/\/.+/ {
# HERE IS ASSUMED THAT wget PACKAGE INSTALLED AS WE NEED IT
# TO DOWNLOAD CENTOS ISO IMAGE
exec { "get ${http_iso}":
command => "wget -q -O- ${http_iso} > ${iso}",
onlyif => "test ! -s ${iso}",
}
}
elsif $http_iso =~ /^file:\/\/.+/ {
$http_iso_path = split($http_iso, 'file://')
exec { "get ${http_iso}":
command => "cp ${http_iso_path[1]} ${iso}",
onlyif => "test ! -s ${iso}",
}
}
mount { $iso_mnt:
device => $iso,
options => "loop",
fstype => "iso9660",
ensure => mounted,
require => [Exec["get ${http_iso}"], File[$iso_mnt]],
}
file { $iso_link:
ensure => link,
target => $iso_mnt,
}
cobbler_distro { "centos63-x86_64":
kernel => "${iso_mnt}/isolinux/vmlinuz",
initrd => "${iso_mnt}/isolinux/initrd.img",
arch => "x86_64",
breed => "redhat",
osversion => "rhel6",
ksmeta => "tree=${tree}",
require => Mount[$iso_mnt],
}
}

View File

@ -45,7 +45,7 @@ class cobbler::distro::centos63_x86_64(
}
# CentOS-6.3-x86_64-minimal
$iso_name = extension_basename($http_iso, 'true')
$iso_name = extension_basename($http_iso, true)
# CentOS-6.3-x86_64-minimal.iso
$iso_basename = extension_basename($http_iso)
# /var/www/cobbler/ks_mirror/CentOS-6.3-x86_64-minimal.iso

View File

@ -45,7 +45,7 @@ class cobbler::distro::centos64_x86_64(
}
# CentOS-6.4-x86_64-minimal
$iso_name = extension_basename($http_iso, 'true')
$iso_name = extension_basename($http_iso, true)
# CentOS-6.4-x86_64-minimal.iso
$iso_basename = extension_basename($http_iso)
# /var/www/cobbler/ks_mirror/CentOS-6.4-x86_64-minimal.iso

View File

@ -30,7 +30,7 @@ class cobbler::distro::ubuntu_1204_x86_64(
}
# mini
$iso_name = extension_basename($http_iso, 'true')
$iso_name = extension_basename($http_iso, true)
# mini.iso
$iso_basename = extension_basename($http_iso)
# /var/www/cobbler/ks_mirror/ubuntu-12.04-x86_64-mini.iso
@ -41,12 +41,12 @@ class cobbler::distro::ubuntu_1204_x86_64(
$iso_link = "/var/www/cobbler/links/${iso_name}"
if $ks_url == 'cobbler' {
$tree_host = "@@server@@"
$tree_url = "/cblr/links/${iso_name}"
$tree_host = '@@server@@'
$tree_url = "/cblr/links/${iso_name}"
}
else {
$tree_host = inline_template("<%= @ks_url.split('http://')[1].split('/')[0] %>")
$tree_url = inline_template("/<%= @ks_url.split('http://')[1].split('/')[1 .. -1].join('/') %>")
$tree_url = inline_template("/<%= @ks_url.split('http://')[1].split('/')[1 .. -1].join('/') %>")
}
file { $iso_mnt:
@ -83,7 +83,7 @@ class cobbler::distro::ubuntu_1204_x86_64(
target => $iso_mnt,
}
cobbler_distro { "ubuntu_1204_x86_64":
cobbler_distro { 'ubuntu_1204_x86_64':
kernel => "${iso_mnt}/linux",
initrd => "${iso_mnt}/initrd.gz",
arch => 'x86_64',
@ -93,5 +93,4 @@ class cobbler::distro::ubuntu_1204_x86_64(
require => Mount[$iso_mnt],
}
}
}

View File

@ -30,7 +30,7 @@ class cobbler::distro::ubuntu_1404_x86_64(
}
# mini
$iso_name = extension_basename($http_iso, 'true')
$iso_name = extension_basename($http_iso, true)
# mini.iso
$iso_basename = extension_basename($http_iso)
# /var/www/cobbler/ks_mirror/ubuntu-14.04-x86_64-mini.iso
@ -41,12 +41,12 @@ class cobbler::distro::ubuntu_1404_x86_64(
$iso_link = "/var/www/cobbler/links/${iso_name}"
if $ks_url == 'cobbler' {
$tree_host = "@@server@@"
$tree_url = "/cblr/links/${iso_name}"
$tree_host = '@@server@@'
$tree_url = "/cblr/links/${iso_name}"
}
else {
$tree_host = inline_template("<%= @ks_url.split('http://')[1].split('/')[0] %>")
$tree_url = inline_template("/<%= @ks_url.split('http://')[1].split('/')[1 .. -1].join('/') %>")
$tree_url = inline_template("/<%= @ks_url.split('http://')[1].split('/')[1 .. -1].join('/') %>")
}
file { $iso_mnt:
@ -83,7 +83,7 @@ class cobbler::distro::ubuntu_1404_x86_64(
target => $iso_mnt,
}
cobbler_distro { "ubuntu_1404_x86_64":
cobbler_distro { 'ubuntu_1404_x86_64':
kernel => "${iso_mnt}/linux",
initrd => "${iso_mnt}/initrd.gz",
arch => 'x86_64',

View File

@ -63,23 +63,23 @@ class cobbler(
){
anchor { "cobbler-begin": }
anchor { "cobbler-end": }
anchor { 'cobbler-begin': }
anchor { 'cobbler-end': }
Anchor<| title == "cobbler-begin" |> ->
Class["::cobbler::packages"] ->
Class["::cobbler::selinux"] ->
Class["::cobbler::snippets"] ->
Class["::cobbler::server"] ->
Anchor<| title == "cobbler-end" |>
Anchor<| title == 'cobbler-begin' |> ->
Class['::cobbler::packages'] ->
Class['::cobbler::selinux'] ->
Class['::cobbler::snippets'] ->
Class['::cobbler::server'] ->
Anchor<| title == 'cobbler-end' |>
class { ::cobbler::packages : }
class { ::cobbler::selinux : }
class { '::cobbler::packages': }
class { '::cobbler::selinux': }
if $production !~ /docker/ {
include ::cobbler::iptables
}
class { ::cobbler::snippets : }
class { ::cobbler::server :
class { '::cobbler::snippets': }
class { '::cobbler::server':
domain_name => $domain_name,
production => $production,
dns_upstream => $dns_upstream,
@ -88,10 +88,10 @@ class cobbler(
dhcp_gateway => $dhcp_gateway,
}
cobbler_digest_user {$cobbler_user:
cobbler_digest_user { $cobbler_user:
password => $cobbler_password,
require => Package[$cobbler::packages::cobbler_package],
notify => Service[$cobbler::server::cobbler_service],
require => Package[$::cobbler::packages::cobbler_package],
notify => Service[$::cobbler::server::cobbler_service],
}
}

View File

@ -14,22 +14,24 @@
class cobbler::iptables (
$chain = "INPUT",
$chain = 'INPUT',
) {
case $operatingsystem {
case $::operatingsystem {
/(?i)(debian|ubuntu)/:{
file { "/etc/network/if-post-down.d/iptablessave":
content => template("cobbler/ubuntu/iptablessave.erb"),
owner => root,
group => root,
mode => 0755,
file { '/etc/network/if-post-down.d/iptablessave':
content => template('cobbler/ubuntu/iptablessave.erb'),
owner => 'root',
group => 'root',
mode => '0755',
}
file { "/etc/network/if-pre-up.d/iptablesload":
content => template("cobbler/ubuntu/iptablesload.erb"),
owner => root,
group => root,
mode => 0755,
file { '/etc/network/if-pre-up.d/iptablesload':
content => template('cobbler/ubuntu/iptablesload.erb'),
owner => 'root',
group => 'root',
mode => '0755',
}
}
}

View File

@ -15,42 +15,36 @@
class cobbler::packages {
case $operatingsystem {
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"
$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"]
$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_additional_packages = ['xinetd', 'tftp-server', 'syslinux', 'wget', 'python-ipaddr','fence-agents-all', 'bind-utils']
}
}
}
/(?i)(debian|ubuntu)/: {
$cobbler_package = "cobbler"
$cobbler_web_package = "cobbler-web"
$dnsmasq_package = "dnsmasq"
$cobbler_additional_packages = ["tftpd-hpa", "syslinux", "wget","python-ipaddr", "fence-agents", "dnsutils", "bind9-host"]
$django_package = "python-django"
$django_version = "1.3.1-4ubuntu1"
$openssh_package = "openssh-client"
$pexpect_package = "python-pexpect"
$cobbler_package = 'cobbler'
$cobbler_web_package = 'cobbler-web'
$dnsmasq_package = 'dnsmasq'
$cobbler_additional_packages = ['tftpd-hpa', 'syslinux', 'wget','python-ipaddr', 'fence-agents', 'dnsutils', 'bind9-host']
$django_package = 'python-django'
$django_version = '1.3.1-4ubuntu1'
$openssh_package = 'openssh-client'
$pexpect_package = 'python-pexpect'
}
}
define cobbler_safe_package(){
if ! defined(Package[$name]){
@package { $name : }
}
}
cobbler_safe_package { $cobbler_additional_packages : }
ensure_packages($cobbler_additional_packages)
package { $django_package :
ensure => present

View File

@ -1,71 +0,0 @@
# Copyright 2013 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
#
#
# This class is intended to make cobbler profile centos63-x86_64.
#
# [distro] The name of cobbler distro to bind profile to.
#
# [ks_repo] Repository definitions (array of hashes with name and url keys)
# where RPM packages are available which are not available in the main
# kickstart url.
#
# [ks_system_timezone] System timezone on installed system.
#
# [ks_encrypted_root_password] Hash of the root password on installed system.
class cobbler::profile::centos63-x86_64(
$distro = "centos63-x86_64",
$ks_repo = [
{
"name" => "Puppet",
"url" => "http://yum.puppetlabs.com/el/6/products/x86_64",
},
{
"name" => "Stanford",
"url" => "http://mirror.stanford.edu/yum/pub/centos/6.3/os/x86_64",
}],
$ks_system_timezone = "America/Los_Angeles",
# default password is 'r00tme'
$ks_encrypted_root_password = "\$6\$tCD3X7ji\$1urw6qEMDkVxOkD33b4TpQAjRiCeDZx0jmgMhDYhfB9KuGfqO9OcMaKyUxnGGWslEDQ4HxTw7vcAMP85NxQe61",
) {
Exec {path => '/usr/bin:/bin:/usr/sbin:/sbin'}
case $operatingsystem {
/(?i)(ubuntu|debian|centos|redhat)$/: {
$ks_dir = "/var/lib/cobbler/kickstarts"
}
}
file { "${ks_dir}/centos63-x86_64.ks":
content => template("cobbler/kickstart/centos.ks.erb"),
owner => root,
group => root,
mode => 0644,
} ->
cobbler_profile { "centos63-x86_64":
kickstart => "${ks_dir}/centos63-x86_64.ks",
kopts => $kopts,
distro => $distro,
ksmeta => "",
menu => true,
}
}

View File

@ -25,61 +25,57 @@
# [ks_system_timezone] System timezone on installed system.
#
# [ks_encrypted_root_password] Hash of the root password on installed system.
# default password is 'r00tme'
#
class cobbler::profile::centos63_x86_64(
$distro = "centos63_x86_64",
$ks_repo = [
# {
# "name" => "Puppet",
# "url" => "http://yum.puppetlabs.com/el/6/products/x86_64",
# },
# {
# "name" => "PuppetDeps",
# "url" => "http://yum.puppetlabs.com/el/6/dependencies/x86_64",
# },
# {
# "name" => "Centos-archive-base",
# "url" => "http://archive.kernel.org/centos/6.3/os/x86_64",
# },
{
"name" => "Fuel-CentOS-minimal",
"url" => "http://download.mirantis.com/centos-minimal",
},
{
"name" => "epel-fuel-install",
"url" => "http://download.mirantis.com/epel-fuel-folsom-2.1",
}
],
$ks_system_timezone = "America/Los_Angeles",
# default password is 'r00tme'
$ks_encrypted_root_password = "\$6\$tCD3X7ji\$1urw6qEMDkVxOkD33b4TpQAjRiCeDZx0jmgMhDYhfB9KuGfqO9OcMaKyUxnGGWslEDQ4HxTw7vcAMP85NxQe61",
$kopts = "",
) {
Exec {path => '/usr/bin:/bin:/usr/sbin:/sbin'}
case $operatingsystem {
/(?i)(ubuntu|debian|centos|redhat)$/: {
$ks_dir = "/var/lib/cobbler/kickstarts"
$distro = 'centos63_x86_64',
$ks_repo = [
# {
# 'name' => 'Puppet',
# 'url' => 'http://yum.puppetlabs.com/el/6/products/x86_64',
# },
# {
# 'name' => 'PuppetDeps',
# 'url' => 'http://yum.puppetlabs.com/el/6/dependencies/x86_64',
# },
# {
# 'name' => 'Centos-archive-base',
# 'url' => 'http://archive.kernel.org/centos/6.3/os/x86_64',
# },
{
'name' => 'Fuel-CentOS-minimal',
'url' => 'http://download.mirantis.com/centos-minimal',
},
{
'name' => 'epel-fuel-install',
'url' => 'http://download.mirantis.com/epel-fuel-folsom-2.1',
}
}
],
$ks_system_timezone = 'America/Los_Angeles',
$ks_encrypted_root_password = '\$6\$tCD3X7ji\$1urw6qEMDkVxOkD33b4TpQAjRiCeDZx0jmgMhDYhfB9KuGfqO9OcMaKyUxnGGWslEDQ4HxTw7vcAMP85NxQe61',
$kopts = '',
) {
Exec { path => '/usr/bin:/bin:/usr/sbin:/sbin' }
$ks_dir = '/var/lib/cobbler/kickstarts'
file { "${ks_dir}/centos63_x86_64.ks":
content => template("cobbler/kickstart/centos.ks.erb"),
owner => root,
group => root,
mode => 0644,
content => template('cobbler/kickstart/centos.ks.erb'),
owner => 'root',
group => 'root',
mode => '0644',
} ->
cobbler_profile { "centos63_x86_64":
cobbler_profile { 'centos63_x86_64':
kickstart => "${ks_dir}/centos63_x86_64.ks",
kopts => $kopts,
distro => $distro,
ksmeta => "",
menu => true,
kopts => $kopts,
distro => $distro,
ksmeta => '',
menu => true,
}
}

View File

@ -25,61 +25,57 @@
# [ks_system_timezone] System timezone on installed system.
#
# [ks_encrypted_root_password] Hash of the root password on installed system.
# default password is 'r00tme'
#
class cobbler::profile::centos64_x86_64(
$distro = "centos64_x86_64",
$ks_repo = [
# {
# "name" => "Puppet",
# "url" => "http://yum.puppetlabs.com/el/6/products/x86_64",
# },
# {
# "name" => "PuppetDeps",
# "url" => "http://yum.puppetlabs.com/el/6/dependencies/x86_64",
# },
# {
# "name" => "Centos-archive-base",
# "url" => "http://archive.kernel.org/centos/6.4/os/x86_64",
# },
{
"name" => "Fuel-CentOS",
"url" => "http://download.mirantis.com/centos-6.4",
},
{
"name" => "epel-fuel-install",
"url" => "http://download.mirantis.com/epel-fuel-grizzly-3.1",
}
],
$ks_system_timezone = "America/Los_Angeles",
# default password is 'r00tme'
$ks_encrypted_root_password = "\$6\$tCD3X7ji\$1urw6qEMDkVxOkD33b4TpQAjRiCeDZx0jmgMhDYhfB9KuGfqO9OcMaKyUxnGGWslEDQ4HxTw7vcAMP85NxQe61",
$kopts = "biosdevname=0 dhcptimeout=120",
) {
Exec {path => '/usr/bin:/bin:/usr/sbin:/sbin'}
case $operatingsystem {
/(?i)(ubuntu|debian|centos|redhat)$/: {
$ks_dir = "/var/lib/cobbler/kickstarts"
$distro = 'centos64_x86_64',
$ks_repo = [
# {
# 'name' => 'Puppet',
# 'url' => 'http://yum.puppetlabs.com/el/6/products/x86_64',
# },
# {
# 'name' => 'PuppetDeps',
# 'url' => 'http://yum.puppetlabs.com/el/6/dependencies/x86_64',
# },
# {
# 'name' => 'Centos-archive-base',
# 'url' => 'http://archive.kernel.org/centos/6.4/os/x86_64',
# },
{
'name' => 'Fuel-CentOS',
'url' => 'http://download.mirantis.com/centos-6.4',
},
{
'name' => 'epel-fuel-install',
'url' => 'http://download.mirantis.com/epel-fuel-grizzly-3.1',
}
}
],
$ks_system_timezone = 'America/Los_Angeles',
$ks_encrypted_root_password = '\$6\$tCD3X7ji\$1urw6qEMDkVxOkD33b4TpQAjRiCeDZx0jmgMhDYhfB9KuGfqO9OcMaKyUxnGGWslEDQ4HxTw7vcAMP85NxQe61',
$kopts = 'biosdevname=0 dhcptimeout=120',
) {
Exec { path => '/usr/bin:/bin:/usr/sbin:/sbin' }
$ks_dir = '/var/lib/cobbler/kickstarts'
file { "${ks_dir}/centos64_x86_64.ks":
content => template("cobbler/kickstart/centos.ks.erb"),
owner => root,
group => root,
mode => 0644,
content => template('cobbler/kickstart/centos.ks.erb'),
owner => 'root',
group => 'root',
mode => '0644',
} ->
cobbler_profile { "centos64_x86_64":
cobbler_profile { 'centos64_x86_64':
kickstart => "${ks_dir}/centos64_x86_64.ks",
kopts => $kopts,
distro => $distro,
ksmeta => "",
menu => true,
kopts => $kopts,
distro => $distro,
ksmeta => '',
menu => true,
}
}

View File

@ -21,46 +21,42 @@
# [ks_system_timezone] System timezone on installed system.
#
# [ks_encrypted_root_password] Hash of the root password on installed system.
# default password is 'r00tme'
#
class cobbler::profile::ubuntu_1204_x86_64(
$distro = "ubuntu_1204_x86_64",
$ks_repo = [
$distro = 'ubuntu_1204_x86_64',
$ks_repo = [
{
"name" => "Fuel",
"url" => "http://download.mirantis.com/precise-grizzly-fuel-3.2/",
"key" => "http://download.mirantis.com/precise-grizzly-fuel-3.2/Fuel.key",
"release" => "precise",
"repos" => "main",
'name' => 'Fuel',
'url' => 'http://download.mirantis.com/precise-grizzly-fuel-3.2/',
'key' => 'http://download.mirantis.com/precise-grizzly-fuel-3.2/Fuel.key',
'release' => 'precise',
'repos' => 'main',
},
],
$ks_system_timezone = 'America/Los_Angeles',
$ks_encrypted_root_password = '\$6\$tCD3X7ji\$1urw6qEMDkVxOkD33b4TpQAjRiCeDZx0jmgMhDYhfB9KuGfqO9OcMaKyUxnGGWslEDQ4HxTw7vcAMP85NxQe61',
$kopts = 'auto=true priority=critical locale=en_US net.ifnames=0 biosdevname=0 netcfg/choose_interface=auto netcfg/dhcp_timeout=120 netcfg/link_detection_timeout=20',
$ks_system_timezone = "America/Los_Angeles",
){
# default password is 'r00tme'
$ks_encrypted_root_password = "\$6\$tCD3X7ji\$1urw6qEMDkVxOkD33b4TpQAjRiCeDZx0jmgMhDYhfB9KuGfqO9OcMaKyUxnGGWslEDQ4HxTw7vcAMP85NxQe61",
$kopts = "auto=true priority=critical locale=en_US net.ifnames=0 biosdevname=0 netcfg/choose_interface=auto netcfg/dhcp_timeout=120 netcfg/link_detection_timeout=20",
){
case $operatingsystem {
/(?i)(ubuntu|debian|centos|redhat)$/: {
$ks_dir = "/var/lib/cobbler/kickstarts"
}
}
$ks_dir = '/var/lib/cobbler/kickstarts'
file { "${ks_dir}/ubuntu_1204_x86_64.preseed":
content => template("cobbler/preseed/ubuntu-1204.preseed.erb"),
owner => root,
group => root,
mode => 0644,
content => template('cobbler/preseed/ubuntu-1204.preseed.erb'),
owner => 'root',
group => 'root',
mode => '0644',
} ->
cobbler_profile { "ubuntu_1204_x86_64":
cobbler_profile { 'ubuntu_1204_x86_64':
kickstart => "${ks_dir}/ubuntu_1204_x86_64.preseed",
kopts => $kopts,
distro => $distro,
ksmeta => "",
menu => true,
kopts => $kopts,
distro => $distro,
ksmeta => '',
menu => true,
}
}
}

View File

@ -21,46 +21,42 @@
# [ks_system_timezone] System timezone on installed system.
#
# [ks_encrypted_root_password] Hash of the root password on installed system.
# default password is 'r00tme'
#
class cobbler::profile::ubuntu_1404_x86_64(
$distro = "ubuntu_1404_x86_64",
$ks_repo = [
$distro = 'ubuntu_1404_x86_64',
$ks_repo = [
{
"name" => "Fuel",
"url" => "http://download.mirantis.com/precise-grizzly-fuel-3.2/",
"key" => "http://download.mirantis.com/precise-grizzly-fuel-3.2/Fuel.key",
"release" => "trusty",
"repos" => "main",
'name' => 'Fuel',
'url' => 'http://download.mirantis.com/precise-grizzly-fuel-3.2/',
'key' => 'http://download.mirantis.com/precise-grizzly-fuel-3.2/Fuel.key',
'release' => 'trusty',
'repos' => 'main',
},
],
$ks_system_timezone = 'America/Los_Angeles',
$ks_encrypted_root_password = '\$6\$tCD3X7ji\$1urw6qEMDkVxOkD33b4TpQAjRiCeDZx0jmgMhDYhfB9KuGfqO9OcMaKyUxnGGWslEDQ4HxTw7vcAMP85NxQe61',
$kopts = 'auto=true priority=critical locale=en_US net.ifnames=0 biosdevname=0 netcfg/choose_interface=auto netcfg/dhcp_timeout=120 netcfg/link_detection_timeout=20',
$ks_system_timezone = "America/Los_Angeles",
){
# default password is 'r00tme'
$ks_encrypted_root_password = "\$6\$tCD3X7ji\$1urw6qEMDkVxOkD33b4TpQAjRiCeDZx0jmgMhDYhfB9KuGfqO9OcMaKyUxnGGWslEDQ4HxTw7vcAMP85NxQe61",
$kopts = "auto=true priority=critical locale=en_US net.ifnames=0 biosdevname=0 netcfg/choose_interface=auto netcfg/dhcp_timeout=120 netcfg/link_detection_timeout=20",
){
case $operatingsystem {
/(?i)(ubuntu|debian|centos|redhat)$/: {
$ks_dir = "/var/lib/cobbler/kickstarts"
}
}
$ks_dir = '/var/lib/cobbler/kickstarts'
file { "${ks_dir}/ubuntu_1404_x86_64.preseed":
content => template("cobbler/preseed/ubuntu-1404.preseed.erb"),
owner => root,
group => root,
mode => 0644,
content => template('cobbler/preseed/ubuntu-1404.preseed.erb'),
owner => 'root',
group => 'root',
mode => '0644',
} ->
cobbler_profile { "ubuntu_1404_x86_64":
cobbler_profile { 'ubuntu_1404_x86_64':
kickstart => "${ks_dir}/ubuntu_1404_x86_64.preseed",
kopts => $kopts,
distro => $distro,
ksmeta => "",
menu => true,
kopts => $kopts,
distro => $distro,
ksmeta => '',
menu => true,
}
}
}

View File

@ -14,19 +14,19 @@
class cobbler::selinux {
if ($::selinux != 'false') {
if !$::selinux {
Exec {path => '/usr/bin:/bin:/usr/sbin:/sbin'}
exec { "cobbler_disable_selinux":
command => "setenforce 0",
onlyif => "getenforce | grep -q Enforcing",
}
exec { "cobbler_disable_selinux_permanent":
command => "sed -ie \"s/^SELINUX=enforcing/SELINUX=disabled/g\" /etc/selinux/config",
onlyif => "grep -q \"^SELINUX=enforcing\" /etc/selinux/config"
}
Exec { path => '/usr/bin:/bin:/usr/sbin:/sbin' }
exec { 'cobbler_disable_selinux':
command => 'setenforce 0',
onlyif => 'getenforce | grep -q Enforcing',
}
exec { 'cobbler_disable_selinux_permanent':
command => 'sed -ie "s/^SELINUX=enforcing/SELINUX=disabled/g" /etc/selinux/config',
onlyif => 'grep -q "^SELINUX=enforcing" /etc/selinux/config'
}
}
}

View File

@ -34,7 +34,7 @@ class cobbler::server (
$dhcp_lease_max = '1800',
$lease_time = '120m',
) {
include cobbler::packages
include ::cobbler::packages
Exec {
path => '/usr/bin:/bin:/usr/sbin:/sbin'

View File

@ -1,316 +0,0 @@
# Copyright 2013 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
#
#
#
# This class is intended to serve as
# a way of deploying cobbler server.
#
# [server] IP address that will be used as address of cobbler server.
# It is needed to download kickstart files, call cobbler API and
# so on. Required.
#
# [domain_name] Domain name that will be used as default for
# installed nodes. Required.
# [name_server] DNS ip address to be used by installed nodes
# [next_server] IP address that will be used as PXE tftp server. Required.
#
# [dhcp_start_address] First address of dhcp range
# [dhcp_end_address] Last address of dhcp range
# [dhcp_netmask] Netmask of the network
# [dhcp_gateway] Gateway address for installed nodes
# [dhcp_interface] Interface where to bind dhcp and tftp services
#
# [cobbler_user] Cobbler web interface username
# [cobbler_password] Cobbler web interface password
#
# [pxetimeout] Pxelinux will wail this count of 1/10 seconds before
# use default pxe item. To disable it use 0. Required.
class cobbler::server(
$server = $ipaddress,
$domain_name = 'example.com',
$name_server = $ipaddress,
$next_server = $ipaddress,
$dhcp_start_address = '10.0.0.201',
$dhcp_end_address = '10.0.0.254',
$dhcp_netmask = '255.255.255.0',
$dhcp_gateway = $ipaddress,
$dhcp_interface = 'eth0',
$cobbler_user = 'cobbler',
$cobbler_password = 'cobbler',
$pxetimeout = '0'
) {
Exec {path => '/usr/bin:/bin:/usr/sbin:/sbin'}
case $operatingsystem {
/(?i)(centos|redhat)/: {
$cobbler_package = "cobbler"
$cobbler_web_package = "cobbler-web"
$dnsmasq_package = "dnsmasq"
$cobbler_service = "cobblerd"
$cobbler_web_service = "httpd"
$cobbler_additional_packages = ["xinetd", "tftp-server", "syslinux", "wget"]
}
/(?i)(debian|ubuntu)/: {
$cobbler_package = "cobbler"
$cobbler_web_package = "cobbler-web"
$dnsmasq_package = "dnsmasq"
$cobbler_service = "cobbler"
$cobbler_web_service = "apache2"
$cobbler_additional_packages = []
}
}
define cobbler_safe_package(){
if ! defined(Package[$name]){
@package { $name : }
}
}
cobbler_safe_package { $cobbler_additional_packages : }
Package<||>
package { $cobbler_package :
ensure => installed,
require => [
Package[$dnsmasq_package],
Package[$cobbler_additional_packages],
],
}
package { $cobbler_web_package :
ensure => installed
}
package { $dnsmasq_package:
ensure => installed
}
file { "/etc/init.d/dnsmasq":
content => template("cobbler/dnsmasq.init.erb"),
owner => root,
group => root,
mode => 0755,
require => Package[$dnsmasq_package],
notify => Service["dnsmasq"],
}
define access_to_cobbler_port($port, $protocol='tcp') {
$rule = "-p $protocol -m state --state NEW -m $protocol --dport $port -j ACCEPT"
exec { "access_to_cobbler_${protocol}_port: $port":
command => "iptables -t filter -I INPUT 1 $rule; \
/etc/init.d/iptables save",
unless => "iptables -t filter -S INPUT | grep -q \"^-A INPUT $rule\""
}
}
# OPERATING SYSTEM SPECIFIC ACTIONS
case $operatingsystem {
/(?i)(centos|redhat)/:{
# HERE IS AN UGLY WORKAROUND TO MAKE COBBLER ABLE TO START
# THERE IS AN ALTERNATIVE WAY TO ACHIEVE MAKE COBBLER STARTED
# yum install policycoreutils-python
# grep cobblerd /var/log/audit/audit.log | audit2allow -M cobblerpolicy
# semodule -i cobblerpolicy.pp
exec { "cobbler_disable_selinux":
command => "setenforce 0",
onlyif => "getenforce | grep -q Enforcing"
}
exec { "cobbler_disable_selinux_permanent":
command => "sed -ie \"s/^SELINUX=enforcing/SELINUX=disabled/g\" /etc/selinux/config",
onlyif => "grep -q \"^SELINUX=enforcing\" /etc/selinux/config"
}
# HERE IS IPTABLES RULES TO MAKE COBBLER AVAILABLE FROM OUTSIDE
# https://github.com/cobbler/cobbler/wiki/Using%20Cobbler%20Import
# SSH
access_to_cobbler_port { "ssh": port => '22' }
# DNS
access_to_cobbler_port { "dns_tcp": port => '53' }
access_to_cobbler_port { "dns_udp": port => '53', protocol => 'udp' }
# DHCP
access_to_cobbler_port { "dncp_67": port => '67', protocol => 'udp' }
access_to_cobbler_port { "dncp_68": port => '68', protocol => 'udp' }
# TFTP
access_to_cobbler_port { "tftp_tcp": port => '69' }
access_to_cobbler_port { "tftp_udp": port => '69', protocol => 'udp' }
# NTP
access_to_cobbler_port { "ntp_udp": port => '123', protocol => 'udp' }
# HTTP/HTTPS
access_to_cobbler_port { "http": port => '80' }
access_to_cobbler_port { "https": port => '443'}
# SYSLOG FOR COBBLER
access_to_cobbler_port { "syslog_tcp": port => '25150'}
# xmlrpc API
access_to_cobbler_port { "xmlrpc_api": port => '25151' }
service { "xinetd":
enable => true,
ensure => running,
hasrestart => true,
require => Package[$cobbler_additional_packages],
}
file { "/etc/xinetd.conf":
content => template("cobbler/xinetd.conf.erb"),
owner => root,
group => root,
mode => 0600,
require => Package[$cobbler_additional_packages],
notify => Service["xinetd"],
}
}
}
Service[$cobbler_service] -> Exec["cobbler_sync"] -> Service["dnsmasq"]
service { $cobbler_service:
enable => true,
ensure => running,
hasrestart => true,
require => Package[$cobbler_package],
}
service { "dnsmasq":
enable => true,
ensure => running,
hasrestart => true,
require => Package[$dnsmasq_package],
subscribe => Exec["cobbler_sync"],
}
service { $cobbler_web_service:
enable => true,
ensure => running,
hasrestart => true,
require => Package[$cobbler_web_package],
}
exec {"cobbler_sync":
command => "cobbler sync",
refreshonly => true,
returns => [0, 155],
require => [
Package[$cobbler_package],
Package[$dnsmasq_package],
],
notify => Service["dnsmasq"],
subscribe => Service[$cobbler_service],
}
file { "/etc/cobbler/modules.conf":
content => template("cobbler/modules.conf.erb"),
owner => root,
group => root,
mode => 0644,
require => [
Package[$cobbler_package],
],
notify => [
Service[$cobbler_service],
Exec["cobbler_sync"],
],
}
file {"/etc/cobbler/settings":
content => template("cobbler/settings.erb"),
owner => root,
group => root,
mode => 0644,
require => Package[$cobbler_package],
notify => [
Service[$cobbler_service],
Exec["cobbler_sync"],
],
}
file {"/etc/cobbler/dnsmasq.template":
content => template("cobbler/dnsmasq.template.erb"),
owner => root,
group => root,
mode => 0644,
require => [
Package[$cobbler_package],
Package[$dnsmasq_package],
],
notify => [
Service[$cobbler_service],
Exec["cobbler_sync"],
Service["dnsmasq"],
],
}
cobbler_digest_user {"cobbler":
password => $cobbler_password,
require => Package[$cobbler_package],
notify => Service[$cobbler_service],
}
file {"/etc/cobbler/pxe/pxedefault.template":
content => template("cobbler/pxedefault.template.erb"),
owner => root,
group => root,
mode => 0644,
require => Package[$cobbler_package],
notify => [
Service[$cobbler_service],
Exec["cobbler_sync"],
],
}
file {"/etc/cobbler/pxe/pxelocal.template":
content => template("cobbler/pxelocal.template.erb"),
owner => root,
group => root,
mode => 0644,
require => Package[$cobbler_package],
notify => [
Service[$cobbler_service],
Exec["cobbler_sync"],
],
}
exec { "/var/lib/tftpboot/chain.c32":
command => "cp /usr/share/syslinux/chain.c32 /var/lib/tftpboot/chain.c32",
unless => "test -e /var/lib/tftpboot/chain.c32",
require => [
Package[$cobbler_additional_packages],
Package[$cobbler_package],
]
}
define cobbler_snippet(){
file {"/var/lib/cobbler/snippets/${name}":
content => template("cobbler/snippets/${name}.erb"),
owner => root,
group => root,
mode => 0644,
require => Package[$cobbler::server::cobbler_package],
}
}
}

View File

@ -0,0 +1,10 @@
define cobbler::snippet(){
file { "/var/lib/cobbler/snippets/${name}":
content => template("cobbler/snippets/${name}.erb"),
owner => 'root',
group => 'root',
mode => '0644',
require => Package[$::cobbler::packages::cobbler_package],
notify => Exec['cobbler_sync']
}
}

View File

@ -12,84 +12,73 @@
# License for the specific language governing permissions and limitations
# under the License.
class cobbler::snippets {
define cobbler_snippet(){
file {"/var/lib/cobbler/snippets/${name}":
content => template("cobbler/snippets/${name}.erb"),
owner => root,
group => root,
mode => 0644,
require => Package[$cobbler::packages::cobbler_package],
notify => Exec["cobbler_sync"]
}
}
cobbler_snippet {"send2syslog": }
cobbler_snippet {"target_logs_to_master": }
cobbler_snippet {"target_logs_to_master_ubuntu": }
cobbler_snippet {"kickstart_ntp": }
cobbler_snippet {"ntp_to_masternode": }
cobbler_snippet {"ntp_to_masternode_ubuntu": }
cobbler_snippet {"pre_install_network_config": }
cobbler_snippet {"pre_install_partition": }
cobbler_snippet {"pre_install_partition_lvm": }
cobbler_snippet {"nailgun_repo": }
cobbler_snippet {"ssh_disable_gssapi": }
cobbler_snippet {"sshd_auth_pubkey_only": }
cobbler_snippet {"disable_pxe":}
cobbler_snippet {"post_part_compute":}
cobbler_snippet {"post_part_controller":}
cobbler_snippet {"post_part_storage":}
cobbler_snippet {"post_install_network_config_fuel":}
cobbler_snippet {"puppet_register_if_enabled_fuel":}
cobbler_snippet {"url_proxy":}
cobbler_snippet {"puppet_install_if_enabled":}
cobbler_snippet {"puppet_conf":}
cobbler_snippet {"puppet_register_if_enabled":}
cobbler_snippet {'ntp_register_if_enabled':}
cobbler_snippet {"mcollective_install_if_enabled":}
cobbler_snippet {"mcollective_conf":}
cobbler_snippet {"post_install_network_config":}
cobbler_snippet {"cinder_create_lvm_group":}
cobbler_snippet {"cinder_create_lvm_group__ubuntu":}
cobbler_snippet {"centos_authorized_keys": }
cobbler_snippet {"centos_blacklist_i2c_piix4":}
cobbler_snippet {"centos_static_net":}
cobbler_snippet {"ofed_install_with_sriov":}
cobbler_snippet {"ubuntu_authorized_keys":}
cobbler_snippet {"ubuntu_blacklist_i2c_piix4":}
cobbler_snippet {"ubuntu_disable_pxe":}
cobbler_snippet {"ubuntu_puppet_config":}
cobbler_snippet {"ubuntu_mcollective_config":}
cobbler_snippet {"ubuntu_network":}
cobbler_snippet {"ubuntu_network_console_and_syslog":}
cobbler_snippet {"ubuntu_partition":}
cobbler_snippet {"ubuntu_partition_late":}
cobbler_snippet {"ubuntu_static_net":}
cobbler_snippet {"ubuntu_repos_late":}
cobbler_snippet {"ubuntu_remove_repos_late":}
cobbler_snippet {"ubuntu_precise_packages_late":}
cobbler_snippet {"ubuntu_trusty_packages_late":}
cobbler_snippet {"anaconda_ssh_console":}
cobbler_snippet {"anaconda_yum":}
cobbler_snippet {'centos_post_kernel_lt_if_enabled':}
cobbler_snippet {'centos_pkg_kernel_lt_if_enabled':}
cobbler_snippet {'centos_ofed_prereq_pkgs_if_enabled':}
::cobbler::snippet {'send2syslog': }
::cobbler::snippet {'target_logs_to_master': }
::cobbler::snippet {'target_logs_to_master_ubuntu': }
::cobbler::snippet {'kickstart_ntp': }
::cobbler::snippet {'ntp_to_masternode': }
::cobbler::snippet {'ntp_to_masternode_ubuntu': }
::cobbler::snippet {'pre_install_network_config': }
::cobbler::snippet {'pre_install_partition': }
::cobbler::snippet {'pre_install_partition_lvm': }
::cobbler::snippet {'nailgun_repo': }
::cobbler::snippet {'ssh_disable_gssapi': }
::cobbler::snippet {'sshd_auth_pubkey_only': }
::cobbler::snippet {'disable_pxe':}
::cobbler::snippet {'post_part_compute':}
::cobbler::snippet {'post_part_controller':}
::cobbler::snippet {'post_part_storage':}
::cobbler::snippet {'post_install_network_config_fuel':}
::cobbler::snippet {'puppet_register_if_enabled_fuel':}
::cobbler::snippet {'url_proxy':}
::cobbler::snippet {'puppet_install_if_enabled':}
::cobbler::snippet {'puppet_conf':}
::cobbler::snippet {'puppet_register_if_enabled':}
::cobbler::snippet {'ntp_register_if_enabled':}
::cobbler::snippet {'mcollective_install_if_enabled':}
::cobbler::snippet {'mcollective_conf':}
::cobbler::snippet {'post_install_network_config':}
::cobbler::snippet {'cinder_create_lvm_group':}
::cobbler::snippet {'cinder_create_lvm_group__ubuntu':}
::cobbler::snippet {'centos_authorized_keys': }
::cobbler::snippet {'centos_blacklist_i2c_piix4':}
::cobbler::snippet {'centos_static_net':}
::cobbler::snippet {'ofed_install_with_sriov':}
::cobbler::snippet {'ubuntu_authorized_keys':}
::cobbler::snippet {'ubuntu_blacklist_i2c_piix4':}
::cobbler::snippet {'ubuntu_disable_pxe':}
::cobbler::snippet {'ubuntu_puppet_config':}
::cobbler::snippet {'ubuntu_mcollective_config':}
::cobbler::snippet {'ubuntu_network':}
::cobbler::snippet {'ubuntu_network_console_and_syslog':}
::cobbler::snippet {'ubuntu_partition':}
::cobbler::snippet {'ubuntu_partition_late':}
::cobbler::snippet {'ubuntu_static_net':}
::cobbler::snippet {'ubuntu_repos_late':}
::cobbler::snippet {'ubuntu_remove_repos_late':}
::cobbler::snippet {'ubuntu_precise_packages_late':}
::cobbler::snippet {'ubuntu_trusty_packages_late':}
::cobbler::snippet {'anaconda_ssh_console':}
::cobbler::snippet {'anaconda_yum':}
::cobbler::snippet {'centos_post_kernel_lt_if_enabled':}
::cobbler::snippet {'centos_pkg_kernel_lt_if_enabled':}
::cobbler::snippet {'centos_ofed_prereq_pkgs_if_enabled':}
case $operatingsystem {
case $::operatingsystem {
/(?i)(debian|ubuntu)/: {
file { "/usr/bin/late_command.py" :
content => template("cobbler/scripts/late_command.py"),
owner => root,
group => root,
mode => 0644,
file { '/usr/bin/late_command.py' :
content => template('cobbler/scripts/late_command.py'),
owner => 'root',
group => 'root',
mode => '0644',
}
file { "/usr/bin/pmanager.py" :
content => template("cobbler/scripts/pmanager.py"),
owner => root,
group => root,
mode => 0644,
file { '/usr/bin/pmanager.py' :
content => template('cobbler/scripts/pmanager.py'),
owner => 'root',
group => 'root',
mode => '0644',
}
}
/(?i)(centos|redhat)/: {
@ -99,16 +88,16 @@ class cobbler::snippets {
$pyversion = '2.6'
}
file { "/usr/lib/python${pyversion}/site-packages/cobbler/late_command.py" :
content => template("cobbler/scripts/late_command.py"),
owner => root,
group => root,
mode => 0644,
content => template('cobbler/scripts/late_command.py'),
owner => 'root',
group => 'root',
mode => '0644',
}
file { "/usr/lib/python${pyversion}/site-packages/cobbler/pmanager.py" :
content => template("cobbler/scripts/pmanager.py"),
owner => root,
group => root,
mode => 0644,
content => template('cobbler/scripts/pmanager.py'),
owner => 'root',
group => 'root',
mode => '0644',
}
}
}