Re: [ansible-project] Looping over directories instead of files ?

2016-01-21 Thread Christophe Meessen
In fact it is still not right. The correct loop instruction is with_lines: find /home/git/*.git -type d -maxdepth 0 This will make one iteration per command output line and assign it to item. -- You received this message because you are subscribed to the Google Groups "Ansible Project"

Re: [ansible-project] Looping over directories instead of files ?

2016-01-21 Thread Brian Coca
if you only want the .gits: with_lines: find /home/git/ -name '*.git' -type d -maxdepth 0 -- Brian Coca -- 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

Re: [ansible-project] How to get real time output from ansible-playbook process when called in PHP?

2016-01-21 Thread Sally Paner
Hi Brian; Thanks for the reply. I am just wondering that if I run ansible-playbook directly on the command line, it gives me real-time output, but if called from PHP it seems that ansible-playbook waits to finish the playbook before it returns any output. On Wednesday, January 20, 2016 at

Re: [ansible-project] Getting pieces from a list with ansible

2016-01-21 Thread Dan C
Hi again, So, it is not possible to get a "variable" piece of a "variable" list? What I need is to maintain a fixed number of objects in a storage, I want to have always only the "last X" objects and delete all the rest. Is there any other way to do so? >> -- You received this message

[ansible-project] Re: synchronize complains that it needs a password to do a sudo

2016-01-21 Thread Christophe Meessen
I get the same error message even if I add rsync_path="rsync" to the synchronize action. So I don't see who is trying to do a sudo and where (locally or remotely). The error persist even if I do a local "sudo rsync" just to give the root password. -- You received this message because you are

[ansible-project] Conditional check not working since upgrading to v.2.0.0.2

2016-01-21 Thread Edd Grant
Hi all, Since upgrading to Ansible 2.0.0.2 the following code has stopped working: - include: redhat-hosts.yml when: ansible_os_family == 'RedHat' This results in the error: ERROR! The conditional check 'ansible_os_family == 'RedHat'' failed. The error was: ERROR! error while evaluating

[ansible-project] Re: How to get item by item from the item.stdout so you can execute a command for each item on the item.stdout.

2016-01-21 Thread santosh reddy
Hi Esteban, Were you able to find a solution for this, even i'm having the same problem. I'm using ansible 2.0.0.2 but couldn't find a solution to this. Thanks, Santosh On Wednesday, 8 July 2015 20:01:46 UTC+5:30, Esteban Freire wrote: > > Hi Tom, all > > I had a typo on my main

[ansible-project] Ansible Tower - win_feature failure

2016-01-21 Thread Mark Matthews
I am trying to run a simple job to install IIS using Ansible Tower playbook --- # This playbook installs and enables IIS on Windows hosts - name: Install IIS hosts: all gather_facts: false tasks: - name: Install IIS win_feature: name: "Web-Server" state: present restart: yes include_sub_features:

Re: [ansible-project] How to get real time output from ansible-playbook process when called in PHP?

2016-01-21 Thread Brian Coca
you are probably buffering the output in php On Thu, Jan 21, 2016 at 6:36 AM, Sally Paner wrote: > Hi Brian; > > > Thanks for the reply. I am just wondering that if I run ansible-playbook > directly on the command line, it gives me real-time output, but if called > from PHP it

Re: [ansible-project] Roles directory not found anymore in Ansible 2

2016-01-21 Thread Petri Lehtinen
Ah, setting roles_path = roles in the correct section did the trick. Thanks a lot! Petri On Tuesday, January 19, 2016 at 3:54:31 PM UTC+2, Matt Martz wrote: > > I'm unsure about a change in the search paths, however on a slightly > different topic, the section in ansible.cfg is [defaults]

Re: [ansible-project] Changing actions in case a node fails

2016-01-21 Thread Dan C
Hi there, For anyone interest and to close this thread. I reported the bug and it is already solved! https://github.com/ansible/ansible/issues/14024 Now In case of any host fail it will execute rescue to all of them! (devel branch only). What a great feature!!! Thanks James! > -- You

[ansible-project] Re: synchronize complains that it needs a password to do a sudo

2016-01-21 Thread Christophe Meessen
I changed the find instruction to a more correct one, but the synchronize still fails because some sudo requires a password. This is the instruction I used. with_lines: find /home/git/ -maxdepth 1 -name "*.git" -type d -- You received this message because you are subscribed to the Google

Re: [ansible-project] Ansible-Vault Error: Unexpected Exception: integer division or modulo by zero

2016-01-21 Thread Brian Coca
what version are you using? there was a bug that caused this but it has been fixed. Also output with - would be helfpul -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving

Re: [ansible-project] Looping over directories instead of files ?

2016-01-21 Thread Christophe Meessen
Yes I only want the .git. Indeed your way to invoke find is more correct. However it still need a change to work on my Ubuntu computer. This one worked. find /home/git/ -maxdepth 1 -name "*.git" -type d The maxdepth option should be moved to front and its value should be 1. Your way to

[ansible-project] Re: synchronize complains that it needs a password to do a sudo

2016-01-21 Thread Christophe Meessen
I finally fixed the problem after reading the doc on synchronize. I found the following note: The user and permissions for the synchronize src are those of the user > running the Ansible task on the local host, or the become_user if become: > yes is active. synchronize will attempt to

[ansible-project] Ansible-Vault Error: Unexpected Exception: integer division or modulo by zero

2016-01-21 Thread Victor Keenan
When creating an Ansible vault with: ansible-vault create test.yml I receive the following error: Unexpected Exception: integer division or modulo by zero Does anyone have any tips on resolving this? Thanks for the help in advance! -- You received this message because you are subscribed

Re: [ansible-project] Ansible-Vault Error: Unexpected Exception: integer division or modulo by zero

2016-01-21 Thread Victor Keenan
Also, I'm on Mac OS 10.11.3 running Python 2.7.10. On Thursday, January 21, 2016 at 10:28:23 AM UTC-5, Victor Keenan wrote: > > Thanks Brian for the help! I'm using ansible 2.1.0 (devel 5e18bc5955). My > - output is... > > Unexpected Exception: integer division or modulo by zero > the full

Re: [ansible-project] Ansible-Vault Error: Unexpected Exception: integer division or modulo by zero

2016-01-21 Thread Victor Keenan
Thanks Brian for the help! I'm using ansible 2.1.0 (devel 5e18bc5955). My - output is... Unexpected Exception: integer division or modulo by zero the full traceback was: Traceback (most recent call last): File "/Users/VictorSK/ansible/bin/ansible-vault", line 85, in

[ansible-project] Re: synchronize complains that it needs a password to do a sudo

2016-01-21 Thread Christophe Meessen
I forgot the solution. Here it is: - name: Restore repositories synchronize: src="{{ item }}" dest="/home/git" with_lines: find /home/git/ -maxdepth 1 -name "*.git" -type d become: no tags: restore This will attempt a synchronize by executing the rsync as the user who executes the

Re: [ansible-project] Ansible-Vault Error: Unexpected Exception: integer division or modulo by zero

2016-01-21 Thread Brian Coca
fixed via http://github.com/ansible/ansible/commit/f26adcc7da7f8e6605167203249648f7b0e74fb7 On Thu, Jan 21, 2016 at 10:28 AM, Victor Keenan wrote: > Thanks Brian for the help! I'm using ansible 2.1.0 (devel 5e18bc5955). My > - output is... > > Unexpected Exception:

Re: [ansible-project] Conditional check not working since upgrading to v.2.0.0.2

2016-01-21 Thread Edd Grant
Hi Brian, I was gathering facts when using Ansible 1.9.x and have done nothing to disable it since upgrading to 2.x. (Unless 2.x disables it by default and I've not noticed that in the docs?) Cheers, Edd On 21 January 2016 at 13:58, Brian Coca wrote: > are you gathering

Re: [ansible-project] Ansible-Vault Error: Unexpected Exception: integer division or modulo by zero

2016-01-21 Thread Brian Coca
I cannot reproduce this ... but I'm on linux ... On Thu, Jan 21, 2016 at 11:09 AM, Victor Keenan wrote: > No, I'm trying to create a new file/vault. Here is what I'm entering and the > output... > > local ...pment/Ansible_Playbooks/server_lepr/vars(master) $ ls -an > total 0

Re: [ansible-project] Re: synchronize complains that it needs a password to do a sudo

2016-01-21 Thread Toshio Kuratomi
On Thu, Jan 21, 2016 at 7:25 AM, Christophe Meessen wrote: > > It should be possible to define a local identity change and a remote > identity as the ssh user identity (ansible_user?) and authentication method. > The hack made by synchronize about this is really

Re: [ansible-project] Conditional check not working since upgrading to v.2.0.0.2

2016-01-21 Thread Brian Coca
no, facts should be gathered as normal, can you put in the following task before the problem? - debug: var=hostvars[inventory_hostname] On Thu, Jan 21, 2016 at 11:16 AM, Edd Grant wrote: > Hi Brian, > > I was gathering facts when using Ansible 1.9.x and have done nothing to >

Re: [ansible-project] Re: synchronize complains that it needs a password to do a sudo

2016-01-21 Thread Christophe Meessen
Thank you very much for fixing this. In most uses cases it works provided become is set to no. It might still be useful to change the local user identity when synchronizing, but the way to do it seem to be lacking in the current interface. Thank you very much for the synchronize module. It is a

Re: [ansible-project] Ansible-Vault Error: Unexpected Exception: integer division or modulo by zero

2016-01-21 Thread Victor Keenan
It works on Ubuntu for me too. Just not on Mac OS X. On Thursday, January 21, 2016 at 11:40:49 AM UTC-5, Brian Coca wrote: > > I cannot reproduce this ... but I'm on linux ... > > On Thu, Jan 21, 2016 at 11:09 AM, Victor Keenan > wrote: > > No, I'm trying to create a new

[ansible-project] Re: AWS vpc creation problem on Mac OS X

2016-01-21 Thread Arbab Nazar
@Brain, your valuable feedback here please? On Tuesday, January 19, 2016 at 1:21:25 PM UTC+5, Arbab Nazar wrote: > > Hi, > > I have a problem while creating aws vpc from mac os x but the exact same > command/role is working from ubuntu. > > Steps that I have already taken on Mac OS X: > > -

Re: [ansible-project] Ansible-Vault Error: Unexpected Exception: integer division or modulo by zero

2016-01-21 Thread Matt Martz
What contents are you putting in the vault file? I can get this to happen if I put nothing in the file. In which case the following is the cause: File "/Users/matt/python_venvs/ansibledev/ansible/lib/ansible/parsing/vault/__init__.py", line 249, in _shred_file_custom for _ in range(0,

Re: [ansible-project] Ansible-Vault Error: Unexpected Exception: integer division or modulo by zero

2016-01-21 Thread Victor Keenan
No, I'm trying to create a new file/vault. Here is what I'm entering and the output... local ...pment/Ansible_Playbooks/server_lepr/vars(master) $ ls -an total 0 drwxr-xr-x 2 501 20 68 Jan 21 11:07 . drwxr-xr-x 9 501 20 306 Jan 21 10:56 .. local

Re: [ansible-project] Re: synchronize complains that it needs a password to do a sudo

2016-01-21 Thread Toshio Kuratomi
You're right about this being the wrong thing for synchronize to do. My fault for not understanding sooner that this wasn't the behaviour in 1.9.x. We consider it a bug in 2.0.0.x and I'm working on a fix to it for 2.0.1 right now. Progress on the fix is here:

Re: [ansible-project] Ansible-Vault Error: Unexpected Exception: integer division or modulo by zero

2016-01-21 Thread Victor Keenan
Hi Matt, thanks for the help! I'm creating a blank file to add content. I thought the process was use ansible-vault create filename.yml and then it opens in your default editor to add content. Mine is Vim 7.3. I'm getting the error on create. If I have an existing file with content already

Re: [ansible-project] Re: synchronize complains that it needs a password to do a sudo

2016-01-21 Thread Christophe Meessen
Thank you very much for taking the time to answer and also for this great module. It is very useful. Being able to change the local user identity would indeed be a useful addition to ansible. The synchronize module does need it. It could also be useful for with_lines: which execute a command

Re: [ansible-project] Ansible-Vault Error: Unexpected Exception: integer division or modulo by zero

2016-01-21 Thread Matt Martz
I think I understand the issue, and based on my experimentation I have created an issue which you can find at https://github.com/ansible/ansible/issues/14055 On Thu, Jan 21, 2016 at 11:34 AM, Victor Keenan wrote: > Hi Matt, thanks for the help! > > I'm creating a blank file

Re: [ansible-project] Ansible-Vault Error: Unexpected Exception: integer division or modulo by zero

2016-01-21 Thread Victor Keenan
Thanks for the help Matt. I'll follow the issue on Github. On Thursday, January 21, 2016 at 12:41:20 PM UTC-5, Matt Martz wrote: > > I think I understand the issue, and based on my experimentation I have > created an issue which you can find at > https://github.com/ansible/ansible/issues/14055

Re: [ansible-project] Ansible-Vault Error: Unexpected Exception: integer division or modulo by zero

2016-01-21 Thread Victor Keenan
Thanks Brain! Progress, but now a different error... ERROR! Unexpected Exception: [Errno 2] No such file or directory the full traceback was: Traceback (most recent call last): File "/Users/VictorSK/ansible/bin/ansible-vault", line 85, in sys.exit(cli.run()) File

Re: [ansible-project] Re: Traceback with ansible: AttributeError: 'module' object has no attribute '_vendor'

2016-01-21 Thread Toshio Kuratomi
Unfortunately, with setuptools in the mix it's just as likely that the two python modules are compatible but when they're installed together a setuptools bug triggers and causes things like this. setuptools changes where python is searching for modules based on data installed globally (all of the

Re: [ansible-project] Ansible-Vault Error: Unexpected Exception: integer division or modulo by zero

2016-01-21 Thread Brian Coca
are you trying to edit a non existant file? On Thu, Jan 21, 2016 at 11:01 AM, Victor Keenan wrote: > Thanks Brain! Progress, but now a different error... > > ERROR! Unexpected Exception: [Errno 2] No such file or directory > the full traceback was: > > > Traceback (most

Re: [ansible-project] Having issues with Expect: module

2016-01-21 Thread Byron Kim
Hi Matt - thanks for the quick response. That seemed to have done the trick. Thanks! On Thursday, January 21, 2016 at 6:23:27 PM UTC-5, Matt Martz wrote: > > Id recommend just starting off with using `Enter: "{{ passphrase}}" > > The (?i) indicates a case insensitive search, and the parents

[ansible-project] action_plugin/ vs library/ module

2016-01-21 Thread Mike Biancaniello
So, what's the deal with action_plugins? There is very little documentation on their purpose. Observations: 1. If action_plugin/foo.py and library/foo.py both exist, then only action_plugin/foo.py gets called (the plugin *may* call the module if it wants, but that is not by default). 2. If

[ansible-project] Having issues with Expect: module

2016-01-21 Thread Byron Kim
I can't seem to find much documentation or uses of this module. I tried reading up on pexpect documentation however, i'm unable to find my answer. I'm having ansible run a script and then there are prompts that need to be answered. - name: GENERATE CERTIFICATE AND KEY expect: command:

Re: [ansible-project] Having issues with Expect: module

2016-01-21 Thread Matt Martz
Id recommend just starting off with using `Enter: "{{ passphrase}}" The (?i) indicates a case insensitive search, and the parents around ^ are unnecessary, and the can be problematic as sometimes expect sees a \n or a space as the first char. On Thursday, January 21, 2016, Byron Kim

[ansible-project] Re: Installing IIS on Windows Server 2008 R2 Standard SP1 x64

2016-01-21 Thread Joe Levis
I'm having the same problem. TASK [iis : Install IIS] *** /usr/local/lib/python2.7/dist-packages/winrm/transport.py:283: RuntimeError: kerberos.authGSSClientClean is deprecated.

[ansible-project] external inventory, cache, and multi AWS account

2016-01-21 Thread emmanuel . mayssat
If you are using ansible with AWS, you ar eprobably familiar with the ec2.py, an external invnetory script. because API calls to AWS are time consuming, the inventory is built and cached locally. Now when I run python ec2.py --boto-profile 1234 list I see in the cache directory another

[ansible-project] Re: Installing IIS on Windows Server 2008 R2 Standard SP1 x64

2016-01-21 Thread Joe Levis
*Ok, got it to work!* I'm not sure if it's something to do with my Windows setup, but I had to comment out the below entries in the IIS playbook: *include_sub_features: yes* *include_management_tools: yes* Maybe it has something to do with certain sub features not capable of installing?

[ansible-project] After upgraded to 2.0 one of my server become UNREACHABLE

2016-01-21 Thread Jarod Liu
$ ansible 'kk-fj0' -m ping -vvv Using /home/jarod/workspace/ansible/ansible.cfg as config file ESTABLISH SSH CONNECTION FOR USER: root SSH: EXEC ssh -C -q -o ForwardAgent=yes -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic, gssapi-keyex,hostbased,publickey -o

[ansible-project] Re: template requires write permission on parent directory?

2016-01-21 Thread Indra Gunawan
On Friday, April 25, 2014 at 11:32:07 AM UTC-7, Jacob Weber wrote: > > I'm using the "template" task to modify a file that I own, and have write > permissions on. I'm not using sudo; I'm just running it as my own user. > > But I get an error "Destination [parent-dir] not writable." I'm guessing

Re: [ansible-project] action_plugin/ vs library/ module

2016-01-21 Thread Brian Coca
99% of the time you want a module, action plugins normally are created when you need to do work on the 'master' machine. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving