[ansible-project] Re: dict merge - with_dict expects a dict

2015-03-12 Thread Jonathan Davila
so I've got a working sample for you. This is the exact test I did. --- - name: Template Test For Route File connection: local hosts: localhost vars: host_routes: route-oob: device: bond.123 routes: 10.118.0.0/16: '10.118.255.254' route-int: dev

[ansible-project] Terminate all instances in a ASG with ec2_asg

2015-03-12 Thread Julien Syx
Hello, I'm trying to use the ec2_asg module here : http://docs.ansible.com/ec2_asg_module.html The goal is to kill all instances during the night and boot them the morning. I tried : - name: Shutdown PREPROD hosts: localhost remote_user: root tasks: - name: Shutdown instances ec2_

[ansible-project] Re: [ansible-devel] Ansible 1.9.0 rc1 is now available

2015-03-12 Thread Matt Martz
Accidentally sent this off list, so let's try again... Unrelated, but should the new escalation code really be included in 1.9? I'd think for something with such potentially impactful changes that it should bake for longer than an RC before release. On Wednesday, March 11, 2015, Serge van Gind

[ansible-project] conditional with register in one task?

2015-03-12 Thread Marc Patermann
Hi, should this work: tasks: - name: test shell: uname -a when: env == "test" - name: test 1 file: path=/opt/test.txt state=touch when: env == "test1" register: test_1 - name: test 2 file: path=/opt/test2 state=touch when: test_1 is defined Task "test 1"

[ansible-project] Re: Trying to git clone from private repo on GitHub

2015-03-12 Thread gustavo giudici
for future googlers, this issue can be solved by setting sudo:false in the role or playbook that is doing the git task On Friday, November 1, 2013 at 7:15:15 PM UTC-3, Jay Pipes wrote: > > Hello all, > > I'm trying to git clone a private repo from GitHub in an Ansible playbook, > and the playboo

[ansible-project] Re: dict merge - with_dict expects a dict

2015-03-12 Thread John McNulty
Hi, For just processing host_routes I had. - name: Write network routes template: > src=route.j2 dest={{ net_path}}/route-{{ item.value.device }} mode=0644 owner=root group=root with_dict: host_routes when: item.value.routes is defined tags: netdev And the template was .. {%

Re: [ansible-project] conditional with register in one task?

2015-03-12 Thread Marc Patermann
Matt, Matt Martz schrieb (11.03.2015 16:08 Uhr): Even though a task is skipped, the registered variable is still created. You would want to check something like the following on your "test 2" task instead: when: not test_1|skipped this works, thank you! The docs could be a bit clearer abou

[ansible-project] lookup module didn't replace variable value that is given as file name

2015-03-12 Thread Arbab Nazar
Hi, I have problem with the lookup module, I am given the file name as a variable, it takes it but didn't replace the variable with it's value. For example: pub_subnet: "{{ lookup('file', './vars/{{ vpc_name }}_public_subnet.yml') }}" When I run the playbook, it should replace it with the var

[ansible-project] Vagrant + Multiple Machines + Ansible

2015-03-12 Thread Rubén Ortiz
Hi I'm trying to write playbook to deploy automatically a Galera Cluster. I've been googling before ask help and I found some interesting info about Vagrantfile and multi machine scenario. My main problem is until now I have never worked with vagrant multiple machines (3 nodes) and Ansible. I

[ansible-project] format variable inside list

2015-03-12 Thread Arba Sasmoyo
hi, i have a question how to format variable inside list and print them to a template. i want to install php with memcache, so i have php servers group and memcache servers group. in order to integrate them, i have to modify php.ini and add each of memcache server's ip to it. so i have to modif

[ansible-project] Re: AWS ec2_elb register multiple instances to and elb?

2015-03-12 Thread Eoin Verling
Thanks Vishal, getting closer, thanks for the help ... I think I'm simply in "YAML wonderland", I'm almost at the strategy of "pressing every button" to see what works!! :) So, for me ... this will work - name: add instances to LB ec2_elb: instance_id: "{{ item }}" ec2_elbs: "{{ my_name

[ansible-project] Re: Running playbook in interactive mode breaks upon run

2015-03-12 Thread Rick Kasten
I am getting a similar error when running my playbook with '--step' with Ansible 1.8.4: $ ansible-playbook -i inventory/dse/dse text.yml PLAY [all] GATHERING FACTS

[ansible-project] Re: (Derived) variable resolution bug?

2015-03-12 Thread Ananda Debnath
A friend at work was wondering whether this has to do with the location of the extravars.json file - I moved it out to the base directory of the ansible project and added another var to make sure the extravars.json file was being loaded - with no difference in results. robin@hood:~/AnsiblePlayb

