Page MenuHomeDevCentral

No OneTemporary

diff --git a/pillar/core/hostnames.sls b/pillar/core/hostnames.sls
deleted file mode 100644
index 8f88b55..0000000
--- a/pillar/core/hostnames.sls
+++ /dev/null
@@ -1,4 +0,0 @@
-hostnames:
- eglide: eglide.org
- equatower: equatower.nasqueron.org
- ysul: ysul.nasqueron.org
diff --git a/pillar/top.sls b/pillar/top.sls
index 4dcc090..1cd563d 100644
--- a/pillar/top.sls
+++ b/pillar/top.sls
@@ -1,21 +1,20 @@
# -------------------------------------------------------------
# Salt configuration for Nasqueron servers
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2016-04-10
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
base:
'*':
- - core.hostnames
- core.users
- core.groups
- certificates.certificates
- nodes.nodes
- nodes.forests
- webserver.sites
ysul:
- paas-jails.jails
- viperserv.bots
- viperserv.fantoir
diff --git a/roles/core/hostname/init.sls b/roles/core/hostname/init.sls
index 8989c32..e5c89c3 100644
--- a/roles/core/hostname/init.sls
+++ b/roles/core/hostname/init.sls
@@ -1,35 +1,35 @@
# -------------------------------------------------------------
# Salt — Set machine hostname
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# Project: Nasqueron
# Created: 2016-06-15
# Description: Set hostname
# License: Trivial work, not eligible to copyright
# -------------------------------------------------------------
# -------------------------------------------------------------
# Store hostname into a configuration file
# -------------------------------------------------------------
hostname:
file.managed:
- name: /etc/hostname
- - contents: {{ pillar.get('hostnames')[grains['id']] }}
+ - contents: {{ salt['node.get']('hostname') }}
# -------------------------------------------------------------
# When the hostname is changed, what to run afterwards?
# -------------------------------------------------------------
after_hostname_change:
cmd.run:
- name: hostname `cat /etc/hostname`
- onchanges:
- file: /etc/hostname
{% if grains['os_family'] == 'Debian' %}
after_hostname_change_debian:
cmd.run:
- name: invoke-rc.d hostname.sh start
- onchanges:
- file: /etc/hostname
{% endif %}

File Metadata

Mime Type
text/x-diff
Expires
Sat, Oct 11, 23:51 (18 h, 13 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3064268
Default Alt Text
(2 KB)

Event Timeline