summaryrefslogtreecommitdiff
path: root/puppet/modules/site_config
diff options
context:
space:
mode:
authorMicah Anderson <micah@leap.se>2014-06-19 14:12:08 -0400
committerMicah Anderson <micah@leap.se>2014-06-19 14:12:08 -0400
commit9198af78956972a01aaf85e19753c5c9e62ea018 (patch)
tree7c2c4901c92528b2fababb0e4283d5bec6cd1aef /puppet/modules/site_config
parent6100b6ded99241f10e7fb12c13a0820fda084912 (diff)
parentf991e8a4c877cff1d274fd1cac26488f8c3fda84 (diff)
Merge tag '0.5.2'
tagging 0.5.2 release
Diffstat (limited to 'puppet/modules/site_config')
-rw-r--r--puppet/modules/site_config/manifests/default.pp5
-rw-r--r--puppet/modules/site_config/manifests/hosts.pp16
-rw-r--r--puppet/modules/site_config/manifests/setup.pp1
-rw-r--r--puppet/modules/site_config/manifests/sshd.pp9
-rw-r--r--puppet/modules/site_config/templates/hosts3
5 files changed, 17 insertions, 17 deletions
diff --git a/puppet/modules/site_config/manifests/default.pp b/puppet/modules/site_config/manifests/default.pp
index c7352857..fc2179de 100644
--- a/puppet/modules/site_config/manifests/default.pp
+++ b/puppet/modules/site_config/manifests/default.pp
@@ -1,6 +1,7 @@
class site_config::default {
tag 'leap_base'
+ $services = hiera('services', [])
$domain_hash = hiera('domain')
include site_config::params
@@ -18,7 +19,7 @@ class site_config::default {
include site_config::sysctl
# configure ssh and include ssh-keys
- include site_config::sshd
+ include site_sshd
# include classes for special environments
# i.e. openstack/aws nodes, vagrant nodes
@@ -54,7 +55,7 @@ class site_config::default {
# set up core leap files and directories
include site_config::files
- if $::services !~ /\bmx\b/ {
+ if ! member($services, 'mx') {
include site_postfix::satellite
}
diff --git a/puppet/modules/site_config/manifests/hosts.pp b/puppet/modules/site_config/manifests/hosts.pp
index e5d4dd70..6982d37b 100644
--- a/puppet/modules/site_config/manifests/hosts.pp
+++ b/puppet/modules/site_config/manifests/hosts.pp
@@ -1,9 +1,19 @@
class site_config::hosts() {
$hosts = hiera('hosts', false)
+
+ # calculate all the hostname aliases that might be used
$hostname = hiera('name')
- $domain_hash = hiera('domain')
- $domain_public = $domain_hash['full_suffix']
- $api = hiera('api', '')
+ $domain_hash = hiera('domain', {})
+ $dns = hiera('dns', {})
+ if $dns['aliases'] == undef {
+ $dns_aliases = []
+ } else {
+ $dns_aliases = $dns['aliases']
+ }
+ $my_hostnames = unique(sort(concat(
+ [$hostname, $domain_hash['full'], $domain_hash['internal']],
+ $dns_aliases
+ )))
file { '/etc/hostname':
ensure => present,
diff --git a/puppet/modules/site_config/manifests/setup.pp b/puppet/modules/site_config/manifests/setup.pp
index 6d89be86..b09d0413 100644
--- a/puppet/modules/site_config/manifests/setup.pp
+++ b/puppet/modules/site_config/manifests/setup.pp
@@ -4,7 +4,6 @@ class site_config::setup {
#
# this is applied before each run of site.pp
#
- #$services = ''
Exec { path => '/usr/bin:/usr/sbin/:/bin:/sbin:/usr/local/bin:/usr/local/sbin' }
diff --git a/puppet/modules/site_config/manifests/sshd.pp b/puppet/modules/site_config/manifests/sshd.pp
deleted file mode 100644
index 8ff337a0..00000000
--- a/puppet/modules/site_config/manifests/sshd.pp
+++ /dev/null
@@ -1,9 +0,0 @@
-class site_config::sshd {
- # configure sshd
- include sshd
- include site_sshd
- # no need for configuring authorized_keys as leap_cli cares for that
- #$ssh_pubkeys=hiera_hash('ssh_pubkeys')
- #notice($ssh_pubkeys)
- #create_resources('site_sshd::ssh_key', $ssh_pubkeys)
-}
diff --git a/puppet/modules/site_config/templates/hosts b/puppet/modules/site_config/templates/hosts
index bfcabaa5..d557f730 100644
--- a/puppet/modules/site_config/templates/hosts
+++ b/puppet/modules/site_config/templates/hosts
@@ -1,8 +1,7 @@
# This file is managed by puppet, any changes will be overwritten!
127.0.0.1 localhost
-127.0.1.1 <%= @hostname %>.<%= @domain_public %> <%= @hostname %> <% if (defined? @services) and (@services.include? 'webapp') -%><%= @domain_public %> <%= @api['domain'] %><% end -%>
-
+127.0.1.1 <%= @my_hostnames.join(' ') %>
<%- if @hosts then -%>
<% @hosts.keys.sort.each do |name| -%>