[ansible-project] Retrieving vpc_subnet_id by resource tags

2014-11-13 Thread Lorin Hochstein
Let's say I create an ec2 vpc like this:

  tasks:
  - name: create a vpc
ec2_vpc:
  internet_gateway: True
  resource_tags: { env: production }
  cidr_block: 10.0.0.0/16
  subnets:
- cidr: 10.0.0.0/24
  resource_tags:
env: production
tier: web
- cidr: 10.0.1.0/24
  resource_tags:
env: production
tier: db
  route_tables:
- subnets:
  - 10.0.0.0/24
  - 10.0.1.0/24
  routes:
  - dest: 0.0.0.0/0
gw: igw
register: vpc


Later in the play, I want to create an instance inside of subnet 
10.0.0.0/24 (web tier):

ec2:
  image: "{{ ubuntu_image.ami }}"
  instance_type: "{{ instance_type }}"
  assign_public_ip: True
  key_name: mykey
  group: [web, ssh]
  instance_tags: { type: web, env: production }
  exact_count: "{{ count }}"
  count_tag: { type: web }
  vpc_subnet_id: "{{ vpc.subnets[0].id}}"

Is vpc.subnets[0] guaranteed to correspond to the first subnet that was 
created (10.0.0.0/24)? If not, is there a way I can specify "the vpc subnet 
that corresponds to resource tag {env: production, tier: web}?"


Lorin

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2dfbb8be-753f-443b-b882-3bb1276d3ada%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Retrieving vpc_subnet_id by resource tags

2014-11-13 Thread Lorin Hochstein
Let's say I create an ec2 vpc like this:

  tasks:
  - name: create a vpc
ec2_vpc:
  internet_gateway: True
  resource_tags: { env: production }
  cidr_block: 10.0.0.0/16
  subnets:
- cidr: 10.0.0.0/24
  resource_tags:
env: production
tier: web
- cidr: 10.0.1.0/24
  resource_tags:
env: production
tier: db
  route_tables:
- subnets:
  - 10.0.0.0/24
  - 10.0.1.0/24
  routes:
  - dest: 0.0.0.0/0
gw: igw
register: vpc


Later in the play, I want to create an instance inside of subnet 
10.0.0.0/24 (web tier):

ec2:
  image: "{{ ubuntu_image.ami }}"
  instance_type: "{{ instance_type }}"
  assign_public_ip: True
  key_name: mykey
  group: [web, ssh]
  instance_tags: { type: web, env: production }
  exact_count: "{{ count }}"
  count_tag: { type: web }
  vpc_subnet_id: "{{ vpc.subnets[0].id}}"

Is vpc.subnets[0] guaranteed to correspond to the first subnet that was 
created (10.0.0.0/24)? If not, is there a way I can specify "the vpc subnet 
that corresponds to resource tag {env: production, tier: web}?"


Lorin

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/f83942f0-2471-40b7-a12c-ff5feb9d3f62%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: RHEL6.6 and ControlPersist

2014-11-13 Thread Jacob Weber
Yeah, my ~50 minute playbook is down to about 46 minutes now. Not sure why 
I'm not seeing the difference that others are. I do see the ControlPersist 
files being created in ~ansible/cp. It's running about 80 plays on each of 
about 20 hosts. I guess the SSH part of Ansible wasn't adding that much 
overhead to begin with.



