From e582e4a6c4e1fe91066a517178b9435ea1e0cb3d Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sun, 31 Jan 2016 19:47:58 +0100 Subject: [PATCH] Move host information to pillar data --- pillar/gnuviechadmin/init.sls | 16 ++++++++++++++++ roots/gnuviechadmin/base.sls | 33 +++++++++------------------------ 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/pillar/gnuviechadmin/init.sls b/pillar/gnuviechadmin/init.sls index 875b13f..18d99b5 100644 --- a/pillar/gnuviechadmin/init.sls +++ b/pillar/gnuviechadmin/init.sls @@ -16,3 +16,19 @@ gnuviechadmin: ldap_base_dn: dc=gva,dc=local ldap_groups_ou: groups ldap_users_ou: users + machines: + gva.local: + ip: 172.16.3.2 + names: + - mq + - gva.local + gvaldap.local: + ip: 172.16.3.3 + gvafile.local: + ip: 172.16.3.4 + gvaweb.local: + ip: 172.16.3.5 + gvamysql.local: + ip: 172.16.3.6 + gvapgsql.local: + ip: 172.16.3.7 diff --git a/roots/gnuviechadmin/base.sls b/roots/gnuviechadmin/base.sls index b0e8ccb..161ad0f 100644 --- a/roots/gnuviechadmin/base.sls +++ b/roots/gnuviechadmin/base.sls @@ -1,31 +1,16 @@ {% from 'gnuviechadmin/vars.sls' import home, gva_component, gva_amqp_user, checkout, appdir, venv %} -gva.local: +{% for host in salt['pillar.get']('gnuviechadmin:machines') %} +{{ host }}: host.present: - - ip: 172.16.3.2 + - ip: {{ salt['pillar.get']('gnuviechadmin:machines:%s:ip' % host) }} +{% if salt['pillar.get']('gnuviechadmin:machines:%s:names' % host) %} - names: - - mq - - gva.local - -gvaldap.local: - host.present: - - ip: 172.16.3.3 - -gvafile.local: - host.present: - - ip: 172.16.3.4 - -gvaweb.local: - host.present: - - ip: 172.16.3.5 - -gvamysql.local: - host.present: - - ip: 172.16.3.6 - -gvapgsql.local: - host.present: - - ip: 172.16.3.7 +{% for machine in salt['pillar.get']('gnuviechadmin:machines:%s:names' % host) %} + - {{ machine }} +{% endfor %} +{% endif %} +{% endfor %} gnuviechadmin-packages: pkg.installed: