What OS are you running from?

-- Michael

On Nov 21, 2013, at 10:53 PM, Melissa Tan <m...@white-box.co> wrote:


On Thursday, 21 November 2013 17:02:55 UTC-8, Michael DeHaan wrote:
>
> "Instead of breaking right away, I ended up leaving for tea and found out
> it's hanging because it's expecting inputs."
>
> --ask-sudo-pass may be your friend here.
>
>
I did try an upgrade from 1.2 to 1.4 just in case there was an issue fixed
with a newer release.

$ ansible --version
ansible 1.4 (*devel 18b6372c63*) last updated 2013/11/21 15:05:57 (GMT -700)


I guess perhaps sudo would need to be setup differently for it to work,
like with the -u flag.  *A suggestion would be to include some more notes
in the documentation on how to setup sudo to play well with how Ansible is
executing the commands.* I can't look in the sudo config, but I believe the
sysadmins only setup the following commands for us to have only access to:

sudo su - [login]


If the following was used, a password prompt would come:

sudo su [login]

sudo -u ldapadm '[command]'


metan@xqa1prxy1$ sudo -u ldapadm 'ls'
Password:

metan@xqa1prxy1$ sudo su ldapadm
Password:

metan@xqa1prxy1$ sudo su - ldapadm
ldapadm@xqa1prxy1$



$ ansible --verbose -i /app/scripts/webadm/ansible/hosts  proxy -a "ls -l"
-U ldapadm --ask-sudo-pass
sudo password: Traceback (most recent call last):
  File "/app/scripts/webadm/ansible/version/ansible-1.4/bin/ansible", line
157, in <module>
    (runner, results) = cli.run(options, args)
  File "/app/scripts/webadm/ansible/version/ansible-1.4/bin/ansible", line
104, in run
    (sshpass, sudopass) = utils.ask_passwords(ask_pass=options.ask_pass,
ask_sudo_pass=options.ask_sudo_pass)
  File
"/app/scripts/webadm/ansible/version/ansible-1.4/lib/ansible/utils/__init__.py",
line 701, in ask_passwords
    sudopass = getpass.getpass(prompt=sudo_prompt)
  File "/usr/lib64/python2.6/getpass.py", line 71, in unix_getpass
    passwd = _raw_input(prompt, stream, input=input)
  File "/usr/lib64/python2.6/getpass.py", line 133, in _raw_input
    line = input.readline()
KeyboardInterrupt


So if ad-hoc commands won't work, I would have to see if a playbook can
send a series of commands without terminating the shell for it to run.  I'm
only a Day 2 Ansible user and trying to investigate how it works to see how
I can re-tool our scripts.  :)  I appreciate all the help thus so far.

$ ansible --verbose -i /app/scripts/webadm/ansible/customer-portal/hosts
 proxy -a "sudo su - ldapadm"
xqa1prxy2 | FAILED | rc=2 >>
[Errno 2] No such file or directory

xqa1prxy1 | FAILED | rc=2 >>
[Errno 2] No such file or directory


 --
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-project+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

-- 
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-project+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to