Re: [ansible-project] lookup module didn't replace variable value that is given as file name

2015-03-12 Thread Brian Coca
Too many moustaches! {{ }} are not stackable, try the following: pub_subnet: "{{ lookup('file', './vars/' + vpc_name + ' _public_subnet.yml') }}" -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this gro

[ansible-project] Re: Terminate all instances in a ASG with ec2_asg

2015-03-12 Thread Julien Syx
An issue has been filled here : https://github.com/ansible/ansible-modules-core/issues/931 Le mercredi 11 mars 2015 14:47:55 UTC+1, Julien Syx a écrit : > > Hello, > > I'm trying to use the ec2_asg module here : > http://docs.ansible.com/ec2_asg_module.html > The goal is to kill all instances du

[ansible-project] Re: Vagrant + Multiple Machines + Ansible

2015-03-12 Thread James Martin
First, see the "Tips and Tricks" section here about using ansible with parallel execution in Vagrant: http://docs.vagrantup.com/v2/provisioning/ansible.html. You'll need to do the provisioning this way to properly collect facts on all the machines. Let's say you had a group called "cluster" t

Re: [ansible-project] Vagrant + Multiple Machines + Ansible

2015-03-12 Thread Karl E. Jorgensen
On Thu, 2015-03-12 at 04:58 -0700, Rubén Ortiz wrote: > Hi > > > I'm trying to write playbook to deploy automatically a Galera Cluster. > I've been googling before ask help and I found some interesting info > about Vagrantfile and multi machine scenario. > > > My main problem is until now I hav

[ansible-project] Re: Vagrant + Multiple Machines + Ansible

2015-03-12 Thread Rubén Ortiz
Hi guys thanks a lot, I'd never been able to reach this solution without help. I will try to put all this together to see if it works and update post as soon as possible! Thanks again On Thursday, March 12, 2015 at 4:03:15 PM UTC+1, Rubén Ortiz wrote: > > Hi > > I'm trying to write playbook to

[ansible-project] Variable inheritance/override

2015-03-12 Thread Duncan Hutty
I'd like to have a pattern for roles where I can: 1) set default values in defaults/default.yml 2) override certain parts of a deep data structure in defaults/{{ansible_distribution}}.yml 3) allow individual instantiations of that role to override specific parts of it. I have a complex data

Re: [ansible-project] Re: Having variables in task names

2015-03-12 Thread Rick Kasten
These answers don't make sense to me. Here's what I've got: # inventory/dse/group_vars/dse/package_versions.yml package_versions: app: oraclejre_version: jdk1.7.0_75 # roles/oraclejre/tasks/main.yml - name: OracleJRE | Make OracleJRE {{ version }} home directory file: path=/usr/local/java

Re: [ansible-project] Re: Having variables in task names

2015-03-12 Thread Rick Kasten
These answers don't make sense to me. Here's what I've got: # inventory/dse/group_vars/dse/ package_versions.yml package_versions: app: oraclejre_version: jdk1.7.0_75 # roles/oraclejre/tasks/main.yml - name: OracleJRE | Make OracleJRE {{ version }} home directory file: path=/usr/local/jav

Re: [ansible-project] lookup module didn't replace variable value that is given as file name

2015-03-12 Thread Arbab Nazar
Hi Brain, Bundles of Thanks, it's work for me. If you don't mind, can you please also give me your valuable comment here: https://groups.google.com/forum/#!topic/ansible-project/Zyb1X4clSWU Thanks On Thursday, March 12, 2015 at 8:51:05 PM UTC+5, Brian Coca wrote: > > Too many moustaches! > > {

[ansible-project] ERROR: provided hosts list is empty

2015-03-12 Thread Guru Devanla
Hello All, I have a simple .yml file that looks like this. - hosts: '{{ hosts }}' tasks: - include: tasks/apt_setup.yml app_user='{{ as_user }}' - include: tasks/python_setup.yml app_user='{{ as_user }}' And I am invoking this script using the following command: ansible-playbook -vvv -

Re: [ansible-project] ERROR: provided hosts list is empty

2015-03-12 Thread Brian Coca
try using a variable named 'target', hosts is a keyword and can lead to confusion, in general do not use variables that overlap with keywords. -- Brian Coca -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and

Re: [ansible-project] ERROR: provided hosts list is empty

2015-03-12 Thread Guru Devanla
Thanks Brian. I tried target but go the same error. I also tried to get rid of variable entirely with the following statement - hosts: 'localhost' tasks: - name: test ping ping: and I still see the same error. Looks like there is some other config file that is causing some issue

Re: [ansible-project] ERROR: provided hosts list is empty

