Skip to content
Browse files

Merge pull request #2 from GregSutcliffe/master

Master forked to "oldstable" for older puppet users
Merged to master
  • Loading branch information...
2 parents 647b1e2 + d44b38e commit a80183e04e292fc99981c01159ea49acad69787d @GregSutcliffe GregSutcliffe committed
Showing with 110 additions and 12 deletions.
  1. +5 −3 manifests/config.pp
  2. +43 −4 manifests/params.pp
  3. +32 −0 manifests/proxydhcp.pp
  4. +16 −0 manifests/proxydns.pp
  5. +1 −1 manifests/puppetca.pp
  6. +5 −3 manifests/service.pp
  7. +8 −1 templates/settings.yml.erb
View
8 manifests/config.pp
@@ -8,7 +8,7 @@
require => Class['foreman_proxy::install'],
notify => Class['foreman_proxy::service'],
}
-
+
file{'/etc/foreman-proxy/settings.yml':
content => template('foreman_proxy/settings.yml.erb'),
owner => $foreman_proxy::params::user,
@@ -33,7 +33,9 @@
if $foreman_proxy::params::puppetca { include foreman_proxy::puppetca }
if $foreman_proxy::params::tftp { include foreman_proxy::tftp }
- #if $foreman_proxy::params::dhcp { include foreman_proxy::dhcp }
- #if $foreman_proxy::params::dns { include foreman_proxy::dns }
+
+ # Somehow, calling these DHCP and DNS seems to conflict. So, they get a prefix...
+ if $foreman_proxy::params::dhcp { include foreman_proxy::proxydhcp }
+ if $foreman_proxy::params::dns { include foreman_proxy::proxydns }
}
View
47 manifests/params.pp
@@ -10,21 +10,60 @@
# puppetca settings
$puppetca = true
$autosign_location = '/etc/puppet/autosign.conf'
- $puppetca_cmd = '/usr/sbin/puppetca'
+ $puppetca_cmd = '/usr/sbin/puppet cert'
$puppet_group = 'puppet'
# puppetrun settings
$puppetrun = true
$puppetrun_cmd = '/usr/sbin/puppetrun'
- # TFTP settings
+ # TFTP settings - requires optional TFTP puppet module
$tftp = true
- $syslinux_root = '/usr/share/syslinux'
- $syslinux_files = ['pxelinux.0','menu.c32','chain.c32']
+ case $::operatingsystem {
+ Debian,Ubuntu: {
+ $syslinux_root = '/usr/lib/syslinux'
+ $syslinux_files = ['pxelinux.0','menu.c32','chain.c32']
+ }
+ default: {
+ $syslinux_root = '/usr/share/syslinux'
+ $syslinux_files = ['pxelinux.0','menu.c32','chain.c32']
+ }
+ }
$tftproot = $tftp::params::root
$tftp_dir = ["${tftproot}/pxelinux.cfg","${tftproot}/boot"]
+ $servername = $ipaddress_eth0
+ # DHCP settings - requires optional DHCP puppet module
$dhcp = false
+ $gateway = '192.168.100.1'
+ $range = '192.168.100.50 192.168.100.200'
+ case $::operatingsystem {
+ Debian: {
+ $dhcp_vendor = 'isc'
+ $dhcp_config = '/etc/dhcp/dhcpd.conf'
+ $dhcp_leases = '/var/lib/dhcp/dhcpd.leases'
+ }
+ Ubuntu: {
+ $dhcp_vendor = 'isc'
+ $dhcp_config = '/etc/dhcp3/dhcpd.conf'
+ $dhcp_leases = '/var/lib/dhcp3/dhcpd.leases'
+ }
+ default: {
+ $dhcp_vendor = 'isc'
+ $dhcp_config = '/etc/dhcpd.conf'
+ $dhcp_leases = '/var/lib/dhcpd/dhcpd.leases'
+ }
+ }
+
+ # DNS settings - requires optional DNS puppet module
$dns = false
+ case $::operatingsystem {
+ Debian: {
+ $keyfile = '/etc/bind/rndc.key'
+ }
+ default: {
+ $keyfile = '/etc/rndc.key'
+ }
+ }
}
View
32 manifests/proxydhcp.pp
@@ -0,0 +1,32 @@
+class foreman_proxy::proxydhcp {
+ include foreman_proxy::params
+
+ package { "net-ping":
+ ensure => installed,
+ provider => 'gem',
+ }
+
+ class { 'dhcp':
+ dnsdomain => [
+ "${::domain}",
+ "100.168.192.in-addr.arpa",
+ ],
+ nameservers => ["${::ipaddress}"],
+ ntpservers => ['us.pool.ntp.org'],
+ interfaces => ['eth0'],
+ #dnsupdatekey => "/etc/bind/keys.d/foreman",
+ #require => Bind::Key[ 'foreman' ],
+ pxeserver => "${::ipaddress}",
+ pxefilename => 'pxelinux.0',
+ dhcp_monitor => false,
+ }
+
+ dhcp::pool{ "${::domain}":
+ network => "${::network_eth0}",
+ mask => "${::netmask_eth0}",
+ range => "${foreman_proxy::params::range}",
+ gateway => "${foreman_proxy::params::gateway}",
+ }
+
+
+}
View
16 manifests/proxydns.pp
@@ -0,0 +1,16 @@
+class foreman_proxy::proxydns {
+ include foreman_proxy::params
+ include dns
+
+ dns::zone { "${::domain}":
+ soa => "${::fqdn}",
+ reverse => "false",
+ soaip => "${::ipaddress}",
+ }
+
+ dns::zone { "100.168.192.in-addr.arpa":
+ soa => "${::fqdn}",
+ reverse => "true",
+ soaip => "${::ipaddress}",
+ }
+}
View
2 manifests/puppetca.pp
@@ -4,7 +4,7 @@
ensure => present,
owner => $foreman_proxy::params::user,
group => $foreman_proxy::params::puppet_group,
- mode => '0644',
+ mode => '0664',
require => Class['foreman_proxy::install'],
}
View
8 manifests/service.pp
@@ -1,6 +1,8 @@
class foreman_proxy::service {
- service {'foreman-proxy':
- ensure => running,
- require => Class['foreman_proxy::config']
+
+ service { 'foreman-proxy':
+ ensure => running,
+ require => Class['foreman_proxy::config'],
}
+
}
View
9 templates/settings.yml.erb
@@ -23,17 +23,23 @@
# Enable TFTP management
:tftp: <%= scope.lookupvar("foreman_proxy::params::tftp") %>
:tftproot: <%= scope.lookupvar("foreman_proxy::params::tftproot") %>
+:tftp_servername: <%= scope.lookupvar("foreman_proxy::params::servername") %>
# Defines the TFTP Servername to use, overrides the name in the subnet declaration
#:tftp_servername: tftp.domain.com
# Enable DNS management
:dns: <%= scope.lookupvar("foreman_proxy::params::dns") %>
-#:dns_key: /etc/rndc.key
+:dns_key: <%= scope.lookupvar("foreman_proxy::params::keyfile") %>
# use this setting if you are managing a dns server which is not localhost though this proxy
#:dns_server: dns.domain.com
# Enable DHCP management
:dhcp: <%= scope.lookupvar("foreman_proxy::params::dhcp") %>
+<% if scope.lookupvar("foreman_proxy::params::dhcp") == true -%>
+:dhcp_vendor: <%= scope.lookupvar("foreman_proxy::params::dhcp_vendor") %>
+:dhcp_config: <%= scope.lookupvar("foreman_proxy::params::dhcp_config") %>
+:dhcp_leases: <%= scope.lookupvar("foreman_proxy::params::dhcp_leases") %>
+<% else -%>
# The vendor can be either isc or native_ms
:dhcp_vendor: isc
# dhcp_subnets is a Native MS implementation setting. It restricts the subnets queried to a
@@ -47,6 +53,7 @@
#:dhcp_leases: /var/lib/dhcpd/dhcpd.leases
#:dhcp_key_name: secret_key_name
#:dhcp_key_secret: secret_key
+<% end -%>
# enable PuppetCA management
:puppetca: <%= scope.lookupvar("foreman_proxy::params::puppetca") %>

0 comments on commit a80183e

Please sign in to comment.
Something went wrong with that request. Please try again.