Hi

ansible 1.9.1


I'd like to load some variables for newly created instances from my static 
inventory.

I do create some EC2 instances with a playbook (as in basic example):

*- hosts: localhost*
*  connection: local*
*  gather_facts: False*

*  tasks:*

*    - name: Provision a set of instances*
*      ec2:*
*          region: eu-central-1*
*          key_name: kuba_aws*
*          group: default*
*          instance_type: t2.micro*
*          image: ami-accff2b1*
*          vpc_subnet_id: subnet-xxxxxx*
*          wait: yes*
*          exact_count: 3*
*          count_tag:*
*             Name: Demo*
*          instance_tags:*
*             Name: Demo*
*             test_tag: Demo*
*      register: ec2*


I do have static group_vars defined:
*cat group_vars/tag_Name_Demo*
*---*
*ansible_ssh_private_key_file: ~/.ssh/mykey*
*ansible_ssh_user: ubuntu*

But when I lunch:
*ansible -m ping tag_Name_Demo -vvv*

<172.16.1.12> ESTABLISH CONNECTION FOR USER: *xxxxx*


So the files are not read. I thought that the inventories are not combined, 
so I did create directory combining static and dynamic inventory, but no 
luck
*ls ~/inv/*
ec2.py  inventory-qa.ini

*ansible -m ping tag_Name_Demo -vvv -i ~/inv/*
<172.16.1.12> ESTABLISH CONNECTION FOR USER: *xxxxx*

I was sure, that ansible would match group_vars from static inventory and 
assign proper variables for groups in dynamic_inventory ...
Any suggestions - probably there is some step missing?

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3f3aabc0-06f4-4a4d-bd91-b1b786bcf469%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to