2015-03-12 Thread Brian Coca
newer ansible versions should 'just work' with localhost, any other host you want to use should appear in inventory (default is /etc/ansible/hosts) but you can even define in command line '-i "hostname,"' < comma is important as it tells ansible it is a list. On Thu, Mar 12, 2015 at 2:27 PM, Guru

Re: [ansible-project] ERROR: provided hosts list is empty

2015-03-12 Thread Guru Devanla
That is very strange. The original etc/ansible/hosts file has all lines commented out. I just added an entry like this [dummy_hosts] dummy And everything starts working perfectly with the original file. Thanks Guru On Thursday, March 12, 2015 at 11:29:59 AM UTC-7, Brian Coca wrote: > > n

[ansible-project] URI module equivalent for 'curl --upload-file'

2015-03-12 Thread Kyle Frank
HI. I've been trying to deploy a war file to the Tomcat manager using the uri module. I've been able to use curl from the command line to achieve this but I can't seem to translate it into an ansible task that uses the uri module. I could just use the shell module and insert the curl command

Re: [ansible-project] Re: Having variables in task names

2015-03-12 Thread Krishna
Except this fails to work even with global vars on 1.8.4 (but used to print the value with 1.7.x). --- - hosts: 127.0.0.1 gather_facts: no vars: vhost: "foo" tasks: - name: create a virtual host file for {{ vhost }} debug: msg="{{ vhost }}" Why

[ansible-project] Re-using a pre_task and post_task using roles?

2015-03-12 Thread Samnang Sen
Let's say I need to deploy two sets of applications - PHP vs PERL. I want to be able to re-use the pre_tasks and post_tasks snippet so that i dont have to make changes to multiple scripts if I modify a value for the netscaler module. I guess my question is what's the point of using "pre_tasks"

[ansible-project] register shell output, set as custom fact and use it as a condition of the playbook running

2015-03-12 Thread Chris Short
I am trying to register the output of a shell command, set it as a fact, and then run the playbook only when there is not a match. Example: --- - name: Register git version that is installed on system shell: git --version | sed 's/git\ version\ //g' register: git_version_output tags: regist

[ansible-project] PyCon Sprints

2015-03-12 Thread Toshio Kuratomi
Hey everyone, Ansible is one of the sponsors of PyCon again this year. https://us.pycon.org/2015/ which means a bunch of us will be there and there will be a booth setup in the expo hall, etc. I'll be staying for the Sprints this year so if anyone wants to hack on ansible with the opportunity to a

Re: [ansible-project] register shell output, set as custom fact and use it as a condition of the playbook running

2015-03-12 Thread Michael Peters
You're trying to compare a structure to a string. You probably meant to use "git_installed_version" in your when conditional. Also, you either need to quote the "{{ git_version }}" in the conditional so that the string is quoted, or just leave it off entirely since it's using 2 variables, no need t

[ansible-project] module is missing interpreter line during ansible file copy

2015-03-12 Thread satheesh kumar
I am trying to copy a file from local to the remote VM using ansible, but got below error. My Playbook: --- - hosts: linux remote_user: root tasks: - name: remove sudo password for Suse and RedHat OS family copy: src=waagent dest=/etc/sudoers.d/waagent owner=root group=root mo

[ansible-project] Re: thoroughly stumped on ssh key issue; ansible not reading /root/.ssh/config? (missing something simple?).

2015-03-12 Thread David Proffer
I am having a similar problem to Jason's example. Using ansible version 1.8.4 installed via brew on OS X 10.10.2 machine, ansible is only able to access machines that have root ssh login enabled and only if I use the -k option in ansible. Using -k option, ansible logs in as root and works. If I

Re: [ansible-project] register shell output, set as custom fact and use it as a condition of the playbook running

2015-03-12 Thread Chris Short
I'm running around in circles I feel. Below is my flattened playbook. Ideally the variable is the version of software I want installed. Everything else is to determine if the version on a system matches the variable or not. The issue is that no matter how I skin this cat the version never match

Re: [ansible-project] Re: Having variables in task names

2015-03-12 Thread Toshio Kuratomi
This is a bug: https://github.com/ansible/ansible/issues/10347 The variable handling changed and the callback isn't getting the variables it needs anymore. Defered to v2 because one of the goals of v2 is to simplify variable handling which should make this easier to fix. (and any fix that was to

Re: [ansible-project] Re: Having variables in task names

2015-03-12 Thread Toshio Kuratomi
On Thu, Mar 12, 2015 at 10:20 AM, Rick Kasten wrote: > These answers don't make sense to me. Here's what I've got: > > # inventory/dse/group_vars/dse/ > package_versions.yml > package_versions: > app: > oraclejre_version: jdk1.7.0_75 > > # roles/oraclejre/tasks/main.yml > - name: OracleJRE |