# ansible command on messages

**URL:** <https://forum.ansible.com/t/ansible-command-on-messages/28309>\
**Category:** Ansible Project\
**Created:** [August 10, 2018, 11:01am UTC](https://forum.ansible.com/t/ansible-command-on-messages/28309 "2018-08-10T11:01:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alfredo\_De\_Luca](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@Alfredo\_De\_Luca](https://forum.ansible.com/u/Alfredo_De_Luca)\
**Post date:** [August 10, 2018, 11:01am UTC](https://forum.ansible.com/t/ansible-command-on-messages/28309/1 "2018-08-10T11:01:39Z")

</div>

Hi all.  
With ansible we are changing root passwords on our machines. the root password is in a vault so all ok…  
But I find our the the command we run to change the password is visible on /var/log/messages …included the password itself…  
How can I remove that or do that in a different way?

Cheers

---

<div class="post-metadata">

**Author:** ![Jonathan\_Lozada\_De\_L](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jonathan\_Lozada\_De\_L](https://forum.ansible.com/u/Jonathan_Lozada_De_L)\
**Post date:** [August 10, 2018, 11:15am UTC](https://forum.ansible.com/t/ansible-command-on-messages/28309/2 "2018-08-10T11:15:16Z")

</div>

have you tried to do no\_log: True ?

[https://docs.ansible.com/ansible/2.5/reference\_appendices/faq.html#how-do-i-keep-secret-data-in-my-playbook](https://docs.ansible.com/ansible/2.5/reference_appendices/faq.html#how-do-i-keep-secret-data-in-my-playbook)

---

<div class="post-metadata">

**Author:** ![Alfredo\_De\_Luca](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@Alfredo\_De\_Luca](https://forum.ansible.com/u/Alfredo_De_Luca)\
**Post date:** [August 10, 2018, 11:32am UTC](https://forum.ansible.com/t/ansible-command-on-messages/28309/3 "2018-08-10T11:32:31Z")

</div>

Thanks heaps. there is also no\_target\_syslog… which it could be more appropriate for what I need to do.

Cheers

---

<div class="post-metadata">

**Author:** ![Alfredo\_De\_Luca](https://avatars.discourse-cdn.com/v4/letter/a/e480ec/32.png) [@Alfredo\_De\_Luca](https://forum.ansible.com/u/Alfredo_De_Luca)\
**Post date:** [August 10, 2018, 12:39pm UTC](https://forum.ansible.com/t/ansible-command-on-messages/28309/4 "2018-08-10T12:39:21Z")

</div>

no\_log  
worked perfectly!

thanks

---

<div class="post-metadata">

**Author:** ![Jobin\_A\_T\_A\_T](https://avatars.discourse-cdn.com/v4/letter/j/9e8a1a/32.png) [@Jobin\_A\_T\_A\_T](https://forum.ansible.com/u/Jobin_A_T_A_T)\
**Post date:** [August 10, 2018, 5:29pm UTC](https://forum.ansible.com/t/ansible-command-on-messages/28309/5 "2018-08-10T17:29:41Z")

</div>

Hai please use this method I tested this and it successfully worked

First generate an encrypted password  
Using

Python code for generating SHA512 password  
python -c “from passlib.hash import sha512\_crypt; import getpass; print  
sha512\_crypt.encrypt(getpass.getpass())”

And use

tasks:

- name: changing root password  
user:  
name: “root” ## Should not have “-”  
password:  
“$6$rounds=656000$XCYDmKM2Wh6LkAkf$2t/9L0OP4yJgy3wukrahPAM1qZG.SFNoe3eR53  
EqTq1t6.X.9YL78PJ2uje6dAp1Xxt8UqDe.kqj2/9F7bsvM/”

---

<div class="post-metadata">

**Author:** ![Jonathan\_Lozada\_De\_L](https://avatars.discourse-cdn.com/v4/letter/j/eb8c5e/32.png) [@Jonathan\_Lozada\_De\_L](https://forum.ansible.com/u/Jonathan_Lozada_De_L)\
**Post date:** [August 10, 2018, 5:30pm UTC](https://forum.ansible.com/t/ansible-command-on-messages/28309/6 "2018-08-10T17:30:48Z")

</div>

I think vault its a better option and integrates better.
