Move host information to pillar data

This commit is contained in:
Jan Dittberner 2016-01-31 19:47:58 +01:00
parent 2ff2a8174c
commit e582e4a6c4
2 changed files with 25 additions and 24 deletions

View file

@ -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

View file

@ -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: