diff options
author | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-02-12 16:01:51 +0000 |
---|---|---|
committer | Pedro Alvarez <pedro.alvarez@codethink.co.uk> | 2015-02-12 16:01:51 +0000 |
commit | 1b89b00ccfed5adf796c2a5180a8cf6b2e2badf2 (patch) | |
tree | 64793ae5755519453104dff0de036ac6f46c9ba0 /ansible | |
parent | 7134fb36f7a1c62111d2eaea5c5b32cf2169cec6 (diff) | |
parent | 27bc3358ab3ccf85f942d7a537f7373b58f32c53 (diff) | |
download | trove-setup-1b89b00ccfed5adf796c2a5180a8cf6b2e2badf2.tar.gz |
Merge branch 'baserock/pedroalvarez/systemd-v217'
Reviewed-By: Francisco Redondo Marchena <francisco.marchena@codethink.co.uk>
Reviewed-By: Sam Thursfield <sam.thursfield@codethink.co.uk>
Diffstat (limited to 'ansible')
-rw-r--r-- | ansible/roles/trove-setup/tasks/minions.yml | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ansible/roles/trove-setup/tasks/minions.yml b/ansible/roles/trove-setup/tasks/minions.yml index a5b3d8d..929f893 100644 --- a/ansible/roles/trove-setup/tasks/minions.yml +++ b/ansible/roles/trove-setup/tasks/minions.yml @@ -4,6 +4,14 @@ # This is a workaround because the service module and the current # systemd version doesn't work well enough with template units. # +# Ansible runs the following to check the status of a systemd unit: +# +# systemctl show <name-of-unit> +# +# With template units, this command will say to Ansible that the unit +# "lorry-controller-minion@2" is running and enabled when only +# "lorry-controller-minion@1" is. That's why this workaround is needed. +# # 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 @@ -11,7 +19,7 @@ - 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" + changed_when: "'Created symlink' in minions_creation.stderr" register: minions_creation - name: Start the all the MINIONS created (if any) |