[ansible-project] Re: Downgrading apt packages safely

2016-03-02 Thread Alexey Vazhnov
Your playbook gave me an error too: fatal: [localhost]: FAILED! => {"cache_update_time": 0, "cache_updated": false, "changed": false, "failed": true, "msg": "'/usr/bin/apt-get -y -o \"Dpkg::Options::=--force-downgrade\" install 'haproxy=1.4.24-2'' failed: E: There are problems and -y was

[ansible-project] Re: Ansible docker module does not allow me to use bind mode :Z

2016-03-02 Thread ishan jain
Thanks chris. Can you please share the links to this documentation ? Also, i was trying to find the Ansible version 2.1. Can you help me here also ? On Tuesday, 1 March 2016 00:35:51 UTC+5:30, Chris Houseknecht wrote: > > What version of ansible are you running? > > According to the doc

[ansible-project] Skip the hosts when one host is exectued task successfully

2016-03-02 Thread Balaji Sunku
My Playbook: --- - hosts: web vars: increaseCount: 0 remote_user: root tasks: - name: Verifying HTTP endpoint uri: url: "http://{{inventory_hostname}}:{{httpd_port}}/Test; method: PUT body: "{{ lookup('file',test.json') }}"

[ansible-project] cloudformation create_stack() got an unexpected keyword argument 'stack_policy_body'

2016-03-02 Thread John G
Hi, I am getting this error on Ubuntu 14.04.4 LTS. Any idea what is causing it? $ ansible-playbook go_cloud.yml - Using /home/johng/Documents/ansible/ansible/ansible.cfg as config file Loaded callback default of type stdout, v2.0 Loaded callback unnamed of type old, v1.0 1 plays in

Re: [ansible-project] delegate_to a whole group: is it sequential or parallel?

2016-03-02 Thread Florin Andrei
Makes sense, thanks. But is there a way to parallelize delegate_to somehow? All looping methods I'm aware of are based on with_ and that's, as you said, serial. On Wednesday, March 2, 2016 at 3:50:21 PM UTC-8, Brian Coca wrote: > > delegate_to is not inherently parallel or serial, there is no

[ansible-project] setting 'always_run' from a var

2016-03-02 Thread Mike Biancaniello
I have a task that I would like to conditionally run even in check_mode (actually I want to set it for an entire role, but I'm seeing the same behavior in regular tasks). The idea is that this would NOT run the task: ansible-playbook always_run.yml --check And then to actually execute the

Re: [ansible-project] delegate_to a whole group: is it sequential or parallel?

2016-03-02 Thread Brian Coca
delegate_to is not inherently parallel or serial, there is no relationships with it and forks. Parallelism depends on the play and task, with_ loops are currently ONLY serial, so if you delegate_to: "{{item}}" it is serial in the loop, but it is parallel across the play hosts. -- Brian

Re: [ansible-project] Re: packages = p['package'].split(',')\r\nAttributeError:

2016-03-02 Thread Brian Coca
that is not a good key=val multiline, do one of these: apt: pkg: "{{ item }}" state: installed update_cache: yes or apt: | pkg={{ item }} state=installed update_cache=yes On Wed, Mar 2, 2016 at 10:25 AM, Joanna Delaporte wrote:

Re: [ansible-project] Uri module uses CONNECT instead of GET when going through a proxy and fails

2016-03-02 Thread Benoit Tremblay
Thanks! Benoit -- 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. To post to this group, send email to

[ansible-project] Re: Python - ValueError: I/O operation on closed file

2016-03-02 Thread Slim Slam
Looks like this issue was fixed today: https://github.com/ansible/ansible/pull/14755 On Tuesday, March 1, 2016 at 5:02:05 PM UTC-6, Slim Slam wrote: > > Looking at the code for the pause module: > > if seconds is not None: ># setup the alarm handler >signal.signal(signal.SIGALRM,

Re: [ansible-project] ansible_env is undefined

2016-03-02 Thread Ben Cohen
There are a lot of good reasons you might want to only change the search path rather than "set" it. And there are also reasons you might want to have this mutated value for an environment variable be used only in the context of a playbook run. It would be very convenient to be able to _augment_

[ansible-project] OS_TOKEN environment variable with os_* modules

2016-03-02 Thread Curtis
Hi, I'm having a hard time getting the os_user (and I would imagine other modules) to work just using a service token, ie. there are no users in keystone yet, so need to create them using the service token. How would I do that with the os_* modules? I can get the openstack python client to work

Re: [ansible-project] ansible_env is undefined

2016-03-02 Thread Ben Cohen
Thanks -- what's a good pattern to the PATH environment variable during a play? On Mon, Feb 29, 2016 at 7:42 PM, Brian Coca wrote: > As per https://github.com/ansible/ansible/blob/devel/CHANGELOG.md > > "Fix to make implicit fact gathering task correctly inherit settings from

[ansible-project] Docker container always reloaded

2016-03-02 Thread Guy Knights
I have a particular task that starts a docker container, and for some reason every time it runs it reloads the container. The task definition is below: docker: name: zabbix image: "zabbix/zabbix-{{ zabbix.version }}" state: reloaded pull: always expose: - 80 -

[ansible-project] Re: Ansible win_regedit error: {"failed": true, "msg": "'dict object' has no attribute 'datatype'"}"

2016-03-02 Thread a akin
Hi J, Thanks, your syntax for listing the items under the "with_items' section did the trick. I wonder why listing as: {location: 'WindowsUpdate', value: 'WUServer', data: ' http://x.x.x.x:8530 ', datatype: 'string'} was throwing an error. Thanks again. a. --

Re: [ansible-project] Uri module uses CONNECT instead of GET when going through a proxy and fails

2016-03-02 Thread Matt Martz
I think this is likely fixed in devel/2.1. The `uri` module previously relied on httplib2. That dependency has been removed and `uri` now utilizes the shared code from `ansible.module_utils.urls` that `get_url` and many other modules have been using for some time now. On Wed, Mar 2, 2016 at

[ansible-project] Uri module uses CONNECT instead of GET when going through a proxy and fails

2016-03-02 Thread Benoit Tremblay
I have a problem using uri when behind a proxy. There is an exception in the python module. This works well when not going through a proxy. But fails when a proxy is set. - uri: url="http://www.google.com; dest="/tmp/tempfile" fatal: [h39]: FAILED! => {"changed": false, "failed": true,

[ansible-project] Re: How to delete multiple lines after a match?

2016-03-02 Thread Weiwen Chen
I end up with replace module with pattern ':' in it. On Friday, February 26, 2016 at 1:31:37 PM UTC-7, Weiwen Chen wrote: > > Hello Expert, > > Is there a way in ansible to delete multiple lines after a pattern matched? > > > For example, I have a file with following contents, and need to

[ansible-project] Boto(ec2) documentation confusing, ec2_vpc_net_facts

2016-03-02 Thread Stephen Granger
I spent some time trying to use this module and had trouble finding documentation for the filters to pass in. E.g isDefault is actually is_default, vpc_id, id is actually vpc-d, and even though most of the documentation points to is_default being a boolean I had to pass it in as a string e.g. #

[ansible-project] Downgrading apt packages safely

2016-03-02 Thread jan . warchol
Hello, in my ansible playbook I want to ensure a specific version of a package is installed, even if that would mean downgrading it. I know that I can specify version together with package name, like this: haproxy=1.4.24-2. However, this is not enough in case of downgrading: this playbook -

[ansible-project] Re: Ansible Not Passing Domain

2016-03-02 Thread navarone52
I do have python-kerberos installed. On Wednesday, March 2, 2016 at 10:34:40 AM UTC-5, J Hawkesworth wrote: > > My guess would be that you don't have the python kerberos library > installed as it looks like ansible is making a plaintext connection rather > than a kerberos one. > > from the

[ansible-project] Re: Executing a command remotely using ansible

2016-03-02 Thread Akash John
Hi Jeff, yes but i think there we cannot find the similar method as i shared earlier for linux. Could you please guide me if I missed anything on that page? On Wednesday, March 2, 2016 at 8:28:44 PM UTC+5:30, Jeff L wrote: > > Have you looked at this? >

Re: [ansible-project] Problem in exuting ConfigureRemotingForAnsible.ps1 in windows 7

2016-03-02 Thread 'J Hawkesworth' via Ansible Project
The script has changed a bit since Chris's message (over a year ago). Can you confirm you have upgraded to powershell 3 or 4 on the machines before running ConfigureRemotingForAnsible.ps1 It would help if you provide the exact error message. Hope this helps, Jon On Wednesday, 2 March 2016

[ansible-project] Re: Ansible win_regedit error: {"failed": true, "msg": "'dict object' has no attribute 'datatype'"}"

2016-03-02 Thread 'J Hawkesworth' via Ansible Project
I think you are on the right track. I suspect you don't want 'item.datatype' in your with_items list - you only need item. when you are dereferencing the variable. Not tested, but I think maybe something like this is what you are after. I changed subkey to location as it seems subkey has a

[ansible-project] Re: Windows 7 Ansible 2.0

2016-03-02 Thread 'J Hawkesworth' via Ansible Project
I think Windows 7 comes with powershell 2.0 - Ansible needs powershell 3.0 or later. Have you upgraded to powershell 3 or 4, (or Windows Management Framework 3.0 or 4.0)? I suggest using the windows hostname rather than ip, just to rule that out too. Hope this helps, Jon On Wednesday, 2

[ansible-project] Re: Ansible Not Passing Domain

2016-03-02 Thread 'J Hawkesworth' via Ansible Project
My guess would be that you don't have the python kerberos library installed as it looks like ansible is making a plaintext connection rather than a kerberos one. from the command line on your ansible controller, start python and enter import kerberos if you don't have kerberos you will get

[ansible-project] Re: packages = p['package'].split(',')\r\nAttributeError:

2016-03-02 Thread Joanna Delaporte
That looks okay, unless you are also running Ansible from the Github repo. Can you paste the full play here, including the variables that are being read into the play? Thanks! Joanna On Wednesday, March 2, 2016 at 2:34:34 AM UTC-6, hilali lui wrote: > > Thank yoou for your reponse I found >

Re: [ansible-project] Re: Cloned Ansible from github, now ad-hoc fails with the error: 'module' object has no attribute 'COLOR_ERROR'

2016-03-02 Thread Joanna Delaporte
Hi Brian, Thanks! It turns out I had a system installation still hanging around in addition to the github clone. So, I pip uninstalled to remove the system installation of Ansible and now everything works again. On Wednesday, March 2, 2016 at 8:21:33 AM UTC-6, Brian Coca wrote: > > run

[ansible-project] Re: Executing a command remotely using ansible

2016-03-02 Thread Jeff L
Have you looked at this? http://docs.ansible.com/ansible/intro_windows.html On Wednesday, March 2, 2016 at 9:40:53 AM UTC-5, Akash John wrote: > > Hi Team, > > I would like to execute a command on a remote windows host as we are > performing on Linux Machines *ansible webserver -s -m shell -a

[ansible-project] Re: Ansible Not Passing Domain

2016-03-02 Thread navarone52
Also it's ansible 1.9.4 On Wednesday, March 2, 2016 at 9:46:07 AM UTC-5, navar...@gmail.com wrote: > > I'm trying to get Ansible working with Windows Systems. I'm currently > testing it against 2k8 box. > > Run: ansible windows -m win_ping -v (I have one system in the windows > group) > >

[ansible-project] Ansible Not Passing Domain

2016-03-02 Thread navarone52
I'm trying to get Ansible working with Windows Systems. I'm currently testing it against 2k8 box. Run: ansible windows -m win_ping -v (I have one system in the windows group) Returns: ESTABLISH WINRM CONNECTION FOR USER: ansible_user on PORT 5986 TO System.DOMAIN.COM WINRM CONNECT:

[ansible-project] Windows 7 Ansible 2.0

2016-03-02 Thread sjacobs
I have a Windows 7 Enterprise VM that I cannot get to function with Ansible 2.0 Control Server: Centos 7 Ansible Version: ansible 2.0.1.0 and previously 1.9.4 I have followed the setup guide, run the Prep-Script on Windows, verified that WinRM is functional When running: ansible windows -m

[ansible-project] Executing a command remotely using ansible

2016-03-02 Thread Akash John
Hi Team, I would like to execute a command on a remote windows host as we are performing on Linux Machines *ansible webserver -s -m shell -a "/etc/init.d/httpd status" -u user1 -k* Some could you please help me how can we execute the command on Windows remote host. Most probably we need to

[ansible-project] Re: Ansible win_regedit error: {"failed": true, "msg": "'dict object' has no attribute 'datatype'"}"

2016-03-02 Thread a akin
Ok, got some help from the docs and doing this now, better but probably still not the best: - name: Insert Updates needed for WSUS win_regedit: key: HKLM:\SOFTWARE\Policies\ Microsoft\Windows\{{item.subkey}} value: "{{item.value}}" data: "{{item.data}}"

Re: [ansible-project] Re: Cloned Ansible from github, now ad-hoc fails with the error: 'module' object has no attribute 'COLOR_ERROR'

2016-03-02 Thread Brian Coca
run 'make clean' on the github repo, it seems you are mixing old files with the new code. You'll need to run . hacking/env-setup again. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group

[ansible-project] Re: Ansible Loops

2016-03-02 Thread a akin
Ok, got some help from the docs and doing this now, better but probably still not the best: - name: Insert Updates needed for WSUS win_regedit: key: HKLM:\SOFTWARE\Policies\Microsoft\Windows\{{item.subkey}} value: "{{item.value}}" data: "{{item.data}}"

[ansible-project] Re: How do I pass a password as an argument?

2016-03-02 Thread Gilberto Valentin
Ok, I figured this out. This is how I did it: --- ## This playbook installs and configures AD authentication - name: Install and configure AD authentication hosts: linux remote_user: root tasks: - name: install ad_auth required tools yum: pkg={{ item }} state=installed

Re: [ansible-project] Re: Ansible pause module fails to abort when more than one host is in inventory list

2016-03-02 Thread Joanna Delaporte
I just upgraded my Ansible to follow development yesterday after seeing a bug report that had been closed with a patch. I'll test again when I'm on campus Thursday. Thanks! Joanna On Mar 2, 2016 7:39 AM, "Brian Coca" wrote: > I cannot reproduce the issue in 2.0.1, when I hit

Re: [ansible-project] ERROR! 'expect' is not a valid attribute for a Play

2016-03-02 Thread Brian Coca
expect needs to be correctly indented (line up with the 'n' in name) also you want to make sure the command and rest of parameters are also indented farther than the 'e' in expect. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible

Re: [ansible-project] Problem in exuting ConfigureRemotingForAnsible.ps1 in windows 7

2016-03-02 Thread Fahd Ajmal
Hi Chris, I am getting similar error while running {ConfigureRemotingForAnsible.ps1} on some machines. I tried to look for L135 in the script but that is already a comment. can you please mention the exact line (code) that needs to be commented out? { # Create the hashtables of settings to

[ansible-project] Problem running ConfigureRemotingforAnsible.ps1 on Windows Server 2008 R2 SP1

2016-03-02 Thread Fahd Ajmal
Hi All, I am try to run {ConfigureAnsibleforRemoting.ps1} on Windows Server 2008 R2 SP1. it works on most servers but is throwing the following exception on some: PS C:\Windows\system32> E:\staging\ConfigureRemotingForAnsible.ps1 Exception has been thrown by the target of an invocation. At

[ansible-project] Ansible Loops

2016-03-02 Thread a akin
I am trying to update several values under a particular Registry Key name for example: win_regedit: key: HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU value: DetectionFrequency data: 0001 datatype: dword win_regedit: key:

[ansible-project] ERROR! 'expect' is not a valid attribute for a Play

2016-03-02 Thread Nor Idzuwan Mohammad
I'm trying to use the expect modules but only getting error > ansible-playbook -vv --syntax-check passwd.yml ERROR! 'expect' is not a valid attribute for a Play The error appears to have been in '/home/users/.local/ansible/playbooks/passwd.yml': line 2, column 3, but may be elsewhere in the

[ansible-project] looping over list to use as role variables

2016-03-02 Thread basnijholt
Hi all, I would like to use ansible to spawn (and later prune) a list of `jupyter notebook` servers. I now do the following: --- - hosts: vm1 roles: - { role: notebook, port: 8001, name: jup1 } - { role: notebook, port: 8002, name: jup2 } - role: jdauphant.nginx

Re: [ansible-project] Re: Ansible pause module fails to abort when more than one host is in inventory list

2016-03-02 Thread Brian Coca
I cannot reproduce the issue in 2.0.1, when I hit A it exits the play. -- 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] Generating password randomly when user is created

2016-03-02 Thread Deepa Yr
Thanks. Understood what you suggested. It works now. On Tuesday, March 1, 2016 at 6:35:57 PM UTC+5:30, Matt Martz wrote: > > The user module expects the password to already be encrypted. You will > also need to pass encrypt=True to the lookup as well. > > On Tuesday, March 1, 2016, Deepa Yr

[ansible-project] Re: packages = p['package'].split(',')\r\nAttributeError:

2016-03-02 Thread hilali lui
Thank yoou for your reponse I found ahilali@ahilali-desktop:~$ python -c "import sys; print sys.path" ['', '/usr/local/lib/python2.7/dist-packages/ansible-2.0.0.2-py2.7.egg', '/usr/lib/python2.7/dist-packages', '/usr/lib/python2.7', '/usr/lib/python2.7/plat-x86_64-linux-gnu',