[ansible-project] ec2_group does not honor region or ec2_url parameter

2015-07-10 Thread Steven Truong
Hi all, I am using Ansible 1.9.2 and when I was in /usr/local/lib/python2.7/dist-packages/ansible/modules/core/cloud/amazon and grep for region or ec2_url I did not see any real mention of either these in the codes. grep 'ec2_url\|region' ec2_group.py region: - the EC2 region to use

Re: [ansible-project] Why do these SELinux tasks report "changed" every time?

2015-07-10 Thread Willard Dennis
Ah, I see what you mean... the first one has state=permissive, and the next state=disabled... So they were just bouncing back and forth... D'oh! I guess that's why folks suggest code review as a best practice ;) Thanks! Will On Friday, July 10, 2015 at 9:25:27 PM UTC-4, Brian Coca wrote: > > w

Re: [ansible-project] Re: yaml structures passed to roles that to_json cannot use integers

2015-07-10 Thread Brian Coca
Sorry to hear, We hope to release next month, hopefully that will fix this issue. Variable handling was one major headache of the old codebase, part of the reason we rewrote the core. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project"

Re: [ansible-project] Re: yaml structures passed to roles that to_json cannot use integers

2015-07-10 Thread Barry Kaplan
I have to say this is in my top 5 biggest ansible yak shavings. So many times I just need to pass configuration directly to a role which would to_json or to_yaml it. But I cannot because of this bug. Hence I need to parse out every little variable all the way down the structure ensuring that in

Re: [ansible-project] Passing variables to template file in template module

2015-07-10 Thread Brian Coca
I'm not sure what you are asking for here, things_collection is passed to your template as are all other vars defined in the play and for the host, there is no need to put it in with_ if you just want to directly access the var already. -- Brian Coca -- You received this message because you ar

Re: [ansible-project] Ansible newby trying to do something very simple (unsuccessfully)

2015-07-10 Thread Brian Coca
ah, missed the backtics, try using shell: instead of command: -- 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 ansible-project+unsubscr...@go

Re: [ansible-project] Why do these SELinux tasks report "changed" every time?

2015-07-10 Thread Brian Coca
well, i would expect one if not both to always return changed, I looked at the module code and it does compare against existing state to determine change status -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe f

[ansible-project] Trouble with Windows modules

2015-07-10 Thread anthony pangan
Hi all, I'm a complete no0b with Ansible, so sorry if I'm overlooking anything obvious. It seems that arguments I'm sending to Windows modules are not being acknowledged. With win_chocolatey, I'm getting a "missing required arguments: name" error. Similarly this occurs with win_msi, but with th

Re: [ansible-project] Ansible newby trying to do something very simple (unsuccessfully)

2015-07-10 Thread Brian Coca
- name: generate thread dumps hosts: localhost user: oracle # serial: 100% <= this is not needed as that is the default vars: pid: 0 serverNames: - AdminServer tasks: - command: "kill -3 `pgrep -f {{item}}`" # <= note that the braces are double, not single fo

Re: [ansible-project] quoting a colon - I can't get it right

2015-07-10 Thread Brian Coca
action: 'lineinfile dest=/etc/sudoers regexp=^nrpe line="nrpe ALL=(ALL) NOPASSWD: /usr/sbin/vzlicview" state=present' On Fri, Jul 10, 2015 at 3:37 PM, Ed Greenberg wrote: > Can somebody help me get this to work? > > The colon following NOPASSWD is causing me fits. > > - name: add permission f

Re: [ansible-project] How to choose remote_user accoring to OS distribution?

2015-07-10 Thread Brian Coca
There are several ways, the easiest is if your inventory script provides OS info: remote_user: "{{ansible_distibution == 'Fedora'|ternary('fedora', 'root') If you have no info ahead of time you can test connecting and then use group_by (example below) or the same expression above on the result va

[ansible-project] Re: How to set remote_user accoring to OS distribution?

2015-07-10 Thread Adam R.
A better description is "How to set remote_user for according to OS distribution On Friday, July 10, 2015 at 4:07:14 PM UTC-5, Adam R. wrote: > > Hello, > > > I am creating a role to upgrade my servers. Some are CentOS others are > Fedora. CentOS servers use remote_user: root and Fedora servers

[ansible-project] How to choose remote_user accoring to OS distribution?

2015-07-10 Thread Adam R.
Hello, I am creating a role to upgrade my servers. Some are CentOS others are Fedora. CentOS servers use remote_user: root and Fedora servers remote_user: fedora How can i setup my playbook to use one remote_user according to ansible_distribution? In the Ansible FAQ there is a section that d

[ansible-project] quoting a colon - I can't get it right

2015-07-10 Thread Ed Greenberg
Can somebody help me get this to work? The colon following NOPASSWD is causing me fits. - name: add permission for nrpe to access vzlicview action: lineinfile dest=/etc/sudoers regexp=^nrpe line="nrpe ALL=(ALL) NOPASSWD: /usr/sbin/vzlicview" state=present I've tried a bunch of perm

[ansible-project] Re: win_chocolatey missing/broken in Ansible 1.9.2?

2015-07-10 Thread Slim Slam
You're correct. Even though my YAML is valid, the indent level causes Ansible to produce that error. Thanks for the tip. J On Thursday, July 9, 2015 at 4:24:53 PM UTC-5, Michael Legleux wrote: > > Not the correct indent level? > > > tasks: > - name: Get Powershell remoting script > wi

