On 24. feb. 2017 21:56, Stéphane Klein wrote:
Le vendredi 24 février 2017 21:26:38 UTC+1, Kai Stian Olstad a écrit :

Do you know a better solution?

What I would do is put the correct .bashrc in Ansible and just use the
copy module to copy it to the host(s).


I would like copy only if bash_completion isn't already present in .bashrc

Then you don't have much choice but go for the solution you posted.

But to make the output nicer I would replace "ignore_errors: True"
with

  failed_when: False

or

  failed_when: check_bashcompletion_enabled.rc > 1
  changed_when: check_bashcompletion_enabled.rc == 1


What is it about your solution you don't like?

--
Kai Stian Olstad

--
You received this message because you are subscribed to the Google Groups "Ansible 
Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/7e2ea06c-b720-784e-2071-aed19f32c135%40olstad.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to