diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2014-07-14 15:10:09 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2014-07-14 15:10:09 +0000 |
commit | 160fd3f2f1d372751836c0073bdc944df1cfbb91 (patch) | |
tree | d6b46ce1ec600400883e53b82e12b390fa73f262 /ansible/roles/trove-setup/tasks/minions.yml | |
parent | eafba37e2bfc3897e3e7f65f2ce087fbee358f43 (diff) | |
parent | d349c9a35d3d53ebfc9f26df373e84fa5986a1b6 (diff) | |
download | trove-setup-160fd3f2f1d372751836c0073bdc944df1cfbb91.tar.gz |
Merge branch 'baserock/pedroalvarez/trove-ansible3'
Reviewed-by: Richard Maw
Reviewed-by: Lars Wirzenius
Diffstat (limited to 'ansible/roles/trove-setup/tasks/minions.yml')
-rw-r--r-- | ansible/roles/trove-setup/tasks/minions.yml | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ansible/roles/trove-setup/tasks/minions.yml b/ansible/roles/trove-setup/tasks/minions.yml new file mode 100644 index 0000000..a5b3d8d --- /dev/null +++ b/ansible/roles/trove-setup/tasks/minions.yml @@ -0,0 +1,20 @@ +# Depends on: +# - lorry-controller-setup.yml +--- +# This is a workaround because the service module and the current +# systemd version doesn't work well enough with template units. +# +# It ALWAYS runs `systemctl enable` for all the minions to be +# created, but it only reports that the status of the task has changed +# when in the stderr output is the string "ln -s" (which means the +# unit has been enabled). +- name: Enable as many MINIONS as specified in LORRY_CONTROLLER_MINIONS + shell: systemctl enable lorry-controller-minion@{{ item }}.service + with_sequence: count={{ LORRY_CONTROLLER_MINIONS }} + changed_when: "'ln -s' in minions_creation.stderr" + register: minions_creation + +- name: Start the all the MINIONS created (if any) + service: name=lorry-controller-minion@{{ item.item }} state=restarted + with_items: minions_creation.results + when: item|changed |