Re: [ansible-project] win_update missing/broken in Ansible 1.9.2?

2015-07-10 Thread Slim Slam
You're correct. Proper indenting makes it work. Thanks. J On Friday, July 10, 2015 at 1:49:30 PM UTC-5, Brian Coca wrote: > > indent category, options should be part of a action, not at same level > > On Thu, Jul 9, 2015 at 3:04 PM, Slim Slam > wrote: > > Running Ansible 1.9.2 > > > > This

Re: [ansible-project] win_update missing/broken in Ansible 1.9.2?

2015-07-10 Thread Brian Coca
indent category, options should be part of a action, not at same level On Thu, Jul 9, 2015 at 3:04 PM, Slim Slam wrote: > Running Ansible 1.9.2 > > This task: > > tasks: > - win_updates: >category: critical > > responds with: > > ERROR: category is not a legal parameter in an Ansible

[ansible-project] Passing variables to template file in template module

2015-07-10 Thread Jérémy Judéaux
Hi, I have a template called in a loop. In order to improve readability and reusability, I'd like to avoid any {{item}}, {{item.0}} or {{item.1.something}} in my template file. According to issue #4546, this doesn't seem possible. There is no documentation about this on the template module pag

[ansible-project] Re: Multiple items and a long list of conditional tasks

2015-07-10 Thread Dan Swartz
Is this what "block" tasks are meant to handle? On Friday, June 20, 2014 at 7:50:03 AM UTC-4, Tom Cannaerts wrote: > > I'm writing a playbook to create a number of solr cores, but I'm running > into some issues. > > I started with a task file that would be included, but appearantly include > an

Re: [ansible-project] Multiple items and a long list of conditional tasks

2015-07-10 Thread Dan Swartz
Of course! I keep forgetting that the "programmy" stuff should go in Python :) When you talk about a 'fact' module, though, what do you mean? Writing a module that takes in a bunch of data formatted in some way and then exit_json( [changed=False,] yourStuff=yourStuff ), where "yourStuff" is a d

Re: [ansible-project] Passing module params conditionally

2015-07-10 Thread David Wittman
The documentation for this feature has been moved to https://docs.ansible.com/playbooks_filters.html#omitting-undefined-variables-and-parameters. On Wednesday, September 17, 2014 at 9:41:03 AM UTC-5, James Cammarata wrote: > > Hi Hagai, > > We've recently added the ability to omit parameters if

Re: [ansible-project] Re: Copy/Template modules hang on AIX - sh.py

2015-07-10 Thread Brian Coca
Matthew, Thanks, this is great documentation for any other AIX user that hits this. Keep us posted on the IBM response. -- 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

Re: [ansible-project] Is Ansible the right tool for what I want to do?

2015-07-10 Thread Toshio Kuratomi
On Jul 10, 2015 6:33 AM, "Tim Skoch" wrote: > A friend recommended Ansible as the solution to this. I've been reading the introduction docs, and it looks like Ansible is exactly what I have been looking for - My Ansible "Playbooks/Plays/Tasks/Modules" would then become my detailed notes, and I w

Re: [ansible-project] Is Ansible the right tool for what I want to do?

2015-07-10 Thread Greg DeKoenigsberg
On Thu, Jul 9, 2015 at 4:25 PM, Tim Skoch wrote: > I'm setting up a lab with a bunch of VMs, and each of these VMs will serve > one of a set of purposes (mostly servers). In setting up each one, I'm > keeping detailed notes of exactly what I have installed, configuration > changes I have made, et

[ansible-project] Is Ansible the right tool for what I want to do?

2015-07-10 Thread Tim Skoch
I'm setting up a lab with a bunch of VMs, and each of these VMs will serve one of a set of purposes (mostly servers). In setting up each one, I'm keeping detailed notes of exactly what I have installed, configuration changes I have made, etc. The setup process is tedious enough that even with

[ansible-project] How to convert a dict into key-val args to be passed to a module

2015-07-10 Thread Vineet Naik
Hi, I am using the pip module to install python dependencies. What I am trying to achieve is - To be able to define the dependencies in one of the vars_files as follows ``` pydeps: - name: requests virtualenv: /tmp/testvenv - name: boto editable: yes - requirements: /tmp/require

[ansible-project] Ansible newby trying to do something very simple (unsuccessfully)

2015-07-10 Thread 'Jane Mortimore' via Ansible Project
I'm am trying to write an ansible script that will generate thread dumps on java processes. Here is my playbook: --- - name: generate thread dumps hosts: localhost user: oracle serial: 100% vars: pid: 0 serverNames: - AdminServer tasks: - command: "kill

Re: [ansible-project] Re: yaml structures passed to roles that to_json cannot use integers

2015-07-10 Thread David Birdsong
On Thursday, June 25, 2015 at 8:39:47 PM UTC-7, Brian Coca wrote: > > A fix for this was merged to current devel, I'm not sure we can > backport it to older versions as the templating code involved was very > convoluted (much simpler in new version). > > any news on this front? i'm trying to

[ansible-project] Ansible cannot find hosts defined in ~/.ssh/config

2015-07-10 Thread Aleksey Kislov
After recent update, when I try to run my playbook, I immediately get the skipping: no hosts matched response. I can reproduce it with following command: ansible myhost --list-hosts The output of it is No hosts matched. myhost is defined in my local ssh config. -c ssh has the same effect. W