Unable to execute ansible playbook

1,271 views
Skip to first unread message

Ashok Reddy

unread,
Jul 7, 2022, 1:44:50 AM7/7/22
to Ansible Project
Hi all,

I got the following error, while trying to execute ansible playbook:

TASK [Gathering Facts] ************************************************************************************************************************************************************************************

fatal: [localhost]: UNREACHABLE! => {"changed": false, "msg": "Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p \"` echo /var/tmp `\"&& mkdir \"` echo /var/tmp/ansible-tmp-1657172514.8192306-2106-9375282374437 `\" && echo ansible-tmp-1657172514.8192306-2106-9375282374437=\"` echo /var/tmp/ansible-tmp-1657172514.8192306-2106-9375282374437 `\" ), exited with result 142, stdout output: Please login as the user \"cloud-user\" rather than the user \"root\".\n\n", "unreachable": true}


Prady A

unread,
Jul 7, 2022, 2:44:57 AM7/7/22
to ansible...@googlegroups.com
While executing the command provide -k option and provide the root password or
Authenticate your localhost.


--
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 ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/f2a0e03c-b35f-47ee-afa6-0a1f8b907005n%40googlegroups.com.

Abhijeet Kasurde

unread,
Jul 7, 2022, 3:05:03 AM7/7/22
to ansible...@googlegroups.com
This might give you a clue - stdout output: Please login as the user \"cloud-user\" rather than the user \"root\".\n\n"



--
Thanks,
Abhijeet Kasurde

Ashok Reddy

unread,
Jul 7, 2022, 3:58:37 AM7/7/22
to ansible...@googlegroups.com
But My playbook is available with root user. 

I am able to log in with cloud-user and then with sudo privileges as root, I have implemented a play book.  So that I can execute playbook with root privileges.

Ashok Reddy

unread,
Jul 7, 2022, 4:05:34 AM7/7/22
to ansible...@googlegroups.com
the same issue happens even I have provided with -K argument:

SSH password:


PLAY [default] ********************************************************************************************************************************************************************************************


TASK [Gathering Facts] ************************************************************************************************************************************************************************************

fatal: [localhost]: UNREACHABLE! => {"changed": false, "msg": "Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p \"` echo /var/tmp `\"&& mkdir \"` echo /var/tmp/ansible-tmp-1657181023.834322-2338-216353050127500 `\" && echo ansible-tmp-1657181023.834322-2338-216353050127500=\"` echo /var/tmp/ansible-tmp-1657181023.834322-2338-216353050127500 `\" ), exited with result 142, stdout output: Please login as the user \"cloud-user\" rather than the user \"root\".\n\n", "unreachable": true}


PLAY RECAP ************************************************************************************************************************************************************************************************

localhost                  : ok=0    changed=0    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0




On Thu, Jul 7, 2022 at 12:14 PM Prady A <pradyu...@gmail.com> wrote:

Stefan Hornburg (Racke)

unread,
Jul 7, 2022, 4:13:31 AM7/7/22
to ansible...@googlegroups.com
On 07/07/2022 10:05, Ashok Reddy wrote:
> the same issue happens even I have provided with -K argument:

You need to login as the cloud-user and use privilege escalation (https://docs.ansible.com/ansible/latest/user_guide/become.html) to execute the tasks as root user.

ansible_user: cloud-user
become: yes
become_method: sudo

Regards
Racke

>
> SSH password:
>
>
> PLAY [default] ********************************************************************************************************************************************************************************************
>
>
> TASK [Gathering Facts] ************************************************************************************************************************************************************************************
>
> fatal: [localhost]: UNREACHABLE! => {"changed": false, "msg": "Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p \"` echo /var/tmp `\"&& mkdir \"` echo /var/tmp/ansible-tmp-1657181023.834322-2338-216353050127500 `\" && echo ansible-tmp-1657181023.834322-2338-216353050127500=\"` echo /var/tmp/ansible-tmp-1657181023.834322-2338-216353050127500 `\" ), exited with result 142, stdout output: Please login as the user \"cloud-user\" rather than the user \"root\".\n\n", "unreachable": true}
>
>
> PLAY RECAP ************************************************************************************************************************************************************************************************
>
> localhost: ok=0changed=0unreachable=1failed=0skipped=0rescued=0ignored=0
>
>
>
>
> On Thu, Jul 7, 2022 at 12:14 PM Prady A <pradyu...@gmail.com <mailto:pradyu...@gmail.com>> wrote:
>
> While executing the command provide -k option and provide the root password or
> Authenticate your localhost.
>
>
> On Thu, Jul 7, 2022 at 14:44, Ashok Reddy <ashok...@gmail.com <mailto:ashok...@gmail.com>> wrote:
>
> Hi all,
>
> I got the following error, while trying to execute ansible playbook:
>
> TASK [Gathering Facts] ************************************************************************************************************************************************************************************
>
> fatal: [localhost]: UNREACHABLE! => {"changed": false, "msg": "Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p \"` echo /var/tmp `\"&& mkdir \"` echo /var/tmp/ansible-tmp-1657172514.8192306-2106-9375282374437 `\" && echo ansible-tmp-1657172514.8192306-2106-9375282374437=\"` echo /var/tmp/ansible-tmp-1657172514.8192306-2106-9375282374437 `\" ), exited with result 142, stdout output: Please login as the user \"cloud-user\" rather than the user \"root\".\n\n", "unreachable": true}
>
>
> --
> 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 ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/f2a0e03c-b35f-47ee-afa6-0a1f8b907005n%40googlegroups.com <https://groups.google.com/d/msgid/ansible-project/f2a0e03c-b35f-47ee-afa6-0a1f8b907005n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> 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 ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAEuB3Ap8rvefKQxLXiKkWLSJ2%2BNj%2Brk1SjZ%2Bx6SDFJMy%2Bc2Gqw%40mail.gmail.com <https://groups.google.com/d/msgid/ansible-project/CAEuB3Ap8rvefKQxLXiKkWLSJ2%2BNj%2Brk1SjZ%2Bx6SDFJMy%2Bc2Gqw%40mail.gmail.com?utm_medium=email&utm_source=footer>.
>
> --
> 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 ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAKRLcHjW%3DGa3VVyVKyrG07z8L2BDFewh31ZzYJMPQGjQZTvU6g%40mail.gmail.com <https://groups.google.com/d/msgid/ansible-project/CAKRLcHjW%3DGa3VVyVKyrG07z8L2BDFewh31ZzYJMPQGjQZTvU6g%40mail.gmail.com?utm_medium=email&utm_source=footer>.


--
Automation expert - Ansible and friends
Linux administrator & Debian maintainer
Perl Dancer & conference hopper

Ashok Reddy

unread,
Jul 7, 2022, 5:49:04 AM7/7/22
to ansible...@googlegroups.com

- hosts: default

  ansible_user: cloud-user

  become: yes

  become_method: sudo

  gather_facts: true


Error:

ERROR! 'ansible_user' is not a valid attribute for a Play


The error appears to be in '/root/modsec-compile.yml': line 2, column 3, but may

be elsewhere in the file depending on the exact syntax problem.


The offending line appears to be:


---

- hosts: default

  ^ here



To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a65055de-28a1-4cee-be35-5d8de90bbc81%40linuxia.de.

Stefan Hornburg (Racke)

unread,
Jul 7, 2022, 6:17:53 AM7/7/22
to ansible...@googlegroups.com
On 07/07/2022 11:48, Ashok Reddy wrote:
> - hosts: default
>
> ansible_user: cloud-user
>
> become: yes
>
> become_method: sudo
>
> gather_facts: true
>
>
> Error:
>
> ERROR! 'ansible_user' is not a valid attribute for a Play

Hello,

the ansible_user needs to be set in the inventory.

Regards
Racke

>
> The error appears to be in '/root/modsec-compile.yml': line 2, column 3, but may
>
> be elsewhere in the file depending on the exact syntax problem.
>
>
> The offending line appears to be:
>
>
> ---
>
> - hosts: default
>
> ^ here
>
>
>
> On Thu, Jul 7, 2022 at 1:43 PM Stefan Hornburg (Racke) <ra...@linuxia.de <mailto:ra...@linuxia.de>> wrote:
>
> On 07/07/2022 10:05, Ashok Reddy wrote:
> > the same issue happens even I have provided with -K argument:
>
> You need to login as the cloud-user and use privilege escalation (https://docs.ansible.com/ansible/latest/user_guide/become.html <https://docs.ansible.com/ansible/latest/user_guide/become.html>) to execute the tasks as root user.
>
> ansible_user: cloud-user
> become: yes
> become_method: sudo
>
> Regards
>           Racke
>
> >
> > SSH password:
> >
> >
> > PLAY [default] ********************************************************************************************************************************************************************************************
> >
> >
> > TASK [Gathering Facts] ************************************************************************************************************************************************************************************
> >
> > fatal: [localhost]: UNREACHABLE! => {"changed": false, "msg": "Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p \"` echo /var/tmp `\"&& mkdir \"` echo /var/tmp/ansible-tmp-1657181023.834322-2338-216353050127500 `\" && echo ansible-tmp-1657181023.834322-2338-216353050127500=\"` echo /var/tmp/ansible-tmp-1657181023.834322-2338-216353050127500 `\" ), exited with result 142, stdout output: Please login as the user \"cloud-user\" rather than the user \"root\".\n\n", "unreachable": true}
> >
> >
> > PLAY RECAP ************************************************************************************************************************************************************************************************
> >
> > localhost: ok=0changed=0unreachable=1failed=0skipped=0rescued=0ignored=0
> >
> >
> >
> >
> > On Thu, Jul 7, 2022 at 12:14 PM Prady A <pradyu...@gmail.com <mailto:pradyu...@gmail.com> <mailto:pradyu...@gmail.com <mailto:pradyu...@gmail.com>>> wrote:
> >
> >     While executing the command provide -k option and provide the root password or
> >     Authenticate your localhost.
> >
> >
> >     On Thu, Jul 7, 2022 at 14:44, Ashok Reddy <ashok...@gmail.com <mailto:ashok...@gmail.com> <mailto:ashok...@gmail.com <mailto:ashok...@gmail.com>>> wrote:
> >
> >         Hi all,
> >
> >         I got the following error, while trying to execute ansible playbook:
> >
> >         TASK [Gathering Facts] ************************************************************************************************************************************************************************************
> >
> >         fatal: [localhost]: UNREACHABLE! => {"changed": false, "msg": "Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p \"` echo /var/tmp `\"&& mkdir \"` echo /var/tmp/ansible-tmp-1657172514.8192306-2106-9375282374437 `\" && echo ansible-tmp-1657172514.8192306-2106-9375282374437=\"` echo /var/tmp/ansible-tmp-1657172514.8192306-2106-9375282374437 `\" ), exited with result 142, stdout output: Please login as the user \"cloud-user\" rather than the user \"root\".\n\n", "unreachable": true}
> >
> >
> >         --
> >         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 ansible-proje...@googlegroups.com <mailto:ansible-project%2Bunsu...@googlegroups.com> <mailto:ansible-proje...@googlegroups.com <mailto:ansible-project%2Bunsu...@googlegroups.com>>.
> >         To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/f2a0e03c-b35f-47ee-afa6-0a1f8b907005n%40googlegroups.com <https://groups.google.com/d/msgid/ansible-project/f2a0e03c-b35f-47ee-afa6-0a1f8b907005n%40googlegroups.com> <https://groups.google.com/d/msgid/ansible-project/f2a0e03c-b35f-47ee-afa6-0a1f8b907005n%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/ansible-project/f2a0e03c-b35f-47ee-afa6-0a1f8b907005n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
> >
> >     --
> >     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 ansible-proje...@googlegroups.com <mailto:ansible-project%2Bunsu...@googlegroups.com> <mailto:ansible-proje...@googlegroups.com <mailto:ansible-project%2Bunsu...@googlegroups.com>>.
> >     To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAEuB3Ap8rvefKQxLXiKkWLSJ2%2BNj%2Brk1SjZ%2Bx6SDFJMy%2Bc2Gqw%40mail.gmail.com <https://groups.google.com/d/msgid/ansible-project/CAEuB3Ap8rvefKQxLXiKkWLSJ2%2BNj%2Brk1SjZ%2Bx6SDFJMy%2Bc2Gqw%40mail.gmail.com> <https://groups.google.com/d/msgid/ansible-project/CAEuB3Ap8rvefKQxLXiKkWLSJ2%2BNj%2Brk1SjZ%2Bx6SDFJMy%2Bc2Gqw%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/ansible-project/CAEuB3Ap8rvefKQxLXiKkWLSJ2%2BNj%2Brk1SjZ%2Bx6SDFJMy%2Bc2Gqw%40mail.gmail.com?utm_medium=email&utm_source=footer>>.
> >
> > --
> > 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 ansible-proje...@googlegroups.com <mailto:ansible-project%2Bunsu...@googlegroups.com> <mailto:ansible-proje...@googlegroups.com <mailto:ansible-project%2Bunsu...@googlegroups.com>>.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAKRLcHjW%3DGa3VVyVKyrG07z8L2BDFewh31ZzYJMPQGjQZTvU6g%40mail.gmail.com <https://groups.google.com/d/msgid/ansible-project/CAKRLcHjW%3DGa3VVyVKyrG07z8L2BDFewh31ZzYJMPQGjQZTvU6g%40mail.gmail.com> <https://groups.google.com/d/msgid/ansible-project/CAKRLcHjW%3DGa3VVyVKyrG07z8L2BDFewh31ZzYJMPQGjQZTvU6g%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/ansible-project/CAKRLcHjW%3DGa3VVyVKyrG07z8L2BDFewh31ZzYJMPQGjQZTvU6g%40mail.gmail.com?utm_medium=email&utm_source=footer>>.
>
>
> --
> Automation expert - Ansible and friends
> Linux administrator & Debian maintainer
> Perl Dancer & conference hopper
>
> --
> 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 ansible-proje...@googlegroups.com <mailto:ansible-project%2Bunsu...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a65055de-28a1-4cee-be35-5d8de90bbc81%40linuxia.de <https://groups.google.com/d/msgid/ansible-project/a65055de-28a1-4cee-be35-5d8de90bbc81%40linuxia.de>.
>
> --
> 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 ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAKRLcHhm78xq7BdvyiczW4bi6cML38pExOiODuER_7yxMbR_tQ%40mail.gmail.com <https://groups.google.com/d/msgid/ansible-project/CAKRLcHhm78xq7BdvyiczW4bi6cML38pExOiODuER_7yxMbR_tQ%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Ashok Reddy

unread,
Jul 7, 2022, 6:50:32 AM7/7/22
to ansible...@googlegroups.com

cat hosts

[default]

localhost

ansible_user=cloud-user


odsec-test ~]# vi hosts

[root@modsec-test ~]# ansible-playbook -i ./hosts modsec-compile.yml --private-key nonprod


PLAY [default] ********************************************************************************************************************************************************************************************


TASK [Gathering Facts] ************************************************************************************************************************************************************************************

fatal: [ansible_user=cloud-user]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: Could not resolve hostname ansible_user=cloud-user: Name or service not known", "unreachable": true}

fatal: [localhost]: UNREACHABLE! => {"changed": false, "msg": "Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p \"` echo Please login as the user \"cloud-user\" rather than the user \"root\"./.ansible/tmp `\"&& mkdir \"` echo Please login as the user \"cloud-user\" rather than the user \"root\"./.ansible/tmp/ansible-tmp-1657190959.6394126-3019-148910985051576 `\" && echo ansible-tmp-1657190959.6394126-3019-148910985051576=\"` echo Please login as the user \"cloud-user\" rather than the user \"root\"./.ansible/tmp/ansible-tmp-1657190959.6394126-3019-148910985051576 `\" ), exited with result 142, stdout output: Please login as the user \"cloud-user\" rather than the user \"root\".\n\n", "unreachable": true}


PLAY RECAP ************************************************************************************************************************************************************************************************

ansible_user=cloud-user    : ok=0    changed=0    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0

localhost                  : ok=0    changed=0    unreachable=1    failed=0    skipped=0    rescued=0    ignored=0


To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/82d67549-add1-7949-9f03-299b95e6a1cd%40linuxia.de.

Stefan Hornburg (Racke)

unread,
Jul 7, 2022, 6:54:33 AM7/7/22
to ansible...@googlegroups.com
On 07/07/2022 12:50, Ashok Reddy wrote:
> cat hosts
>
> [default]
>
> localhost
>
> ansible_user=cloud-user
>

[default]
localhost ansible_user=cloud-user

Regards
Racke

>
> odsec-test ~]# vi hosts
>
> [root@modsec-test ~]# ansible-playbook -i ./hosts modsec-compile.yml --private-key nonprod
>
>
> PLAY [default] ********************************************************************************************************************************************************************************************
>
>
> TASK [Gathering Facts] ************************************************************************************************************************************************************************************
>
> fatal: [ansible_user=cloud-user]: UNREACHABLE! => {"changed": false, "msg": "Failed to connect to the host via ssh: ssh: Could not resolve hostname ansible_user=cloud-user: Name or service not known", "unreachable": true}
>
> fatal: [localhost]: UNREACHABLE! => {"changed": false, "msg": "Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p \"` echo Please login as the user \"cloud-user\" rather than the user \"root\"./.ansible/tmp `\"&& mkdir \"` echo Please login as the user \"cloud-user\" rather than the user \"root\"./.ansible/tmp/ansible-tmp-1657190959.6394126-3019-148910985051576 `\" && echo ansible-tmp-1657190959.6394126-3019-148910985051576=\"` echo Please login as the user \"cloud-user\" rather than the user \"root\"./.ansible/tmp/ansible-tmp-1657190959.6394126-3019-148910985051576 `\" ), exited with result 142, stdout output: Please login as the user \"cloud-user\" rather than the user \"root\".\n\n", "unreachable": true}
>
>
> PLAY RECAP ************************************************************************************************************************************************************************************************
>
> ansible_user=cloud-user: ok=0changed=0unreachable=1failed=0skipped=0rescued=0ignored=0
>
> localhost: ok=0changed=0unreachable=1failed=0skipped=0rescued=0ignored=0
>
>
>
> On Thu, Jul 7, 2022 at 3:47 PM Stefan Hornburg (Racke) <ra...@linuxia.de <mailto:ra...@linuxia.de>> wrote:
>
> On 07/07/2022 11:48, Ashok Reddy wrote:
> > - hosts: default
> >
> > ansible_user: cloud-user
> >
> > become: yes
> >
> > become_method: sudo
> >
> > gather_facts: true
> >
> >
> > Error:
> >
> > ERROR! 'ansible_user' is not a valid attribute for a Play
>
> Hello,
>
> the ansible_user needs to be set in the inventory.
>
> Regards
>          Racke
>
> >
> > The error appears to be in '/root/modsec-compile.yml': line 2, column 3, but may
> >
> > be elsewhere in the file depending on the exact syntax problem.
> >
> >
> > The offending line appears to be:
> >
> >
> > ---
> >
> > - hosts: default
> >
> > ^ here
> >
> >
> >
> > On Thu, Jul 7, 2022 at 1:43 PM Stefan Hornburg (Racke) <ra...@linuxia.de <mailto:ra...@linuxia.de> <mailto:ra...@linuxia.de <mailto:ra...@linuxia.de>>> wrote:
> >
> >     On 07/07/2022 10:05, Ashok Reddy wrote:
> >      > the same issue happens even I have provided with -K argument:
> >
> >     You need to login as the cloud-user and use privilege escalation (https://docs.ansible.com/ansible/latest/user_guide/become.html <https://docs.ansible.com/ansible/latest/user_guide/become.html> <https://docs.ansible.com/ansible/latest/user_guide/become.html <https://docs.ansible.com/ansible/latest/user_guide/become.html>>) to execute the tasks as root user.
> >
> >     ansible_user: cloud-user
> >     become: yes
> >     become_method: sudo
> >
> >     Regards
> >                Racke
> >
> >      >
> >      > SSH password:
> >      >
> >      >
> >      > PLAY [default] ********************************************************************************************************************************************************************************************
> >      >
> >      >
> >      > TASK [Gathering Facts] ************************************************************************************************************************************************************************************
> >      >
> >      > fatal: [localhost]: UNREACHABLE! => {"changed": false, "msg": "Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p \"` echo /var/tmp `\"&& mkdir \"` echo /var/tmp/ansible-tmp-1657181023.834322-2338-216353050127500 `\" && echo ansible-tmp-1657181023.834322-2338-216353050127500=\"` echo /var/tmp/ansible-tmp-1657181023.834322-2338-216353050127500 `\" ), exited with result 142, stdout output: Please login as the user \"cloud-user\" rather than the user \"root\".\n\n", "unreachable": true}
> >      >
> >      >
> >      > PLAY RECAP ************************************************************************************************************************************************************************************************
> >      >
> >      > localhost: ok=0changed=0unreachable=1failed=0skipped=0rescued=0ignored=0
> >      >
> >      >
> >      >
> >      >
> >      > On Thu, Jul 7, 2022 at 12:14 PM Prady A <pradyu...@gmail.com <mailto:pradyu...@gmail.com> <mailto:pradyu...@gmail.com <mailto:pradyu...@gmail.com>> <mailto:pradyu...@gmail.com <mailto:pradyu...@gmail.com> <mailto:pradyu...@gmail.com <mailto:pradyu...@gmail.com>>>> wrote:
> >      >
> >      >     While executing the command provide -k option and provide the root password or
> >      >     Authenticate your localhost.
> >      >
> >      >
> >      >     On Thu, Jul 7, 2022 at 14:44, Ashok Reddy <ashok...@gmail.com <mailto:ashok...@gmail.com> <mailto:ashok...@gmail.com <mailto:ashok...@gmail.com>> <mailto:ashok...@gmail.com <mailto:ashok...@gmail.com> <mailto:ashok...@gmail.com <mailto:ashok...@gmail.com>>>> wrote:
> >      >
> >      >         Hi all,
> >      >
> >      >         I got the following error, while trying to execute ansible playbook:
> >      >
> >      >         TASK [Gathering Facts] ************************************************************************************************************************************************************************************
> >      >
> >      >         fatal: [localhost]: UNREACHABLE! => {"changed": false, "msg": "Failed to create temporary directory.In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p \"` echo /var/tmp `\"&& mkdir \"` echo /var/tmp/ansible-tmp-1657172514.8192306-2106-9375282374437 `\" && echo ansible-tmp-1657172514.8192306-2106-9375282374437=\"` echo /var/tmp/ansible-tmp-1657172514.8192306-2106-9375282374437 `\" ), exited with result 142, stdout output: Please login as the user \"cloud-user\" rather than the user \"root\".\n\n", "unreachable": true}
> >      >
> >      >
> >      >         --
> >      >         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 ansible-proje...@googlegroups.com <mailto:ansible-project%2Bunsu...@googlegroups.com> <mailto:ansible-project%2Bunsu...@googlegroups.com <mailto:ansible-project%252Buns...@googlegroups.com>> <mailto:ansible-proje...@googlegroups.com <mailto:ansible-project%2Bunsu...@googlegroups.com> <mailto:ansible-project%2Bunsu...@googlegroups.com <mailto:ansible-project%252Buns...@googlegroups.com>>>.
> >      >         To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/f2a0e03c-b35f-47ee-afa6-0a1f8b907005n%40googlegroups.com <https://groups.google.com/d/msgid/ansible-project/f2a0e03c-b35f-47ee-afa6-0a1f8b907005n%40googlegroups.com> <https://groups.google.com/d/msgid/ansible-project/f2a0e03c-b35f-47ee-afa6-0a1f8b907005n%40googlegroups.com <https://groups.google.com/d/msgid/ansible-project/f2a0e03c-b35f-47ee-afa6-0a1f8b907005n%40googlegroups.com>> <https://groups.google.com/d/msgid/ansible-project/f2a0e03c-b35f-47ee-afa6-0a1f8b907005n%40googlegroups.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/ansible-project/f2a0e03c-b35f-47ee-afa6-0a1f8b907005n%40googlegroups.com?utm_medium=email&utm_source=footer> <https://groups.google.com/d/msgid/ansible-project/f2a0e03c-b35f-47ee-afa6-0a1f8b907005n%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/ansible-project/f2a0e03c-b35f-47ee-afa6-0a1f8b907005n%40googlegroups.com?utm_medium=email&utm_source=footer>>>.
> >      >
> >      >     --
> >      >     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 ansible-proje...@googlegroups.com <mailto:ansible-project%2Bunsu...@googlegroups.com> <mailto:ansible-project%2Bunsu...@googlegroups.com <mailto:ansible-project%252Buns...@googlegroups.com>> <mailto:ansible-proje...@googlegroups.com <mailto:ansible-project%2Bunsu...@googlegroups.com> <mailto:ansible-project%2Bunsu...@googlegroups.com <mailto:ansible-project%252Buns...@googlegroups.com>>>.
> >      >     To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAEuB3Ap8rvefKQxLXiKkWLSJ2%2BNj%2Brk1SjZ%2Bx6SDFJMy%2Bc2Gqw%40mail.gmail.com <https://groups.google.com/d/msgid/ansible-project/CAEuB3Ap8rvefKQxLXiKkWLSJ2%2BNj%2Brk1SjZ%2Bx6SDFJMy%2Bc2Gqw%40mail.gmail.com> <https://groups.google.com/d/msgid/ansible-project/CAEuB3Ap8rvefKQxLXiKkWLSJ2%2BNj%2Brk1SjZ%2Bx6SDFJMy%2Bc2Gqw%40mail.gmail.com <https://groups.google.com/d/msgid/ansible-project/CAEuB3Ap8rvefKQxLXiKkWLSJ2%2BNj%2Brk1SjZ%2Bx6SDFJMy%2Bc2Gqw%40mail.gmail.com>> <https://groups.google.com/d/msgid/ansible-project/CAEuB3Ap8rvefKQxLXiKkWLSJ2%2BNj%2Brk1SjZ%2Bx6SDFJMy%2Bc2Gqw%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/ansible-project/CAEuB3Ap8rvefKQxLXiKkWLSJ2%2BNj%2Brk1SjZ%2Bx6SDFJMy%2Bc2Gqw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> >      > To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com <mailto:ansible-project%2Bunsu...@googlegroups.com> <mailto:ansible-project%2Bunsu...@googlegroups.com <mailto:ansible-project%252Buns...@googlegroups.com>> <mailto:ansible-proje...@googlegroups.com <mailto:ansible-project%2Bunsu...@googlegroups.com> <mailto:ansible-project%2Bunsu...@googlegroups.com <mailto:ansible-project%252Buns...@googlegroups.com>>>.
> >      > To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAKRLcHjW%3DGa3VVyVKyrG07z8L2BDFewh31ZzYJMPQGjQZTvU6g%40mail.gmail.com <https://groups.google.com/d/msgid/ansible-project/CAKRLcHjW%3DGa3VVyVKyrG07z8L2BDFewh31ZzYJMPQGjQZTvU6g%40mail.gmail.com> <https://groups.google.com/d/msgid/ansible-project/CAKRLcHjW%3DGa3VVyVKyrG07z8L2BDFewh31ZzYJMPQGjQZTvU6g%40mail.gmail.com <https://groups.google.com/d/msgid/ansible-project/CAKRLcHjW%3DGa3VVyVKyrG07z8L2BDFewh31ZzYJMPQGjQZTvU6g%40mail.gmail.com>> <https://groups.google.com/d/msgid/ansible-project/CAKRLcHjW%3DGa3VVyVKyrG07z8L2BDFewh31ZzYJMPQGjQZTvU6g%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/ansible-project/CAKRLcHjW%3DGa3VVyVKyrG07z8L2BDFewh31ZzYJMPQGjQZTvU6g%40mail.gmail.com?utm_medium=email&utm_source=footer>
> <https://groups.google.com/d/msgid/ansible-project/CAKRLcHjW%3DGa3VVyVKyrG07z8L2BDFewh31ZzYJMPQGjQZTvU6g%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/ansible-project/CAKRLcHjW%3DGa3VVyVKyrG07z8L2BDFewh31ZzYJMPQGjQZTvU6g%40mail.gmail.com?utm_medium=email&utm_source=footer>>>.
> >
> >
> >     --
> >     Automation expert - Ansible and friends
> >     Linux administrator & Debian maintainer
> >     Perl Dancer & conference hopper
> >
> >     --
> >     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 ansible-proje...@googlegroups.com <mailto:ansible-project%2Bunsu...@googlegroups.com> <mailto:ansible-project%2Bunsu...@googlegroups.com <mailto:ansible-project%252Buns...@googlegroups.com>>.
> >     To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/a65055de-28a1-4cee-be35-5d8de90bbc81%40linuxia.de <https://groups.google.com/d/msgid/ansible-project/a65055de-28a1-4cee-be35-5d8de90bbc81%40linuxia.de> <https://groups.google.com/d/msgid/ansible-project/a65055de-28a1-4cee-be35-5d8de90bbc81%40linuxia.de <https://groups.google.com/d/msgid/ansible-project/a65055de-28a1-4cee-be35-5d8de90bbc81%40linuxia.de>>.
> >
> > --
> > 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 ansible-proje...@googlegroups.com <mailto:ansible-project%2Bunsu...@googlegroups.com> <mailto:ansible-proje...@googlegroups.com <mailto:ansible-project%2Bunsu...@googlegroups.com>>.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAKRLcHhm78xq7BdvyiczW4bi6cML38pExOiODuER_7yxMbR_tQ%40mail.gmail.com <https://groups.google.com/d/msgid/ansible-project/CAKRLcHhm78xq7BdvyiczW4bi6cML38pExOiODuER_7yxMbR_tQ%40mail.gmail.com> <https://groups.google.com/d/msgid/ansible-project/CAKRLcHhm78xq7BdvyiczW4bi6cML38pExOiODuER_7yxMbR_tQ%40mail.gmail.com?utm_medium=email&utm_source=footer <https://groups.google.com/d/msgid/ansible-project/CAKRLcHhm78xq7BdvyiczW4bi6cML38pExOiODuER_7yxMbR_tQ%40mail.gmail.com?utm_medium=email&utm_source=footer>>.
>
>
> --
> Automation expert - Ansible and friends
> Linux administrator & Debian maintainer
> Perl Dancer & conference hopper
>
> --
> 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 ansible-proje...@googlegroups.com <mailto:ansible-project%2Bunsu...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/82d67549-add1-7949-9f03-299b95e6a1cd%40linuxia.de <https://groups.google.com/d/msgid/ansible-project/82d67549-add1-7949-9f03-299b95e6a1cd%40linuxia.de>.
>
> --
> 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 ansible-proje...@googlegroups.com <mailto:ansible-proje...@googlegroups.com>.
> To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAKRLcHgYaHMp%2B15jZsVP%2BjRODHiRabomDjbb_%3DdAj4xrepTy5w%40mail.gmail.com <https://groups.google.com/d/msgid/ansible-project/CAKRLcHgYaHMp%2B15jZsVP%2BjRODHiRabomDjbb_%3DdAj4xrepTy5w%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Ashok Reddy

unread,
Jul 7, 2022, 7:10:58 AM7/7/22
to ansible...@googlegroups.com
It works. Thanks Racke.

To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/8dee191d-bc3d-11fc-7f59-1767e9edfe86%40linuxia.de.
Reply all
Reply to author
Forward
0 new messages