-
Notifications
You must be signed in to change notification settings - Fork 3
/
local-service-config.yaml
28 lines (28 loc) · 1.5 KB
/
local-service-config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# Setup ansible hosts file and host_vars/localhost as described in doc/work_instructions/UI.md
#
# Supported extra-vars: service="dest-service-name"
# de_config_dir="/etc/iplant/de"
# config_name="service.properties"
# config_template="roles/path-to-role/templates/service.properties.j2"
# @local_dev/service.json
#
# This playbook will do funny things with old versions of ansible, due to changes in how variable expansion works. If something weird is happening, probably update your ansible version.
#
# This playbook will write local donkey configs by default.
#
# For example:
# Write local configs for donkey to /etc/iplant/de/donkey.properties, using de-2 services but using a local data-info service.
# ansible-playbook local-service-config.yaml --extra-vars="@local_dev/donkey.json" --extra-vars="@local_dev/data-info.json"
#
# Write local configs for data-info to /etc/iplant/de/data-info.properties, using de-2 services.
# ansible-playbook local-service-config.yaml --extra-vars="service=data-info"
---
- hosts: services
vars:
svce: "{{ service | default('donkey') }}"
config_template: "roles/services/templates/{{ svce }}.properties.j2"
config_name: "{{ svce }}.properties"
tasks:
- debug: msg="writing {{ config_template }} to {{ de_config_dir }}/{{ config_name }}"
- name: write local service configs
local_action: template src="{{ config_template }}" dest="{{ de_config_dir }}/{{ config_name }}" mode=0644