Revert "Support for dns aliases, dynamic creation of zone files (dependent"
This reverts commit b470ceb9b6
.
This commit is contained in:
parent
e0aa5937a5
commit
bf79f517ba
6 changed files with 4 additions and 75 deletions
|
@ -1,8 +0,0 @@
|
||||||
|
|
||||||
if File.exists?("/etc/dnsaliases")
|
|
||||||
Facter.add("dnsaliases") do
|
|
||||||
setcode do
|
|
||||||
Facter::Util::Resolution.exec('cat /etc/dnsaliases').chomp
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
|
@ -1,35 +0,0 @@
|
||||||
#!/bin/sh
|
|
||||||
|
|
||||||
if [ $# != 2 ]; then
|
|
||||||
echo "ERR: Must have two arguments: DNS server name and zone/environment" 1>&2
|
|
||||||
return 2
|
|
||||||
fi
|
|
||||||
|
|
||||||
ZONE=$2
|
|
||||||
SERVER=$1
|
|
||||||
FACTS_DIR="/var/lib/puppet/yaml/facts"
|
|
||||||
ZONE_FILE="/srv/puppet/files/common/dns/db.$ZONE-dynamic.$SERVER"
|
|
||||||
|
|
||||||
if [ ! -d "${FACTS_DIR}" ]; then
|
|
||||||
echo "ERR: Cannot find Facter facts directory ${FACTS_DIR}" 1>&2
|
|
||||||
exit 3
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f "${ZONE_FILE}" ]; then
|
|
||||||
rm $ZONE_FILE
|
|
||||||
fi
|
|
||||||
cd $FACTS_DIR
|
|
||||||
for i in `grep -l "environment: $ZONE" *`;
|
|
||||||
do
|
|
||||||
echo $i
|
|
||||||
hn=`grep hostname $i | cut -f 2 -d ':' | tr -d ' '`
|
|
||||||
ip=`grep "ipaddress:" $i | cut -f 2 -d ':'`
|
|
||||||
a=`grep "aliases:" $i | cut -f 2 -d ':' | tr -d '"' | tr -d ' '| tr ',' "\n"`;
|
|
||||||
echo "$hn IN A $ip" >> $ZONE_FILE
|
|
||||||
if [ "$a" != "" ]; then
|
|
||||||
for j in $a;
|
|
||||||
do
|
|
||||||
echo "$j CNAME $hn" >> $ZONE_FILE
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
done
|
|
|
@ -236,12 +236,9 @@ define dns::zone($role = "master", $master = [], $slaves = [], $source = "AUTO")
|
||||||
}
|
}
|
||||||
file { "${dns::server::chroot}${zonedir}/db.${zonefile}-dynamic":
|
file { "${dns::server::chroot}${zonedir}/db.${zonefile}-dynamic":
|
||||||
ensure => present,
|
ensure => present,
|
||||||
content => generate(
|
source => [ "puppet:///files/dns/db.${zonefile}-dynamic.${homename}",
|
||||||
"/bin/sh",
|
"puppet:///modules/dns/empty", ],
|
||||||
"/etc/puppet/modules/dns/files/create_dynamic_records.sh",
|
mode => 0640,
|
||||||
$homename,
|
|
||||||
$zone),
|
|
||||||
mode => 0640,
|
|
||||||
owner => "root",
|
owner => "root",
|
||||||
group => $dns::server::group,
|
group => $dns::server::group,
|
||||||
require => $operatingsystem ? {
|
require => $operatingsystem ? {
|
||||||
|
|
|
@ -1,21 +0,0 @@
|
||||||
# .
|
|
||||||
#
|
|
||||||
# === Global variables
|
|
||||||
#
|
|
||||||
# $aliases:
|
|
||||||
# Comma-separated list of aliases for this host.
|
|
||||||
#
|
|
||||||
|
|
||||||
class dnsaliases( $aliases ) {
|
|
||||||
|
|
||||||
$content = "$aliases\n"
|
|
||||||
|
|
||||||
file { "/etc/dnsaliases":
|
|
||||||
ensure => present,
|
|
||||||
mode => 0644,
|
|
||||||
owner => root,
|
|
||||||
group => root,
|
|
||||||
content => $content,
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
# Install and configure Puppet client.
|
# Install and configure Puppet client.
|
||||||
#
|
#
|
||||||
class puppet::client ($environment='') {
|
class puppet::client {
|
||||||
|
|
||||||
tag("bootstrap")
|
tag("bootstrap")
|
||||||
|
|
||||||
|
|
|
@ -39,10 +39,6 @@
|
||||||
# The bit length of keys.
|
# The bit length of keys.
|
||||||
keylength = <%= puppet_keylength %>
|
keylength = <%= puppet_keylength %>
|
||||||
|
|
||||||
<% if !(environment == '') %>
|
|
||||||
# Environment this entity is in.
|
|
||||||
environment = <%= environment %>
|
|
||||||
<% end -%>
|
|
||||||
<% if puppetversion[/\d+/].to_i >= 2 -%>
|
<% if puppetversion[/\d+/].to_i >= 2 -%>
|
||||||
[agent]
|
[agent]
|
||||||
# Ignore site manifest when run as agent. Fixes warnings about
|
# Ignore site manifest when run as agent. Fixes warnings about
|
||||||
|
|
Loading…
Add table
Reference in a new issue