Hello.
I have ansible 1.9.2 running [elementary OS], the task is simple I want to
copy a file named file1.txt on a remote node [debian Jessie] PATH =
/root/file1.txt
I sucesfully ssh without using a text password from my elemtary OS to my
debian Jessie [ ssh -l debian gateway.linux.rocks ]
File : motd/tasks/main.yml
- name: copy a file
copy: src=file1.txt dest=/root/file1.txt owner=root mode=0600
tags:
- simple
I have groups_vars/servers definition for this node as
---
ansible_ssh_user: debian
So the user to ssh is debian.
Under my site.yml I have
---
- name: apply common configuration to servers nodes
hosts: servers
roles:
- { role: motd, sudo: yes }
The role named is motd and I set to used sudo:yes, the user on the remote
is debian with has sudo priv's.
I also test to defined the role as
- { role: easy, become: yes, become_method: sudo }
Anyway, running triggers
ansible-playbook site.yml -t simple
The -t simple is I just simple created a tag.
TASK: [motd | copy a file]
****************************************************
fatal: [gateway.linux.rocks] => Missing become password
FATAL: all hosts have already failed -- aborting
Question 1. To be able to do this I need to add a line like debian
ALL=(ALL) NOPASSWD:ALL to the sudoers on the remote host called
gateway.linux.rocks [debian Jessie]
Question 2. If I Run ansible-playbook site.yml -t simple -K || Ask me for
SUDO password: enter the correct one, the task run sucesfully, but debian
the user on the remote [debian Jessie hostname = gateway.linux.rocks] is
member of sudo. So I don't understand.
Thanks in advance.
--
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/d8510672-3e9b-4938-8314-4e56b9aca0ba%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.