On Thursday, November 13, 2014 1:23:17 PM UTC-8, Jacob Weber wrote:
>
> Got it on CentOS too, and turned pipelining on. Can't say that I'm seeing 
> much of a performance difference, but I'm not getting the errors either. 
> I'll do some testing on a longer playbook later.
>
>
>
> On Thursday, November 13, 2014 11:58:13 AM UTC-8, mto...@go2uti.com wrote:
>>
>>
>> I checked the Oracle repository and found openssh-5.3p1-104.el6_6.1.  
>> I installed that and tested.  Nice!!!  It looks like that patch fixed it.
>> -Mark
>>
>>
>>
>> On Thursday, November 13, 2014 5:41:11 AM UTC-8, Dag Wieers wrote:
>>>
>>> On Tue, 11 Nov 2014, Azul Inho wrote: 
>>>
>>> > just a heads up, 
>>> > 
>>> > I run RH6.5, not able to upgrade at the moment to 6.6 (and it looks 
>>> like it 
>>> > wouldn't help either), I have worked around the ControlPersist issue 
>>> by 
>>> > installing a openssh6 client on my control host box (/opt/openssh6), 
>>> > I then have a wrapper script that calls ansible-playbook and sets the 
>>> PATH 
>>> > to collect ssh and friends from /opt/openssh6/bin before /usr/bin. 
>>> > 
>>> > because it only uses the openssh client (no daemons running), there's 
>>> no 
>>> > conflict with the normal redhat packages. 
>>> > Its so much faster 
>>>
>>> Let me break you the news that Red Hat has released an openssh update 
>>> that 
>>> fixes the reported issue with ControlPersist. 
>>>
>>> * Thu Nov 06 2014 Petr Lautrbach  5.3p1-104.1 
>>> - Fix ControlPersist option with ProxyCommand (#1160487) 
>>>
>>> And it works well. Joy ! 
>>>
>>> -- 
>>> Dag 
>>>
>>

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/20b22709-26aa-4e94-ae54-88270e96365a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: gp2 volumes with ec2_vol

2014-11-13 Thread Ehtesh Choudhury
Could you show an example of how you set up the gp2 partitions with the ec2
module? Of the top of my head, I don't remember being able to configure EBS
volumes from the ec2 module.

On Thu, Nov 13, 2014 at 4:40 PM, Yves Dorfsman  wrote:

>
> We managed to get them created as gp2, with the "ec2" module, looks like
> the "ec2_vol" module cannot do that.
>
> Now, next issue: How can you tag volumes created via the "ec2" module
> (with "ec2_vol", you could register the volumes, then tag them, but I can't
> seem to be able to register volumes with the "ec2" module) ??
>
> --
> 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@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/85fdee69-bd61-43ad-b36d-58afcbd640d2%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAJ2TK01VOY6%3D9DbMMfyCx3atFGZEr3jA0_hGuhp%2BDOFKLcBMzg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: gp2 volumes with ec2_vol

2014-11-13 Thread Yves Dorfsman

We managed to get them created as gp2, with the "ec2" module, looks like 
the "ec2_vol" module cannot do that.

Now, next issue: How can you tag volumes created via the "ec2" module (with 
"ec2_vol", you could register the volumes, then tag them, but I can't seem 
to be able to register volumes with the "ec2" module) ??

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/85fdee69-bd61-43ad-b36d-58afcbd640d2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: RHEL6.6 and ControlPersist

2014-11-13 Thread Jacob Weber
Got it on CentOS too, and turned pipelining on. Can't say that I'm seeing 
much of a performance difference, but I'm not getting the errors either. 
I'll do some testing on a longer playbook later.



On Thursday, November 13, 2014 11:58:13 AM UTC-8, mto...@go2uti.com wrote:
>
>
> I checked the Oracle repository and found openssh-5.3p1-104.el6_6.1.  
> I installed that and tested.  Nice!!!  It looks like that patch fixed it.
> -Mark
>
>
>
> On Thursday, November 13, 2014 5:41:11 AM UTC-8, Dag Wieers wrote:
>>
>> On Tue, 11 Nov 2014, Azul Inho wrote: 
>>
>> > just a heads up, 
>> > 
>> > I run RH6.5, not able to upgrade at the moment to 6.6 (and it looks 
>> like it 
>> > wouldn't help either), I have worked around the ControlPersist issue by 
>> > installing a openssh6 client on my control host box (/opt/openssh6), 
>> > I then have a wrapper script that calls ansible-playbook and sets the 
>> PATH 
>> > to collect ssh and friends from /opt/openssh6/bin before /usr/bin. 
>> > 
>> > because it only uses the openssh client (no daemons running), there's 
>> no 
>> > conflict with the normal redhat packages. 
>> > Its so much faster 
>>
>> Let me break you the news that Red Hat has released an openssh update 
>> that 
>> fixes the reported issue with ControlPersist. 
>>
>> * Thu Nov 06 2014 Petr Lautrbach  5.3p1-104.1 
>> - Fix ControlPersist option with ProxyCommand (#1160487) 
>>
>> And it works well. Joy ! 
>>
>> -- 
>> Dag 
>>
>

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/1fcdc4d7-a440-483d-84e6-6449640aec9c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible Galaxy role versioning

2014-11-13 Thread Will Thames
I was trying to do it using the -r spec file. But I'll have another look
next week. I thought it was galaxy that needed to understand versions but
perhaps it just uses the underlying repo versions.
On 13/11/2014 11:16 pm, "Brian Coca"  wrote:

> from the man page:
>
> "ansible-galaxy install [options] [-r FILE | role_name(s)[,version] |
> tar_file(s)]"
>
> if version is omitted the latest one is used.
>
>
> --
> Brian Coca
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "Ansible Project" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/ansible-project/7zRQsH04rm4/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAJ5XC8nGSVK0WKRD1%3D1fXG7XPV%3D4wsuSbFU0f3oOPhhDLm-Ggg%40mail.gmail.com
> 
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAGmGhM1XJ%3DrP_UgoFyjz-yjoMPZdEQp2FyzkAF4bCr3tMKzvtA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] gp2 volumes with ec2_vol

2014-11-13 Thread Yves Dorfsman

Is it possible to provision gp2 volume (new SSD standard) with ec2_vol?
If so, what's the syntax?

Thanks.

-- 
Yves.

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/54651801.4070607%40zioup.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Multiple "all" groups?

2014-11-13 Thread Brian Coca
you can make it into a dir:

group_vars/all/cleartext
group_vars/all/valuted



-- 
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...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAJ5XC8mFAz9XNDQgKSbQJ_LN9gRm7ZfP5qsmvZOTBpE%3DAoig3g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Multiple "all" groups?

2014-11-13 Thread Jacob Weber
Ah, didn't know that. Thanks!


On Thursday, November 13, 2014 12:13:38 PM UTC-8, Serge van Ginderachter 
wrote:
>
>
> On 13 November 2014 20:51, Jacob Weber > 
> wrote:
>
>> I know we can have group_vars/all,
>
>
> e​very group_vars file can also be a directory where all the yaml files 
> within will be evaluated​
>

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/71b0b669-6a46-4e51-886a-a1d71d2fbacd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Multiple "all" groups?

2014-11-13 Thread Michael Peters
You can have a directory underneath group_vars. Something like:

group_vars/all/
  + secret.yml
  + public.yml

Where secret.yml is vault encrypted.

On Thu, Nov 13, 2014 at 2:51 PM, Jacob Weber  wrote:
> I know we can have group_vars/all, which will apply to all hosts. But is
> there a way to make a second group_vars file that will also apply to all
> hosts?
>
> I ask because I'd like to have a Vault-encrypted vars file, in addition to
> an unencrypted one. If it was only for a specific group X, I would create a
> second group Y, with X as a child, and then create group_vars/X and
> group_vars/Y. But I'm not sure if I can do this for a group that applies to
> all hosts.
>
> Thanks.
>
> --
> 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@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/cb48e1f8-fac7-4e03-bee0-bcadc26b33da%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAJQqANeofg%2BrxexiRfoqB4DUBXiF%3DMaB_Q-tOhU-dWZdvQZh%3Dw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Multiple "all" groups?

2014-11-13 Thread Serge van Ginderachter
On 13 November 2014 20:51, Jacob Weber  wrote:

> I know we can have group_vars/all,


e​very group_vars file can also be a directory where all the yaml files
within will be evaluated​

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAEhzMJC8bc2PRbo0rWQPumJmoZk2yj_nM2NAymuzDdk1Mz3VCw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: RHEL6.6 and ControlPersist

2014-11-13 Thread mtovey

I checked the Oracle repository and found openssh-5.3p1-104.el6_6.1.  I 
installed that and tested.  Nice!!!  It looks like that patch fixed it.
-Mark



On Thursday, November 13, 2014 5:41:11 AM UTC-8, Dag Wieers wrote:
>
> On Tue, 11 Nov 2014, Azul Inho wrote: 
>
> > just a heads up, 
> > 
> > I run RH6.5, not able to upgrade at the moment to 6.6 (and it looks like 
> it 
> > wouldn't help either), I have worked around the ControlPersist issue by 
> > installing a openssh6 client on my control host box (/opt/openssh6), 
> > I then have a wrapper script that calls ansible-playbook and sets the 
> PATH 
> > to collect ssh and friends from /opt/openssh6/bin before /usr/bin. 
> > 
> > because it only uses the openssh client (no daemons running), there's no 
> > conflict with the normal redhat packages. 
> > Its so much faster 
>
> Let me break you the news that Red Hat has released an openssh update that 
> fixes the reported issue with ControlPersist. 
>
> * Thu Nov 06 2014 Petr Lautrbach > 
> 5.3p1-104.1 
> - Fix ControlPersist option with ProxyCommand (#1160487) 
>
> And it works well. Joy ! 
>
> -- 
> Dag 
>

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2d393c18-8b78-4374-8c32-a71121824627%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Multiple "all" groups?

2014-11-13 Thread Jacob Weber
I know we can have group_vars/all, which will apply to all hosts. But is 
there a way to make a second group_vars file that will also apply to all 
hosts?

I ask because I'd like to have a Vault-encrypted vars file, in addition to 
an unencrypted one. If it was only for a specific group X, I would create a 
second group Y, with X as a child, and then create group_vars/X and 
group_vars/Y. But I'm not sure if I can do this for a group that applies to 
all hosts.

Thanks.

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/cb48e1f8-fac7-4e03-bee0-bcadc26b33da%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] groupname as variable?

2014-11-13 Thread Brian Coca
I'm not sure I understand the problem, you want to create the clusters but
are not able to specify them?

On Wed, Nov 12, 2014 at 9:16 PM, linbo liao  wrote:

> Thanks.
>
> I want setup multi cluster instance. So in the play I can't specify the
> detailed cluster node groups, what I can do is use variable to cluster node
> groups.
>
> For example,
>
> [idc1_master]
> host1  cluster_node=idc1_node
>
> [idc1_node]
> host2
> host3
>
> [idc2_master]
> hosti  cluster_node=idc2_node
>
> [idc2_node]
> hostj
> hostk
>
>
> idc1-master requires idc1_node groups, idc2_master requires idc2_node
> groups. If playbook use idc1_node, idc2 cluster will use idc1_node, which
> is not correct.
>
>
> 在 2014年11月12日星期三UTC+8下午9时56分28秒,Brian Coca写道:
>
>> I believe this is what you want:
>>
>> in the inventory:
>> [idc1_node]
>> 
>>
>> in the play:
>>
>> - name: add nodes
>>   debug:  msg={{item}}
>>   with_items: groups['idc1_node']
>>   tags:
>>   - add-node
>>
>>
>> --
>> 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...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/29d9bc6f-97aa-4236-aa17-f893741002b1%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>



-- 
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...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAJ5XC8m9hG7wRwtE539%2BsT%2BaSCUXfpCijeQ7ffEUveB5QsHOxw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] 1.8 release date

2014-11-13 Thread Marc Trudel
Can we expect another 1.7.x release in the meantime? The pace for build 
releases seem to have been faster (once a month or so this summer), which 
is a good thing since it allows users to get access to fixes more quickly.

On Tuesday, October 21, 2014 6:10:17 AM UTC+9, Michael DeHaan wrote:
>
> We typically release about every 2.5-3.5 months as you can infer from the 
> changelog.
>
> We are expecting to keep you that timing for 1.8.
>
>
>
>
> On Thu, Oct 16, 2014 at 4:01 AM, Shaunak Kashyap  > wrote:
>
>> Hi,
>>
>> Is there a rough date when Ansible 1.8 might become available on PyPI?
>>
>> Thank you,
>>
>> Shaunak
>>
>>  -- 
>> 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-proje...@googlegroups.com .
>> To post to this group, send email to ansible...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/CAMiVsfJP3f%3DsQ%3Dq0r8HduS3AffDwPN6Dp4dRL%3DPd0fMtMmXjFA%40mail.gmail.com
>>  
>> 
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d56c39ab-82dc-467f-921e-ff83a3911bc2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: RHEL6.6 and ControlPersist

2014-11-13 Thread Dag Wieers

On Tue, 11 Nov 2014, Azul Inho wrote:


just a heads up,

I run RH6.5, not able to upgrade at the moment to 6.6 (and it looks like it
wouldn't help either), I have worked around the ControlPersist issue by
installing a openssh6 client on my control host box (/opt/openssh6),
I then have a wrapper script that calls ansible-playbook and sets the PATH
to collect ssh and friends from /opt/openssh6/bin before /usr/bin.

because it only uses the openssh client (no daemons running), there's no
conflict with the normal redhat packages.
Its so much faster


Let me break you the news that Red Hat has released an openssh update that 
fixes the reported issue with ControlPersist.


   * Thu Nov 06 2014 Petr Lautrbach  5.3p1-104.1
   - Fix ControlPersist option with ProxyCommand (#1160487)

And it works well. Joy !

--
Dag

--
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/alpine.LRH.2.02.1411131439300.28571%40pikachu.3ti.be.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] tag_Name issue with ec2.py

2014-11-13 Thread jimmy
Hi Chris,

Thanks! I'll give this a try.

-Jimmy

On Thursday, November 13, 2014 7:15:17 AM UTC-6, Chris Church wrote:
>
> There is an open PR for using tags as names: 
> https://github.com/ansible/ansible/pull/7601
>
> Until this one is merged, you could try applying those changes to your 
> copy of ec2.py.
>
>
> On Mon, Nov 10, 2014 at 12:14 PM, > wrote:
>
>> Thanks for the reply. I wasn't able to update this earlier as the post 
>> was being moderated. I was trying to figure out how to group my instances 
>> like you would with the standard /etc/ansible/hosts but after RTFM'ing 
>> further I discovered I could group them by adding a tag named class and 
>> calling those in my playbooks with tag_class_groupname. I started another 
>> post with a similar question about how to display tag_Name during the 
>> playbook runs but I'll wait for that post to be approved and update that 
>> one as well.
>>
>> Now I would like to figure out how to 
>>
>> On Monday, November 10, 2014 9:25:55 AM UTC-6, Michael Peters wrote:
>>>
>>> This is because tags are not properties on the instance objects. I do 
>>> agree that it's weird that you can only pick properties of the 
>>> underlying python object for the destination variable. 
>>> The list of those properties is available here: 
>>> http://docs.pythonboto.org/en/latest/ref/ec2.html#module-
>>> boto.ec2.instance 
>>>
>>> I think it could be improved if instance it waited until all the data 
>>> was gathered and then allowed you to pick anything that was a property 
>>> in the json hash instead. 
>>>
>>> On Sat, Nov 8, 2014 at 8:59 PM,   wrote: 
>>> > Hi all. I am running into an issue and I am having trouble figuring 
>>> out the 
>>> > problem. 
>>> > 
>>> > I am trying to set up Ansible with the ec2.py script replacing 
>>> > /etc/ansible/hosts with ec2.py and I am attempting to list my 
>>> instances with 
>>> > tag_Name. 
>>> > 
>>> > I am running Ansible inside an Amazon VPC so I have the following 
>>> settings 
>>> > in ec2.ini 
>>> > 
>>> > destination_variable = private_dns_name 
>>> > vpc_destination_variable = private_ip_address 
>>> > 
>>> > When I run ec2.py --list it works: 
>>> > 
>>> > : ./ec2.py --list 
>>> > { 
>>> >   "_meta": { 
>>> > "hostvars": { 
>>> >   "10.30.15.0": { 
>>> > "ec2__in_monitoring_element": false, 
>>> > "ec2_ami_launch_index": "0", 
>>> > 
>>> > If I change vpc_destination_variable to other things like id or 
>>> image_id it 
>>> > works. But if I set it to tag_Name I get the following error: 
>>> > 
>>> > AttributeError: 'Instance' object has no attribute 'tag_Name' 
>>> > 
>>> > I see tag_Name as an attribute when I do ec2.py --host HOST 
>>> > 
>>> > What am I missing here? I am using Ansible 1.7.2 
>>> > 
>>> > Thanks! 
>>> > 
>>> > -- 
>>> > 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-proje...@googlegroups.com. 
>>> > To post to this group, send email to ansible...@googlegroups.com. 
>>> > To view this discussion on the web visit 
>>> > https://groups.google.com/d/msgid/ansible-project/
>>> 6c39f599-3659-419e-a951-5e37cc562c6a%40googlegroups.com. 
>>> > For more options, visit https://groups.google.com/d/optout. 
>>>
>>  -- 
>> 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-proje...@googlegroups.com .
>> To post to this group, send email to ansible...@googlegroups.com 
>> .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/6132b1bf-9efe-4b4f-b23f-8bc74568f8cd%40googlegroups.com
>>  
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/3294b376-ee30-4940-ae17-cb7ef2e594ae%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] failed_when - multiple conditions

2014-11-13 Thread ProfHase
Hi,
when trying to install keys to a java keystore I am using the following 
task:

- name: java install ssl certs
  shell:
source /etc/profile.d/java.sh;
cd $JAVA_HOME/jre/lib/security;
$JAVA_HOME/bin/keytool -import -noprompt -keystore cacerts -alias {{ 
item }} -file /tmp/{{ item }}.crt -storepass storepass
  register: command_result
  changed_when: "'already exists' not in command_result.stdout"
  failed_when: "'already exists' not in command_result.stdout"


If the key has already been added, keytool returns '1' and writes 
'...already exists' to stdout.
I would like the task not to fail either:
- if the key has been added
or 
the key already exists.

I tried the condition
failed_when: "'already exists' not in command_result.stdout and 
command_result.rc != 0"



But that one does not work (error while evaluating conditional).

Any ideas how to achieve this task?
Thanks a lot

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b537bc57-b9a4-4543-8cf7-40981a0faa9a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible Galaxy role versioning

2014-11-13 Thread Brian Coca
from the man page:

"ansible-galaxy install [options] [-r FILE | role_name(s)[,version] |
tar_file(s)]"

if version is omitted the latest one is used.


-- 
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...@googlegroups.com.
To post to this group, send email to ansible-project@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAJ5XC8nGSVK0WKRD1%3D1fXG7XPV%3D4wsuSbFU0f3oOPhhDLm-Ggg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] tag_Name issue with ec2.py

2014-11-13 Thread Chris Church
There is an open PR for using tags as names:
https://github.com/ansible/ansible/pull/7601

Until this one is merged, you could try applying those changes to your copy
of ec2.py.


On Mon, Nov 10, 2014 at 12:14 PM,  wrote:

> Thanks for the reply. I wasn't able to update this earlier as the post was
> being moderated. I was trying to figure out how to group my instances like
> you would with the standard /etc/ansible/hosts but after RTFM'ing further I
> discovered I could group them by adding a tag named class and calling those
> in my playbooks with tag_class_groupname. I started another post with a
> similar question about how to display tag_Name during the playbook runs but
> I'll wait for that post to be approved and update that one as well.
>
> Now I would like to figure out how to
>
> On Monday, November 10, 2014 9:25:55 AM UTC-6, Michael Peters wrote:
>>
>> This is because tags are not properties on the instance objects. I do
>> agree that it's weird that you can only pick properties of the
>> underlying python object for the destination variable.
>> The list of those properties is available here:
>> http://docs.pythonboto.org/en/latest/ref/ec2.html#module-
>> boto.ec2.instance
>>
>> I think it could be improved if instance it waited until all the data
>> was gathered and then allowed you to pick anything that was a property
>> in the json hash instead.
>>
>> On Sat, Nov 8, 2014 at 8:59 PM,   wrote:
>> > Hi all. I am running into an issue and I am having trouble figuring out
>> the
>> > problem.
>> >
>> > I am trying to set up Ansible with the ec2.py script replacing
>> > /etc/ansible/hosts with ec2.py and I am attempting to list my instances
>> with
>> > tag_Name.
>> >
>> > I am running Ansible inside an Amazon VPC so I have the following
>> settings
>> > in ec2.ini
>> >
>> > destination_variable = private_dns_name
>> > vpc_destination_variable = private_ip_address
>> >
>> > When I run ec2.py --list it works:
>> >
>> > : ./ec2.py --list
>> > {
>> >   "_meta": {
>> > "hostvars": {
>> >   "10.30.15.0": {
>> > "ec2__in_monitoring_element": false,
>> > "ec2_ami_launch_index": "0",
>> >
>> > If I change vpc_destination_variable to other things like id or
>> image_id it
>> > works. But if I set it to tag_Name I get the following error:
>> >
>> > AttributeError: 'Instance' object has no attribute 'tag_Name'
>> >
>> > I see tag_Name as an attribute when I do ec2.py --host HOST
>> >
>> > What am I missing here? I am using Ansible 1.7.2
>> >
>> > Thanks!
>> >
>> > --
>> > 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-proje...@googlegroups.com.
>> > To post to this group, send email to ansible...@googlegroups.com.
>> > To view this discussion on the web visit
>> > https://groups.google.com/d/msgid/ansible-project/
>> 6c39f599-3659-419e-a951-5e37cc562c6a%40googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>  --
> 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@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/6132b1bf-9efe-4b4f-b23f-8bc74568f8cd%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAH%2BKTJ5zpeoR8FbopBnQFBO-_cBPgsPVbHOYSARGu-FbAXsTYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] where to manage common inventory properties

2014-11-13 Thread Torsten Reinhard
Hi all, 

we started to create our inventory and in the beginning we were just fine 
with the host_vars and group_vars option to place our properties.
Now, for some configuration we have almost the same settings on DEV, TEST 
and PROD environment and I´m think about where to put them.

Of course, I can put the common properties to roles/.../vars or directly 
into the playbook 
- but than it ends up with a "configuration management" based on inventory 
and vars files in the playbooks, roles or whereever.

I know about the group_vars/all option - but this is only for one 
environment - not for many like 

inventory/trunk/
   - dev1
   hosts
   - ..
   - dev3
   - test1
   - ..
   - prod
   hosts



What is best practice to manage such "common inventory properties" - and to 
dont end up with some properties here, others there in the filesystem ?

Is the only way a dynamic inventory that will than solve this problem in 
its implementation?

Thanx, Torsten




-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b0006bc9-80f5-43b1-85eb-23f0d33b0f94%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Allocating a private IP for an EC2 instance fails

2014-11-13 Thread Dan Vaida
ansible --version
ansible 1.8 (devel e564a8ca3f) last updated 2014/11/13 12:08:11 (GMT +200)
  lib/ansible/modules/core: (detached HEAD 63e81cfc2e) last updated 
2014/10/30 15:43:29 (GMT +200)
  lib/ansible/modules/extras: (detached HEAD a0df36c6ab) last updated 
2014/10/30 15:43:35 (GMT +200)
  v2/ansible/modules/core: (detached HEAD cb69744bce) last updated 
2014/10/30 15:43:42 (GMT +200)
  v2/ansible/modules/extras: (detached HEAD 8a4f07eecd) last updated 
2014/10/30 15:43:54 (GMT +200)
  configured module search path = None

I tried doing the VPC creation with only the Subnet that is meant for a 
batch of EC2 instances. This worked nicely for the "{{ vpc.subnets[0].id }}"
Then I called the same VPC playbook but this time also with the second 
Subnet that is meant for another batch of EC2 instances. This way I managed 
to achieve predictability.

This of course is just a dirty workaround as it will work only once because 
of the subsequent runs (lack of a Subnet in the VPC module *deletes* the 
Subnet if it exists and not used).


On Thursday, 13 November 2014 11:59:30 UTC+1, Dan Vaida wrote:
>
> Hello all,
>
> I am creating a VPC with two subnets, a security group and trying to use 
> those for launching an EC2 with a private IP address from one of the 
> freshly created subnets.
>
> The problem seems to be that there is no ordering done by the VPC module 
> in regards to the CIDRs. If that would be happening, it would enable a more 
> predictable access of the subnet by using "{{ vpc.subnets[0].id }}"
> Right now, this makes the new EC2 instance randomly use one of the created 
> subnets.
>
> Another solution could be for the ec2 module to accept the subnet's 
> CIDR... but then again, what if you have the same CIDR but in another AZ, 
> that wouldn't work...
>
> I'm sure the must be a way around this :)
>
>
> vpc.yml
> ---
> - name: VPC, SG, EC
>   hosts: localhost
>   connection: local
>   gather_facts: False
>   tasks:
>
>   - name: create the VPC
> local_action:
>   module: ec2_vpc
>   cidr_block: 10.0.0.0/16
>   dns_hostnames: yes
>   dns_support: yes
>   instance_tenancy: default
>   internet_gateway: yes
>   region: "{{ region }}"
>   resource_tags: { "Environment": "test" }
>   route_tables:
> - subnets:
> - 10.0.0.0/24
>   routes:
> - dest: 0.0.0.0/0
>   gw: igw
>   state: present
>   subnets:
> - cidr: 10.0.0.0/24
>   az: "{{ zone }}"
>   resource_tags: { "Environment":"test", "Name" : "Public subnet" }
> - cidr: 10.0.1.0/24
>   az: "{{ zone }}"
>   resource_tags: { "Environment":"test", "Name" : "Private subnet" 
> }
>   wait: yes
> register: vpc
>   - debug: var=vpc
>
> - include: secgroup.yml
>
> secgroup.yml
> ---
> - name: VPC, SG, EC2 
>   hosts: localhost
>   connection: local
>   gather_facts: False
>   tasks:
>
>   - name: create the security group 
> local_action:
>   module: ec2_group
>   name: "{{ security_group }}"
>   description: a test EC2 group
>   vpc_id: "{{ vpc.vpc_id }}"
>   region: "{{ region }}"
>   rules:
> - proto: all
>   from_port: 0
>   to_port: 65535
>   cidr_ip: "{{ myip }}"/32
>   rules_egress: 
> - proto: all
>   from_port: 0
>   to_port: 65535
>   cidr_ip: 0.0.0.0/0
> register: secgroup
>
>   - debug: var=secgroup 
>
> - include: ec2prov.yml
>
>
> ec2prov.yml
> ---
>
> - name: VPC, SG, EC2 
>   hosts: localhost
>   connection: local
>   gather_facts: False
>   tasks:
> 
>   - name: spin up the instance
> local_action:
>   module: ec2 
>   count: 1
>   region: "{{ region }}"
>   zone: "{{ zone }}"
>   instance_type: "{{ instance_type }}"
>   image: "{{ ami }}"
>   ebs_optimized: yes
>   state: present
>   group_id: "{{ secgroup.group_id }}"
>   vpc_subnet_id: "{{ vpc.subnets[0].id }}"
>   key_name: "{{ keypair }}"
>   monitoring: yes
>   assign_public_ip: yes
>   private_ip: 10.0.0.10
>   wait: yes
>   wait_timeout: 300
>   volumes:
>   - device_name: /dev/xvda
> volume_size: 50
> device_type: gp2
>   - device_name: /dev/xvdb
> volume_size: 80
> device_type: gp2
> ephemeral: ephemeral0
>   - device_name: /dev/xvdc
> volume_size: 80
> device_type: gp2
> ephemeral: ephemeral1
> register: ec2
> tags: ec2
>   
>   - debug: var=ec2
>  
>   - name: add EIP to the instance
> local_action: ec2_eip in_vpc=yes instance_id={{ item.id }} region={{ 
> region }}
> with_items: ec2.instances
> register: eip
>
>   - name: add instance to host group
> local_action: add_host hostname={{ item.public_ip }} groupname={{ 
> security_group }}
> with_items: eip.results 
>
>   - name: tag instance
> local_action: ec2_tag resource={{ item.id }} region={{ 

[ansible-project] how to filter an item list - with_items filter using RegEx ?

2014-11-13 Thread Torsten Reinhard
Hi all, 

like probably most of you, we have multiple servers with multiple 
application instances (Tomcat, Apache, ..) on it, for example structured 
like this:

[cae:children]
cae-1
cae-2

[cae-1]
pbdelsweb001.mydomain.com
[cae-2]
pbdelsweb002.mydomain.com


For each group we have a *.yml file at group_vars directoy in the inventory:

cae-1.yml:
---
cae_instance: 
- 
index: _1_a
port: 8700
- 
index: _1_b
port: 9700
- 
index: _1_c
port: 10700
- 
index: _1_k
port: 12700

All these instances are setup by a simple playbook:

- hosts: cae
  user: myuser

  vars_files:
- vars/stage-{{stage}}.yml  

  roles:
- { role: cae-tomcat, params: "{{ cae_instance }}" }

This is all fine - but now I have to fullfill the requirement to be able to 
address only the "_k" instances - or only the "_a" instances - that meens 
one or more instances out of the complete list.

Is there an option to "filter" the list of instances ? Something like 

  with_items
   - filter: (".*_k" ) 

Do I have to write my own Iterator(s) for this ?

Thanx for any hints, Torsten




-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/fbbdc812-3908-43a8-921b-f7705a6314cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Allocating a private IP for an EC2 instance fails

2014-11-13 Thread Dan Vaida
Hello all,

I am creating a VPC with two subnets, a security group and trying to use 
those for launching an EC2 with a private IP address from one of the 
freshly created subnets.

The problem seems to be that there is no ordering done by the VPC module in 
regards to the CIDRs. If that would be happening, it would enable a more 
predictable access of the subnet by using "{{ vpc.subnets[0].id }}"
Right now, this makes the new EC2 instance randomly use one of the created 
subnets.

Another solution could be for the ec2 module to accept the subnet's CIDR... 
but then again, what if you have the same CIDR but in another AZ, that 
wouldn't work...

I'm sure the must be a way around this :)


vpc.yml
---
- name: VPC, SG, EC
  hosts: localhost
  connection: local
  gather_facts: False
  tasks:

  - name: create the VPC
local_action:
  module: ec2_vpc
  cidr_block: 10.0.0.0/16
  dns_hostnames: yes
  dns_support: yes
  instance_tenancy: default
  internet_gateway: yes
  region: "{{ region }}"
  resource_tags: { "Environment": "test" }
  route_tables:
- subnets:
- 10.0.0.0/24
  routes:
- dest: 0.0.0.0/0
  gw: igw
  state: present
  subnets:
- cidr: 10.0.0.0/24
  az: "{{ zone }}"
  resource_tags: { "Environment":"test", "Name" : "Public subnet" }
- cidr: 10.0.1.0/24
  az: "{{ zone }}"
  resource_tags: { "Environment":"test", "Name" : "Private subnet" }
  wait: yes
register: vpc
  - debug: var=vpc

- include: secgroup.yml

secgroup.yml
---
- name: VPC, SG, EC2 
  hosts: localhost
  connection: local
  gather_facts: False
  tasks:

  - name: create the security group 
local_action:
  module: ec2_group
  name: "{{ security_group }}"
  description: a test EC2 group
  vpc_id: "{{ vpc.vpc_id }}"
  region: "{{ region }}"
  rules:
- proto: all
  from_port: 0
  to_port: 65535
  cidr_ip: "{{ myip }}"/32
  rules_egress: 
- proto: all
  from_port: 0
  to_port: 65535
  cidr_ip: 0.0.0.0/0
register: secgroup

  - debug: var=secgroup 

- include: ec2prov.yml


ec2prov.yml
---

- name: VPC, SG, EC2 
  hosts: localhost
  connection: local
  gather_facts: False
  tasks:

  - name: spin up the instance
local_action:
  module: ec2 
  count: 1
  region: "{{ region }}"
  zone: "{{ zone }}"
  instance_type: "{{ instance_type }}"
  image: "{{ ami }}"
  ebs_optimized: yes
  state: present
  group_id: "{{ secgroup.group_id }}"
  vpc_subnet_id: "{{ vpc.subnets[0].id }}"
  key_name: "{{ keypair }}"
  monitoring: yes
  assign_public_ip: yes
  private_ip: 10.0.0.10
  wait: yes
  wait_timeout: 300
  volumes:
  - device_name: /dev/xvda
volume_size: 50
device_type: gp2
  - device_name: /dev/xvdb
volume_size: 80
device_type: gp2
ephemeral: ephemeral0
  - device_name: /dev/xvdc
volume_size: 80
device_type: gp2
ephemeral: ephemeral1
register: ec2
tags: ec2
  
  - debug: var=ec2
 
  - name: add EIP to the instance
local_action: ec2_eip in_vpc=yes instance_id={{ item.id }} region={{ 
region }}
with_items: ec2.instances
register: eip

  - name: add instance to host group
local_action: add_host hostname={{ item.public_ip }} groupname={{ 
security_group }}
with_items: eip.results 

  - name: tag instance
local_action: ec2_tag resource={{ item.id }} region={{ region }} 
state=present
with_items: ec2.instances
args:
  tags:
Name: "{{ instance_name }}"

  - name: add instance to local host group
local_action: lineinfile dest=hosts regexp="{{ item.public_ip }}" 
insertafter="[launched]" line={{ item.public_ip }}
with_items: eip.results

  - name: wait for the instance to start
local_action: wait_for state=started host={{ item.public_ip }} port=22
with_items: eip.results
ignore_errors: yes


-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/52a5b293-be6f-44dd-939c-f89d2122d38c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Use included circles and expressions in 'with_items' and 'when' statement

2014-11-13 Thread Александр Лозовской
Now i use

  - set_fact: tmpvar="{% for item in vfiles%}{% for bin in item.binaries 
%}{% if bin.name+'.'+bin.ext in files.stdout_lines %}{{item.container}} {% 
endif %}{% endfor %}{% endfor %}"

  - debug: var=item
with_items:
- "{{tmpvar.split()}}"

Maybe there is an better way?


четверг, 13 ноября 2014 г., 11:56:34 UTC+3 пользователь Александр Лозовской 
написал:
>
> Hi! 
>
> I have a problem with with_items+when statement, please help me. In Jinja2 
> syntax it's like this: 
>
> - debug: msg="{% for item in vfiles%}{% for bin in item.binaries %}{% if
>  bin.name+'.'+bin.ext in files.stdout_lines %}{{item.container}}{% endif
>  %}{% endfor %}{% endfor %}"
>
>
> P.S. Sorry for my english.
>

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/247122dc-e8b5-4049-b433-9e6a0baccdc6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Use included circles and expressions in 'with_items' and 'when' statement

2014-11-13 Thread Александр Лозовской
Hi! 

I have a problem with with_items+when statement, please help me. In Jinja2 
syntax it's like this: 

- debug: msg="{% for item in vfiles%}{% for bin in item.binaries %}{% if
 bin.name+'.'+bin.ext in files.stdout_lines %}{{item.container}}{% endif
 %}{% endfor %}{% endfor %}"


P.S. Sorry for my english.

-- 
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@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/fdd1b323-e080-4635-b78a-6d7527e624c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.