2016-01-29 18:34:40 +01:00
|
|
|
{% from 'gnuviechadmin/vars.sls' import home, gva_component, gva_amqp_user, checkout, appdir, venv %}
|
|
|
|
|
2016-01-31 19:47:58 +01:00
|
|
|
{% for host in salt['pillar.get']('gnuviechadmin:machines') %}
|
|
|
|
{{ host }}:
|
2016-01-29 18:34:40 +01:00
|
|
|
host.present:
|
2016-01-31 19:47:58 +01:00
|
|
|
- ip: {{ salt['pillar.get']('gnuviechadmin:machines:%s:ip' % host) }}
|
|
|
|
{% if salt['pillar.get']('gnuviechadmin:machines:%s:names' % host) %}
|
2016-01-29 18:34:40 +01:00
|
|
|
- names:
|
2016-01-31 19:47:58 +01:00
|
|
|
{% for machine in salt['pillar.get']('gnuviechadmin:machines:%s:names' % host) %}
|
|
|
|
- {{ machine }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
2016-01-29 18:34:40 +01:00
|
|
|
|
|
|
|
gnuviechadmin-packages:
|
|
|
|
pkg.installed:
|
|
|
|
- pkgs:
|
|
|
|
- libyaml-dev
|
|
|
|
- python-virtualenv
|
2016-09-25 17:29:52 +02:00
|
|
|
- virtualenv
|
2016-01-29 18:34:40 +01:00
|
|
|
- python-dev
|
|
|
|
- python-pip
|
|
|
|
- gettext
|
|
|
|
|
|
|
|
{{ home }}/gvasettings.sh:
|
|
|
|
file.managed:
|
|
|
|
- user: vagrant
|
|
|
|
- group: vagrant
|
|
|
|
- mode: 0640
|
|
|
|
- source: salt://gnuviechadmin/{{ gva_component }}/settings.sh
|
|
|
|
- template: jinja
|
|
|
|
- context:
|
|
|
|
broker_url: {{ 'amqp://%s:%s@mq/%s' % (gva_amqp_user, salt['pillar.get']('gnuviechadmin:queues:users:%s:password' % gva_amqp_user), salt['pillar.get']('gnuviechadmin:queues:vhost')) }}
|
|
|
|
|
|
|
|
gnuviechadmin-venv:
|
|
|
|
cmd.run:
|
|
|
|
- name: virtualenv {{ venv }}
|
2016-09-24 23:53:49 +02:00
|
|
|
- runas: vagrant
|
2016-01-29 18:34:40 +01:00
|
|
|
- unless: test -f {{ venv }}/bin/pip
|
|
|
|
|
|
|
|
gnuviechadmin-requires:
|
|
|
|
cmd.run:
|
|
|
|
- name: {{ venv }}/bin/pip install -U -r requirements/local.txt && touch {{ venv }}/lastinstall
|
2016-09-24 23:53:49 +02:00
|
|
|
- runas: vagrant
|
2016-01-29 18:34:40 +01:00
|
|
|
- cwd: {{ checkout }}
|
|
|
|
- require:
|
|
|
|
- cmd: gnuviechadmin-venv
|
|
|
|
- pkg: gnuviechadmin-packages
|
|
|
|
- unless: test -e {{ venv }}/lastinstall && test {{ checkout }}/requirements/local.txt -ot {{ venv }}/lastinstall && test {{ checkout }}/requirements/base.txt -ot {{ venv }}/lastinstall
|
|
|
|
|
|
|
|
/home/vagrant/.bash_functions:
|
|
|
|
file.managed:
|
|
|
|
- user: vagrant
|
|
|
|
- group: vagrant
|
|
|
|
- mode: 0644
|
|
|
|
- source: salt://base/bash_functions
|
|
|
|
- template: jinja
|
|
|
|
- context:
|
|
|
|
home: {{ home }}
|
|
|
|
venv: {{ venv }}
|
|
|
|
appdir: {{ appdir }}
|