summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmdb/hosts/andromeda.yaml1
-rw-r--r--cmdb/hosts/collab-jde.yaml3
-rw-r--r--cmdb/hosts/legend.yaml1
-rw-r--r--services/common.cf6
-rw-r--r--templates/common/hosts.cftpl5
5 files changed, 13 insertions, 3 deletions
diff --git a/cmdb/hosts/andromeda.yaml b/cmdb/hosts/andromeda.yaml
index 52bce5d..4ecca5d 100644
--- a/cmdb/hosts/andromeda.yaml
+++ b/cmdb/hosts/andromeda.yaml
@@ -1,3 +1,4 @@
+domain: adyxax.org
host_interface: dummy0
host_ip: "10.1.0.255"
diff --git a/cmdb/hosts/collab-jde.yaml b/cmdb/hosts/collab-jde.yaml
index 3d8064a..e02e571 100644
--- a/cmdb/hosts/collab-jde.yaml
+++ b/cmdb/hosts/collab-jde.yaml
@@ -1,4 +1,5 @@
-host_interface: dummy0
+domain: adyxax.org
+host_interface: br0
host_ip: "10.1.0.253"
tunnels:
diff --git a/cmdb/hosts/legend.yaml b/cmdb/hosts/legend.yaml
index a94400d..46cd451 100644
--- a/cmdb/hosts/legend.yaml
+++ b/cmdb/hosts/legend.yaml
@@ -1,3 +1,4 @@
+domain: adyxax.org
host_interface: dummy0
host_ip: "10.1.0.254"
diff --git a/services/common.cf b/services/common.cf
index d315c6a..de738a8 100644
--- a/services/common.cf
+++ b/services/common.cf
@@ -3,9 +3,11 @@ bundle agent common
files:
any::
"/etc/hosts"
- edit_defaults => std_defs,
+ create => "true",
+ edit_defaults => empty,
perms => system_owned("444"),
- copy_from => local_dcp("$(sys.inputdir)/templates/common/hosts.cftpl"),
+ edit_template => "$(sys.inputdir)/templates/common/hosts.cftpl",
+ template_method => "cfengine",
classes => if_repaired("common_hosts_files_repaired");
reports:
any::
diff --git a/templates/common/hosts.cftpl b/templates/common/hosts.cftpl
index 23342fd..0b34717 100644
--- a/templates/common/hosts.cftpl
+++ b/templates/common/hosts.cftpl
@@ -1,9 +1,13 @@
+[%CFEngine BEGIN %]
###############################################################################
# \_o< WARNING : This file is being managed by cfengine! >o_/ #
# ~~~~ ~~~~ #
###############################################################################
127.0.0.1 localhost
+[%CFEngine has_host_data:: %]
+$(sys.ipv4) $(sys.uqhost).$(g.host_data[domain]) $(sys.uqhost)
+[%CFEngine any:: %]
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
@@ -13643,3 +13647,4 @@ ff02::2 ip6-allrouters
# kwadronaut for Windows 7 and Vista information
# John Mueller and Lawrence H Smith for Mac Pre-OSX information
# Jesse Baird for the Cisco IOS script
+[%CFEngine END %]