[ansible-project] Include playbook from another role

2014-10-15 Thread anatoly techtonik
I just want to confirm that there is no way to include playbook from a role 
different than current one without resorting to absolute paths. I want this:

+ roles/
   + app-core/
  + tasks/
 main.yml
 permissions.yml
   + app2-core/
  + tasks/
 main.yml

And in roles/app2-core/tasks/main.yml have this one to work:

- include: roles/app-core/tasks/permissions.yml

This doesn't work currently. Moving permissions to a separate role looks 
ugly, because setting permissions is a just common task - not a role - and 
I'd like to avoid code duplication. It looks like any role playbooks except 
main.yml are pretty useless, because what is the point in splitting 
main.yml to parts if the code can not be reused anywhere else?

-- 
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/8a9b0cac-e4d0-4eba-8acc-251100673318%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How to handle package manager depending installations?

2014-10-15 Thread Igor Homyakov
Hi,

Please have a look at https://gist.github.com/hostmaster/db37c8e6c2a43997a224

It is not probably what you are looking for exactly, however it is
very close and it works.
And I hope the idea is clear.

-- Best, Igor

On Wed, Oct 15, 2014 at 11:44 AM,   wrote:
> Hi,
>
> I would like to know how to organize one task that I can install packages
> depending on the ansible_pkg_mgr variable?
> Could you please provide an example, if possible?
>
> Please note: I know ... I can create two tasks with a "when" clause. I have
> that in place.
>
> Kind regards,
> Thomas
>
> Example Dictionary in vars/main.yml:
>
> packages:
> apt:
> - exuberant-ctags
> - cgdb
> - figlet
> - scite
> - graphviz
>
> yum:
> - ctags
> - cgdb
> - figlet
> - graphviz
>
> --
> 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/36cbd28b-6849-4fb5-badb-e7136c6bfdcb%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/CAGuansr%2BCi9Fh%2BPS0jcmuMjoOT3qvRreJG5XCiH6xojY3vbdwQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] getting inventory properties as a list

2014-10-15 Thread David Judd
I have a playbook which performs a potentially destructive action, which I 
expect to run with --limit normally, and I would like to assert that all 
hosts which meet a certain condition are included in my --limit to avoid 
unexpected behavior. The particular use case is failing over a PostgreSQL 
master and updating all replicas correspondingly.

I don't have a problem getting the list to validate against (I use an 
ansible_local fact), but I can't figure out how to get a property of each 
host present in hostvars as a list. So I want to be able to say something 
like:

- name: validate all streaming replicas are in scope
>   assert:
>   that:
>   - "{{ item }} in {{ 
> hostvars.values()|map(attribute='ansible_default_ipv4')|map('address') }}"
>   with_items: ansible_local.academia.pg_streaming_replicas

  when: inventory_hostname == old_master 

 
But 
"hostvars.values()|map(attribute='ansible_default_ipv4')|map('address')" 
doesn't do what I expect, and neither does any variant I've tried. What's 
the right way to get the list of IPs for all hosts that Ansible knows about?

-David

-- 
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/16430f19-2e86-4dcb-b2f5-5b016cc2dfe8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] elastic search snapshot management

2014-10-15 Thread skm
Hello List

I want to do the following tasks using ansible in elastic search cluster

1. create/verify s3 bucket by the name es_backup
2. create folder in s3 bucket by the name var {{ elasticsearch_cluster_id 
}}  - s3 module - Can we create folders using s3 module?
3. create repository using that s3 bucket and base_path (folder inside s3 
bucket) option - uri module - how to implement the parameters ?

curl -XPOST localhost:9200/_snapshot/my_s3_repository -d ' 
{ 
"type": "s3", 
"settings" : { 
   "bucket": "es-backup", 
   "base_path": "logstash_cluster",
   "compress": "true",
   "access_key": "", 
   "secret_key": "" 
}
}'

Any hints/examples to help with the above steps is very welcome.

Thanks,
skm

-- 
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/d11dff8f-662a-47a2-b364-4bcf13054930%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] regarding inventory scripts

2014-10-15 Thread Florin Andrei
(New to Ansible, still figuring out things)

If I have several inventory scripts, is it possible to use them all at 
once, e.g. like this?

ansible -i ec2.py -i some-other-provider.py ...

Are there any guidelines or templates for writing your own inventory script?

What prompts these questions is the fact that I have instances in AWS (for 
which there is an inventory script already) and also some instances with 
another provider (that doesn't have an inventory script yet, so I'll have 
to write my own).

-- 
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/8c0bb49f-2eea-4ad1-99f2-1b2bf909e88f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: How to handle package manager depending installations?

2014-10-15 Thread Seth Edwards
You might want to have a look at 
this 
http://docs.ansible.com/playbooks_best_practices.html#operating-system-and-distribution-variance

I think if you separated it this way, it might get rid of the need to 
define these in vars

On Wednesday, October 15, 2014 12:44:31 AM UTC-7, thomas@teamaol.com 
wrote:
>
> Hi,
>
> I would like to know how to organize one task that I can install packages 
> depending on the *ansible_pkg_mgr* variable?
> Could you please provide an *example*, if possible?
>
> *Please note*: I know ... I can create two tasks with a "when" clause. I 
> have that in place.
>
> Kind regards,
> Thomas
>
> *Example* Dictionary in vars/main.yml:
>
> packages:
> apt:
> - exuberant-ctags
> - cgdb
> - figlet
> - scite
> - graphviz
>
> yum:
> - ctags
> - cgdb
> - figlet
> - graphviz
>
>

-- 
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/be05e425-ee08-41af-a1aa-1f1f90bd2326%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: register variables and use these as role name

2014-10-15 Thread Seth Edwards
 I wouldn't do this. You're playbooks should be very explicit. Are you just 
trying to reduce the number of playbooks you have in your directory? 

On Tuesday, October 14, 2014 11:14:58 PM UTC-7, Denis J. Cirulis wrote:
>
> Hello,
>
> let's suppose I have multiple groups of virtual guests, all are split to 
> different environments and are running 2 kinds of applications but with 
> different configurations.
> In /etc/environment there env variables APPENV and APPNAME which contain 
> belonging to env like 
> APPENV=test,APPENV=stage,APPENV=dev,APPNAME=app1,APPNAME=app2 and so on.
> There is one common role 'common' where all the provisioning and initial 
> configuration tasks and files are stored (this works good). 
> I want to populate roles list in top main.yml playbook with  registering 
> these env variables as Ansible vars and use it in 
>
> roles:
>- { common }
>- { $appenv_$appname }
>
> Is it normal or I do have to think of something different ?
>

-- 
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/3eb96010-6f53-4e04-8d8a-089b71d6c493%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2014-10-15 Thread Kevin Fenzi
On Wed, 15 Oct 2014 21:01:55 -0400
Todd Zullinger  wrote:

> With pipelining = True commented out on el6, things still fail for me 
> on the first run.  They do fail with a different error, but perhaps 
> that's just due to slightly different code paths with pipelining on 
> and off, I haven't looked at the ansible code at all.
> 
> In case it matters, I adjusted the control_path variable to avoid 
> using ~/.ansible since $HOME is on NFS in my environment.
> 
> With pipelining disabled:
> 
> $ ansible web -m ping -o
> ...
> web12 | FAILED => failed to resolve remote temporary directory
> from /var/tmp/ansible-tmp-1413420275.15-6744099385111: `mkdir
> -p /var/tmp/ansible-tmp-1413420275.15-6744099385111 && chmod
> a+rx /var/tmp/ansible-tmp-1413420275.15-6744099385111 &&
> echo /var/tmp/ansible-tmp-1413420275.15-6744099385111` returned empty
> string
> 
> With pipelining enabled:
> 
> $ ansible web -m ping -o
> ...
> web12 | FAILED >> {"failed": true, "msg": "", "parsed": false}
> 
> This is still using openssh-5.3p1-100.el6.x86_64 which was a scratch 
> build that Petr made per RHBZ #953088.  I have not checked whether 
> there are any differences in the -104 packages included in the latest 
> RHEL updates (and they haven't made it to my CentOS mirror yet).
> 
> This is also with ansible-1.6.10-1.el6 from EPEL.  I have not yet 
> updated to 1.7.x (I see 1.7.2-1 is in epel-testing now, so I'll 
> prbably wait for that to hit stable).

ansible-1.7.2-1.el6.noarch
openssh-5.3p1-104.el6.x86_64

with pipeline disabled: 

% ansible -m ping -o junk02\*
junk02.phx2.fedoraproject.org | success >> {"changed": false, "ping": "pong"}

with pipeline enabled: 

% ansible -m ping -o junk02\*
junk02.phx2.fedoraproject.org | FAILED >> {"failed": true, "msg": "", "parsed": 
false}

kevin


signature.asc
Description: PGP signature


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

2014-10-15 Thread Todd Zullinger

Kevin Fenzi wrote:
On Wed, 15 Oct 2014 16:07:42 -0700 
Michael DeHaan  wrote:



"I think this is a bug, has anyone tested this ?"

Sounds like this should be reported with RHEL, definitely.

Please do and post the bugzilla here if you can.

While we could add special code to say "don't try CP on EL6 if ssh 
says it CAN CP" it seems shipping the feature broken would have been 
detected by them.


I ran into this as well, but haven't had too much time to isolate it.

However, I did find that controlpersist works with ansible, but if you 
enable pipelining, then it hangs on the first connection.


So, perhaps there's a issue around pipelining?


With pipelining = True commented out on el6, things still fail for me 
on the first run.  They do fail with a different error, but perhaps 
that's just due to slightly different code paths with pipelining on 
and off, I haven't looked at the ansible code at all.


In case it matters, I adjusted the control_path variable to avoid 
using ~/.ansible since $HOME is on NFS in my environment.


With pipelining disabled:

$ ansible web -m ping -o
...
web12 | FAILED => failed to resolve remote temporary directory from 
/var/tmp/ansible-tmp-1413420275.15-6744099385111: `mkdir -p 
/var/tmp/ansible-tmp-1413420275.15-6744099385111 && chmod a+rx 
/var/tmp/ansible-tmp-1413420275.15-6744099385111 && echo 
/var/tmp/ansible-tmp-1413420275.15-6744099385111` returned empty string

With pipelining enabled:

$ ansible web -m ping -o
...
web12 | FAILED >> {"failed": true, "msg": "", "parsed": false}

This is still using openssh-5.3p1-100.el6.x86_64 which was a scratch 
build that Petr made per RHBZ #953088.  I have not checked whether 
there are any differences in the -104 packages included in the latest 
RHEL updates (and they haven't made it to my CentOS mirror yet).


This is also with ansible-1.6.10-1.el6 from EPEL.  I have not yet 
updated to 1.7.x (I see 1.7.2-1 is in epel-testing now, so I'll 
prbably wait for that to hit stable).


HTH,

--
ToddOpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~
Until you spread your wings, you'll have no idea how far you can walk.
   -- Demotivators (www.despair.com)



pgp6EhrqK9ksW.pgp
Description: PGP signature


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

2014-10-15 Thread Kevin Fenzi
On Wed, 15 Oct 2014 16:07:42 -0700
Michael DeHaan  wrote:

> "I think this is a bug, has anyone tested this ?"
> 
> Sounds like this should be reported with RHEL, definitely.
> 
> Please do and post the bugzilla here if you can.
> 
> While we could add special code to say "don't try CP on EL6 if ssh
> says it CAN CP" it seems shipping the feature broken would have been
> detected by them.

I ran into this as well, but haven't had too much time to isolate it. 

However, I did find that controlpersist works with ansible, but if you
enable pipelining, then it hangs on the first connection. 

So, perhaps there's a issue around pipelining? 

kevin




signature.asc
Description: PGP signature


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

2014-10-15 Thread Michael DeHaan
"I think this is a bug, has anyone tested this ?"

Sounds like this should be reported with RHEL, definitely.

Please do and post the bugzilla here if you can.

While we could add special code to say "don't try CP on EL6 if ssh says it
CAN CP" it seems shipping the feature broken would have been detected by
them.




On Wed, Oct 15, 2014 at 10:08 AM, Todd Zullinger  wrote:

> Dag Wieers wrote:
>
>> As some of you may know, Red Hat backported the ControlPersist
>> functionality to the OpenSSH version that ships with RHEL6.
>>
>> This is terrific since RHEL users can now use this technique to speed up
>> Ansible.
>>
>> However, after some testing it seems to fail for the very first
>> connection. What happens is that the first connection, when the persistent
>> connection has not been set up yet, fails. Any subsequent connection seems
>> to work fine, but obviously this fails to work properly with Ansible.
>>
>> I think this is a bug, has anyone tested this ?  Or am I doing something
>> wrong here ?
>>
>
> I noticed this after updating to one of the later test packages from the
> bugzilla ticket where this was requested (it did not occur initially).  I
> also thought it might be something peculiar to my environment and didn't
> notice it soon enough to bring it up in the ticket, unfortunately.
>
> I haven't installed the final update yet (on CentOS), but I was hoping
> that it might have corrected the problem.  At least I planned to test the
> latest package before considering it a package bug.
>
> Knowing it seems to affect more than me, I imagine a new bug report is in
> order to resolve the problem.
>
> It is fantastic to have ControlPersist on EL6 though. ;)
>
> --
> ToddOpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
> ~~
> Habit, n. A shackle for the free.
>-- Ambrose Bierce, "The Devil's Dictionary"
>
> --
> 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/20141015170811.GX10769%40zaya.teonanacatl.net.
>
> 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/CA%2BnsWgxF-23-twzg2gAKjpVozbdiF0JW6KEmE5gixFr%3DhMZoWQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] How to handle package manager depending installations?

2014-10-15 Thread thomas . lehmann
Hi,

I would like to know how to organize one task that I can install packages 
depending on the *ansible_pkg_mgr* variable?
Could you please provide an *example*, if possible?

*Please note*: I know ... I can create two tasks with a "when" clause. I 
have that in place.

Kind regards,
Thomas

*Example* Dictionary in vars/main.yml:

packages:
apt:
- exuberant-ctags
- cgdb
- figlet
- scite
- graphviz

yum:
- ctags
- cgdb
- figlet
- graphviz

-- 
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/36cbd28b-6849-4fb5-badb-e7136c6bfdcb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Variable used to lookup inventory value

2014-10-15 Thread Michael Hoglan
Sorry to drag up an old thread, but this was one of the closer 
conversations out of the ones I found for what I was seeing.

Looking through old tickets, it looks like there used to be an issue when 
accessing hostvars[inventory_hostname] that you would not get all the vars 
associated with the host, such as ones added from add_host call.  I see 
this does work, however, if I debug just the hostvars itself (not 
hostvars[inventory_hostname]) I don't get the same results.

The var does exist, and it can be used in plays, I mainly keep running into 
this as I am debugging and trying to see what vars exist for all hosts

Given a host file of:

[launched]
10.0.3.234 test_var=test
10.0.3.162 test_var=test


And a playbook of

---
- name: Playbook testing inventory var debugging
  hosts: launched
  user: root
  gather_facts: yes
  tasks:
- name: Output inventory var
  debug: var=test_var
- name: Output inventory var from hostvars
  debug: var=hostvars[inventory_hostname].test_var
- name: Output hostvars[inventory_hostname]
  debug: var=hostvars[inventory_hostname]
- name: Output hostvars
  debug: var=hostvars


The last debug for var=hostvars will not output the vars from the inventory 
file.  The var exists, so this is kind of cosmetic, but it threw me off for 
a bit as I was working with add_host for dynamic EC2 provisioning and 
wasn't seeing the vars I was expecting when doing debug hostvars to look at 
all the vars for all hosts.

(ansible)[ec2-user@ip-10-0-0-226 playbooks]$ ansible-playbook -i launched 
test_inventory_var_debug.yml 

PLAY [Playbook testing inventory var debugging] 
*** 

GATHERING FACTS 
*** 
ok: [10.0.3.162]
ok: [10.0.3.234]

TASK: [Output inventory var] 
** 
ok: [10.0.3.234] => {
"test_var": "test"
}
ok: [10.0.3.162] => {
"test_var": "test"
}

TASK: [Output inventory var from hostvars] 
 
ok: [10.0.3.234] => {
"hostvars[inventory_hostname].test_var": "test"
}
ok: [10.0.3.162] => {
"hostvars[inventory_hostname].test_var": "test"
}

TASK: [Output hostvars[inventory_hostname]] 
*** 
ok: [10.0.3.234] => {
"hostvars[inventory_hostname]": {
"ansible_all_ipv4_addresses": [
"10.0.3.234"
], 
...
"ansible_virtualization_type": "xen",  
*"group_names": [*
*"launched"*
*], *
*"inventory_hostname": "10.0.3.234", *
*"inventory_hostname_short": "10", *
*"module_setup": true, *
*"test_var": "test"*
}
}
ok: [10.0.3.162] => {
"hostvars[inventory_hostname]": {
"ansible_all_ipv4_addresses": [
"10.0.3.162"
], 
...
"ansible_virtualization_type": "xen", 
*"group_names": [*
*"launched"*
*], *
*"inventory_hostname": "10.0.3.162", *
*"inventory_hostname_short": "10", *
*"module_setup": true, *
*"test_var": "test"*
}
}

TASK: [Output hostvars] 
*** 
ok: [10.0.3.234] => {
"hostvars": {
"10.0.3.162": {
"ansible_all_ipv4_addresses": [
"10.0.3.162"
], 
...
"ansible_virtualization_type": "xen", 
"module_setup": true
}
}
}
ok: [10.0.3.162] => {
"hostvars": {
"10.0.3.162": {
"ansible_all_ipv4_addresses": [
"10.0.3.162"
], 
...
"ansible_virtualization_type": "xen", 
"module_setup": true
}
}
}

PLAY RECAP 
 
10.0.3.162 : ok=5changed=0unreachable=0failed=0 
  
10.0.3.234 : ok=5changed=0unreachable=0failed=0


Anyways, let me know if I misunderstand this or if there is a different var 
to be looking at for the inventory vars.  I can open an issue ticket also.

Thanks!
Michael

-- 
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/70f5e68a-9512-4544-9c8b-263c4f20805b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Resolving some ambiguity with requirements.yml vs meta/main.yml

2014-10-15 Thread mahmoudimus
 

Hi there,

I would like some clarification on this pattern I'm noticing in the 
documentation in regards to dependencies installed via Ansible Galaxy 
(http://docs.ansible.com/galaxy.html) and the Role Dependencies 
(http://docs.ansible.com/playbooks_roles.html#role-dependencies).

When would you choose requirements.yml over a meta/main.yml with its 
dependencies list filled out? There might be some unnecessary duplication.

The only thing I've been able to reason was that you would use 
meta/main.yml dependencies when the intent is to distribute the 
encompassing role. 

If one has playbooks that require specific roles installed, one would put 
them in the requirements.yml.

So for distributable roles that also have playbooks, it is assumed that if 
one is operating on that role directly, then requirements.yml is necessary. 
If one is embedding that role, then meta/main.yml should define the 
dependencies that are required to embed that role.

Not sure if my understanding is correct.

Thanks for the help.

-- 
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/7874cc03-0ee4-4b68-8cb6-acd3180091d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Ansible Galaxy

2014-10-15 Thread Matt Davies
Hello everyone

I'm just starting my ansible journey, so please bear with me.

I'm looking at ansible galaxy, but all the roles I seem to be finding only 
have one customer rating at most, and none of them have any ansible ratings.

https://galaxy.ansible.com

I'm probably searching incorrectly, but it does look like the take up of 
this site isn't great.

Could someone tell me if I'm searching incorrectly or is this the case?

I realise it's new, but its such a good idea I thought people would be 
raring to use it.

Any help, greatly appreciated.

Matt


-- 
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/0c767139-5ffa-4524-8e11-312cf5346ece%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] How are debug: var=vars / var=hostvars supposed to work?

2014-10-15 Thread Ross Rosen
Per the documentation and this 
thread: https://groups.google.com/d/msg/ansible-project/rE8aVu4LNS0/sGKweGPvffoJ
I *think* that debug: var=hostvars should print all the variables in scope 
(for each host).  I'm not sure what var=vars is - non-host-specific 
variables?

In either case, I'm getting extremely odd behavior that I can't figure out. 
 I'm sorry this is long, but it is hopefully easy to follow and I suspect 
is either a simple answer or there is a bug.

(some stuff removed for brevity or security)

Here is my command line: 
 ansible-playbook playbook.yml --inventory-file dynamic_inventory.sh 
--limit stage --user xxx --private-key xxx.pub -e IS_VAGRANT=False -C

Here is the result of my dynamic inventory for host 'stage'
{
"hosts": [
"192.xxx.xxx.176"
],
"vars": {
"HOST_NAME": "stage.y.com",
"SERVER_NAME": "stage.y.com"
}
}

Now here are the key plays, and results, from my playbook

- debug: var=vars
>> This looks pretty good (but note it doesn't show variables from my 
inventory)

PLAY [all] 


TASK: [baseUbuntu | debug var=vars] 
***
ok: [192.xxx.xxx.176] => {
"vars": {
"DIFFTOOL": "git --no-pager diff",
...  ...
"IS_VAGRANT": "False",
...  ...
"_original_file": 
"/Users/xx/tmp/thissite/ansible_config/roles/baseUbuntu/tasks/main.yml",
"always_run": false,
"changed_when": null,
"delegate_to": null,
...  ...
"role_uuid": "160302ff-f06f-4a78-8204-f0fcc4a8c750"
}
}



- debug: var=hostvars
>> This looks wrong to me. Shouldn't it either be a superset of vars and my 
inventory variables? 
(HOST_NAME and SERVER_NAME)

TASK: [baseUbuntu | debug var=hostvars] 
***
ok: [192.xxx.xxx.176] => {
"hostvars": {
"192.xxx.xxx.176": {
"IS_VAGRANT": "False"
}
}
}



Hmmm... maybe I I'm not properly setting my inventory variables.
Nope! See 'HOST_NAME' is properly set. Why doesn't it show up in vars or 
hostvars?

- debug: msg="HOST_NAME = *{{ HOST_NAME }}*"
TASK: [baseUbuntu | debug msg="HOST_NAME = *{{ HOST_NAME }}*"] 

ok: [192.xxx.xxx.176] => {
"msg": "HOST_NAME = *stage.y.com*"
}


And this one is even weirder. I use {{ HOST_NAME }} and in the "name" 
clause it doesn't 
render and in the hostname clause it does!

- name: "Set hostname to {{ HOST_NAME }}"
hostname: name="{{ HOST_NAME }}"

TASK: [baseUbuntu | debug msg="HOST_NAME = *{{ HOST_NAME }}*"] 

ok: [192.xxx.xxx.176] => {
"msg": "HOST_NAME = *stage.y.com*"
}


I'm baffled - I'd appreciate any tips. Thank you!

-- 
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/474c431e-8108-4739-a31d-f1c0461d76c2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] interpolated parameterized role dependencies

2014-10-15 Thread alexahnhome
Hey guys, first of all, I think Ansible is a great project. In my most 
recent project, I've started to explore the various ways to manage 
configurations, and one of the schemes that I wanted to explore was using 
parameterized role dependencies. Essentially, the setup of the problem is 
similar 
to: 
https://github.com/sivel/ansible-training-content/blob/master/advanced/chapter_08.yml#L105
When I define a role, I'd like to be able to define inside meta/main.yml, 
not only the dependencies, but also the parameters passed into the 
dependencies (interpolated). Here is an 
example: http://pastebin.com/rwmnke9V
I have set hash_behavior to merge because I want to essentially pass in a 
dictionary to each role dependency (which houses the parameters they need 
to function).
Ansible errors out with: AttributeError: 'unicode' object has no attribute 
'iteritems'
What's strange is that this sort of interpolation works within playbooks, 
in that I can use the exact same syntax to be able to pass dictionary 
values into roles for plays. Is this a use case that ansible can satisfy, 
and/or am I doing something wrong? Thanks for reading!

-- 
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/f4708941-e382-4084-a9e0-e685f4d1b8f1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] register variables and use these as role name

2014-10-15 Thread Denis J. Cirulis
Hello,

let's suppose I have multiple groups of virtual guests, all are split to 
different environments and are running 2 kinds of applications but with 
different configurations.
In /etc/environment there env variables APPENV and APPNAME which contain 
belonging to env like 
APPENV=test,APPENV=stage,APPENV=dev,APPNAME=app1,APPNAME=app2 and so on.
There is one common role 'common' where all the provisioning and initial 
configuration tasks and files are stored (this works good). 
I want to populate roles list in top main.yml playbook with  registering 
these env variables as Ansible vars and use it in 

roles:
   - { common }
   - { $appenv_$appname }

Is it normal or I do have to think of something different ?

-- 
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/84f73918-4cdd-46f5-8a79-67b0b2d99c24%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


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

2014-10-15 Thread Todd Zullinger

Dag Wieers wrote:
As some of you may know, Red Hat backported the ControlPersist 
functionality to the OpenSSH version that ships with RHEL6.


This is terrific since RHEL users can now use this technique to 
speed up Ansible.


However, after some testing it seems to fail for the very first 
connection. What happens is that the first connection, when the 
persistent connection has not been set up yet, fails. Any subsequent 
connection seems to work fine, but obviously this fails to work 
properly with Ansible.


I think this is a bug, has anyone tested this ?  Or am I doing 
something wrong here ?


I noticed this after updating to one of the later test packages from 
the bugzilla ticket where this was requested (it did not occur 
initially).  I also thought it might be something peculiar to my 
environment and didn't notice it soon enough to bring it up in the 
ticket, unfortunately.


I haven't installed the final update yet (on CentOS), but I was hoping 
that it might have corrected the problem.  At least I planned to test 
the latest package before considering it a package bug.


Knowing it seems to affect more than me, I imagine a new bug report is 
in order to resolve the problem.


It is fantastic to have ControlPersist on EL6 though. ;)

--
ToddOpenPGP -> KeyID: 0xBEAF0CE3 | URL: www.pobox.com/~tmz/pgp
~~
Habit, n. A shackle for the free.
   -- Ambrose Bierce, "The Devil's Dictionary"

--
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/20141015170811.GX10769%40zaya.teonanacatl.net.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Problems setting up WinRM

2014-10-15 Thread skinnedknuckles
Thanks J for your suggestions.

I am using the Trond Hindenes powershell script to configure my windows 
remote node and it always returns "ok"
I believe I have basic auth enabled because the script contains these lines

#Check for basic authentication

$basicauthsetting = Get-ChildItem WSMan:\localhost\Service\Auth | where {$_.
Name -eq "Basic"}

if (($basicauthsetting.Value) -eq $false)

{

 Write-Verbose "Enabling basic auth"

 Set-Item -Path "WSMan:\localhost\Service\Auth\Basic" -Value $true

}

Else

{

 Write-verbose "basic auth already enabled"

}
I will check on the local account issue you raised and let you know if that 
works.


Also my remote node is not a server.  It is running Windows 7 sp1 and 
powershell ver 3.


I'm switching from Fedora to CentOs 7.0.  I haven't made much progress 
overall but at least I'm becoming very familiar with the Windows system 
prep on the control machine.  I've done it 4 times now and am going to try 
a 5th in a few minutes.

Thanks again,

Jonathan


On Wednesday, October 15, 2014 3:37:21 PM UTC-5, J Hawkesworth wrote:
>
> Don't know for sure what is going on here but a couple of suggestions...
>
> Check the winrm config and ensure basic auth is enabled:
>
> *winrm get winrm/config/*
>
> if basic auth is false set it to true (instructions further up in this 
> thread).
>
> You mention that both machines are on common domain but right now Ansible 
> will not work with domain user accounts - so check that you are actually 
> using a local account in your windows.yml.
>
> Your windows.yml file shouldn't need to start with --- - mine doesn't 
> anyway.
>
> I had an issue with a windows server 2008 box that wasn't up to date with 
> windows updates which caused winrm to fail as it was setting a very small 
> limit on the allowed process size for commands run via winrm.  There was a 
> specific patch for it but worth checking windows update is fully up to date 
> if that's an option for you.
>
> Your setup sounds pretty similar to one I have had working in the past. My 
> controller was running centos 6.3 and I had it working against a win 7 host 
> using a local account.
>
> Hope this helps, let us know how you get on.
>
> Jon
> On Thursday, October 9, 2014 6:18:21 PM UTC+1, skinnedknuckles wrote:
>>
>> I've reinstalled everything and am still having trouble getting win_ping 
>> to work.  Here is my info:
>> Fedora 20
>> Ansible 1.7.1
>> Remote node running windows 7
>> The WinRM script by Trond runs without errors on the remote node
>> Control and Remote Machines are both on Lan with common domain w/o 
>> firewalls
>> So far as I can tell I've installed everything on control and remote 
>> machine as described in documentation
>>
>> My inventory file contains
>> [windows]
>> 123.123.123.123
>>
>> My windows.yml file is in the group_vars directory and contains
>> ansible_ssh_user: Administrator
>> ansible_ssh_pass: ansiblepw
>> ansible_ssh_port: 5986
>> ansible_connection: winrm
>>
>> Should this file begin with "---"?
>>
>> Can you tell what I'm doing wrong?  Do you need any more information?
>>
>>
>>
>> [ansmgr@dhcp1-59-159 ansible]$ ansible windows -m win_ping --ask-pass 
>> - 
>> SSH password: 
>> <123.123.123.123> ESTABLISH WINRM CONNECTION FOR USER: Administrator on 
>> PORT 5986 TO 123.123.123.123 
>> <123.123.123.123> WINRM CONNECT: transport=plaintext endpoint=
>> https://123.123.123.123:5986/wsman 
>> <123.123.123.123> WINRM CONNECTION ERROR: 500 WinRMTransport. [Errno 104] 
>> Connection reset by peer 
>> <123.123.123.123> WINRM CONNECT: transport=plaintext endpoint=
>> http://123.123.123.123:5986/wsman 
>> 123.123.123.123 | FAILED => Traceback (most recent call last): 
>> File "/etc/ansible/lib/ansible/runner/__init__.py", line 549, in 
>> _executor 
>> exec_rc = self._executor_internal(host, new_stdin) 
>> File "/etc/ansible/lib/ansible/runner/__init__.py", line 707, in 
>> _executor_internal 
>> return self._executor_internal_inner(host, self.module_name, 
>> self.module_args, inject, port, complex_args=complex_args) 
>> File "/etc/ansible/lib/ansible/runner/__init__.py", line 870, in 
>> _executor_internal_inner 
>> conn = self.connector.connect(actual_host, actual_port, actual_user, 
>> actual_pass, actual_transport, actual_private_key_file) 
>> File "/etc/ansible/lib/ansible/runner/connection.py", line 44, in connect 
>> self.active = conn.connect() 
>> File "/etc/ansible/lib/ansible/runner/connection_plugins/winrm.py", line 
>> 132, in connect 
>> self.protocol = self._winrm_connect() 
>> File "/etc/ansible/lib/ansible/runner/connection_plugins/winrm.py", line 
>> 86, in _winrm_connect 
>> protocol.send_message('') 
>> File "/usr/lib/python2.7/site-packages/winrm/protocol.py", line 173, in 
>> send_message 
>> return self.transport.send_message(message) 
>> File "/usr/lib/python2.7/site-packages/winrm/transport.py", line 76, in 
>> send_message 
>> response = urlopen(request, timeout=self.timeout) 
>> File "/usr/lib64/python2.7/urllib2.py", line

[ansible-project] Re: Problems setting up WinRM

2014-10-15 Thread J Hawkesworth
Don't know for sure what is going on here but a couple of suggestions...

Check the winrm config and ensure basic auth is enabled:

*winrm get winrm/config/*

if basic auth is false set it to true (instructions further up in this 
thread).

You mention that both machines are on common domain but right now Ansible 
will not work with domain user accounts - so check that you are actually 
using a local account in your windows.yml.

Your windows.yml file shouldn't need to start with --- - mine doesn't 
anyway.

I had an issue with a windows server 2008 box that wasn't up to date with 
windows updates which caused winrm to fail as it was setting a very small 
limit on the allowed process size for commands run via winrm.  There was a 
specific patch for it but worth checking windows update is fully up to date 
if that's an option for you.

Your setup sounds pretty similar to one I have had working in the past. My 
controller was running centos 6.3 and I had it working against a win 7 host 
using a local account.

Hope this helps, let us know how you get on.

Jon
On Thursday, October 9, 2014 6:18:21 PM UTC+1, skinnedknuckles wrote:
>
> I've reinstalled everything and am still having trouble getting win_ping 
> to work.  Here is my info:
> Fedora 20
> Ansible 1.7.1
> Remote node running windows 7
> The WinRM script by Trond runs without errors on the remote node
> Control and Remote Machines are both on Lan with common domain w/o 
> firewalls
> So far as I can tell I've installed everything on control and remote 
> machine as described in documentation
>
> My inventory file contains
> [windows]
> 123.123.123.123
>
> My windows.yml file is in the group_vars directory and contains
> ansible_ssh_user: Administrator
> ansible_ssh_pass: ansiblepw
> ansible_ssh_port: 5986
> ansible_connection: winrm
>
> Should this file begin with "---"?
>
> Can you tell what I'm doing wrong?  Do you need any more information?
>
>
>
> [ansmgr@dhcp1-59-159 ansible]$ ansible windows -m win_ping --ask-pass 
> - 
> SSH password: 
> <123.123.123.123> ESTABLISH WINRM CONNECTION FOR USER: Administrator on 
> PORT 5986 TO 123.123.123.123 
> <123.123.123.123> WINRM CONNECT: transport=plaintext endpoint=
> https://123.123.123.123:5986/wsman 
> <123.123.123.123> WINRM CONNECTION ERROR: 500 WinRMTransport. [Errno 104] 
> Connection reset by peer 
> <123.123.123.123> WINRM CONNECT: transport=plaintext endpoint=
> http://123.123.123.123:5986/wsman 
> 123.123.123.123 | FAILED => Traceback (most recent call last): 
> File "/etc/ansible/lib/ansible/runner/__init__.py", line 549, in _executor 
> exec_rc = self._executor_internal(host, new_stdin) 
> File "/etc/ansible/lib/ansible/runner/__init__.py", line 707, in 
> _executor_internal 
> return self._executor_internal_inner(host, self.module_name, 
> self.module_args, inject, port, complex_args=complex_args) 
> File "/etc/ansible/lib/ansible/runner/__init__.py", line 870, in 
> _executor_internal_inner 
> conn = self.connector.connect(actual_host, actual_port, actual_user, 
> actual_pass, actual_transport, actual_private_key_file) 
> File "/etc/ansible/lib/ansible/runner/connection.py", line 44, in connect 
> self.active = conn.connect() 
> File "/etc/ansible/lib/ansible/runner/connection_plugins/winrm.py", line 
> 132, in connect 
> self.protocol = self._winrm_connect() 
> File "/etc/ansible/lib/ansible/runner/connection_plugins/winrm.py", line 
> 86, in _winrm_connect 
> protocol.send_message('') 
> File "/usr/lib/python2.7/site-packages/winrm/protocol.py", line 173, in 
> send_message 
> return self.transport.send_message(message) 
> File "/usr/lib/python2.7/site-packages/winrm/transport.py", line 76, in 
> send_message 
> response = urlopen(request, timeout=self.timeout) 
> File "/usr/lib64/python2.7/urllib2.py", line 127, in urlopen 
> return _opener.open(url, data, timeout) 
> File "/usr/lib64/python2.7/urllib2.py", line 404, in open 
> response = self._open(req, data) 
> File "/usr/lib64/python2.7/urllib2.py", line 422, in _open 
> '_open', req) 
> File "/usr/lib64/python2.7/urllib2.py", line 382, in _call_chain 
> result = func(*args) 
> File "/usr/lib64/python2.7/urllib2.py", line 1216, in http_open 
> return self.do_open(httplib.HTTPConnection, req) 
> File "/usr/lib64/python2.7/urllib2.py", line 1189, in do_open 
> r = h.getresponse(buffering=True) 
> File "/usr/lib64/python2.7/httplib.py", line 1045, in getresponse 
> response.begin() 
> File "/usr/lib64/python2.7/httplib.py", line 409, in begin 
> version, status, reason = self._read_status() 
> File "/usr/lib64/python2.7/httplib.py", line 365, in _read_status 
> line = self.fp.readline(_MAXLINE + 1) 
> File "/usr/lib64/python2.7/socket.py", line 476, in readline 
> data = self._sock.recv(self._rbufsize) 
> error: [Errno 104] Connection reset by peer
>
> On Saturday, June 28, 2014 7:16:15 AM UTC-5, Trond Hindenes wrote:
>>
>> I'm having trouble setting Ansible with WinRM. Here's my environment:
>> 10.10.50.4 - Win1 - the windows computer

[ansible-project] Re: Determine if on internal LAN

2014-10-15 Thread Rishi
Good idea, thanks.

On Wednesday, October 15, 2014 11:54:36 AM UTC-4, James Martin wrote:
>
> Rishi,
>
> Let's assume you have an inventory group called  "datacenter" that holds 
> all of your datacenter machines and an inventory group named "inhouse" that 
> holds all of your in-house machines.
>
> You would then have a group_var file called  "inventory/group_var/inhouse" 
> that would contain:
>
> url: http://my.internal.company.com
>
>
> And also  have a a group_var file called  "inventory/group_var/datacenter" 
> that would contain:
>
> url: http://my.datacenter.company.com
>
>
> your tasks would look something like:
>
> - name: get tmy file
>   get_url: {{ url }}/foo.pkg dest=/tmp/foo.pkg
>
>
>
> When your run your playbook in-house, it's going to use the internal url 
> based on the machine's membership to the inhouse group.  When the physical 
> machines have moved from in-house to datacenter, also change their 
> inventory group membership.  The playbook will now use the datacenter url 
> based on the machine's membership to the datacenter group.
>
>
> - James
>
> On Wednesday, October 15, 2014 11:07:09 AM UTC-4, Rishi wrote:
>>
>> I perform a couple steps during server provisioning in-house prior to 
>> sending out to a data center. We have most installers/packages available on 
>> some internal http servers to speed up retrieving them, I would like to 
>> keep the same playbook but change the url to retrieve installers from 
>> during the run based on current network.
>>
>> Any one have any clever ways to alter the url in a "get_url" command to 
>> choose the local network if on local network else use an external internet 
>> address?
>>
>> i.e.
>> if ansible_ssh_host is in 192.168.0.0/16 do foo else do bar.
>>
>

-- 
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/996e3720-9fb2-4bca-ac79-1f0f3b7e8e7c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Prompt question again. Thanks

2014-10-15 Thread Tiglath

Good rule.  Thanks
 
 
 
On Wednesday, October 15, 2014 2:16:13 PM UTC-4, Michael Peters wrote:

> vars_prompt goes on the play level, not the task level. It's not a 
> task and you don't have control over when the prompt happens. It will 
> ask you before the play starts to answer any questions in the prompt. 
>
> Just a helpful way to think about what can go in the task list: Is it 
> a module? ( 
> http://docs.ansible.com/list_of_all_modules.html). If not, then it 
> can't be a task. 
>
>
> On Wed, Oct 15, 2014 at 2:02 PM, Tiglath > 
> wrote: 
> > 
> > Between my lack of Ansible mastery and its kind of syntax, rare is the 
> day I 
> > don't get stuck... 
> > 
> > Either the syntax is not intuitive or I have no intuition. 
> > 
> > I am trying to do something very simple and it seems very complicated in 
> > Ansible.  I hope it just seems so. 
> > 
> > I  figure out what release to deploy in a play and then confirm the 
> release 
> > is correct, if not all stops, if correct run with the wind... 
> > 
> > So: 
> > 
> > If I put vars_prompt between the tasks it gives an error.   Where can 
> the 
> > prompt go then?When is code position indicative of order of 
> execution 
> > and when not? 
> > 
> > 
> > --- 
> > 
> > hosts: appserver 
> > 
> > tasks: 
> > 
> > - name: Get the latest release. 
> > 
> >local_action: shell grep XXX  /tmp/releases | cut -f2 -d':' | tr -d 
> "," | 
> > tr -d "'" 
> > 
> >register: rel 
> > 
> > --->>><  "Deploying release {{ rel.stdout }} Correct?  (y/n): "  > 
> prompt 
> > goes here  <<<  
> > 
> > - name: Remove old installation files. 
> > 
> >   script: /tmp/clean.sh "{{ rel.stdout }}" 
> > 
> > - name: Run local build. 
> > 
> >   local_action: shell /tmp/build.py "{{ inventory_hostname }}" "{{ 
> > rel.stdout }}" 
> > 
> > - name: Run deploy.py on target. 
> > 
> > script: /export/home/jsuriol/deploy/migration/apps/TV2G/tools/deploy.py 
> "{{ 
> > rel.stdout }}" 
> > 
> > Thank you for your patience with neophites... 
> > 
> > 
> > 
> > 
> > 
> > -- 
> > 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/1bbaf9f6-56df-41fa-b3fb-c78faa2d980b%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/34d19682-1481-4c97-bec1-c34093c96c54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Prompt question again. Thanks

2014-10-15 Thread Michael Peters
vars_prompt goes on the play level, not the task level. It's not a
task and you don't have control over when the prompt happens. It will
ask you before the play starts to answer any questions in the prompt.

Just a helpful way to think about what can go in the task list: Is it
a module? (
http://docs.ansible.com/list_of_all_modules.html). If not, then it
can't be a task.


On Wed, Oct 15, 2014 at 2:02 PM, Tiglath  wrote:
>
> Between my lack of Ansible mastery and its kind of syntax, rare is the day I
> don't get stuck...
>
> Either the syntax is not intuitive or I have no intuition.
>
> I am trying to do something very simple and it seems very complicated in
> Ansible.  I hope it just seems so.
>
> I  figure out what release to deploy in a play and then confirm the release
> is correct, if not all stops, if correct run with the wind...
>
> So:
>
> If I put vars_prompt between the tasks it gives an error.   Where can the
> prompt go then?When is code position indicative of order of execution
> and when not?
>
>
> ---
>
> hosts: appserver
>
> tasks:
>
> - name: Get the latest release.
>
>local_action: shell grep XXX  /tmp/releases | cut -f2 -d':' | tr -d "," |
> tr -d "'"
>
>register: rel
>
> --->>><  "Deploying release {{ rel.stdout }} Correct?  (y/n): "  > prompt
> goes here  <<< 
>
> - name: Remove old installation files.
>
>   script: /tmp/clean.sh "{{ rel.stdout }}"
>
> - name: Run local build.
>
>   local_action: shell /tmp/build.py "{{ inventory_hostname }}" "{{
> rel.stdout }}"
>
> - name: Run deploy.py on target.
>
> script: /export/home/jsuriol/deploy/migration/apps/TV2G/tools/deploy.py "{{
> rel.stdout }}"
>
> Thank you for your patience with neophites...
>
>
>
>
>
> --
> 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/1bbaf9f6-56df-41fa-b3fb-c78faa2d980b%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/CAJQqANejGW3-HLou6ztRN8_fPvBM-aesb6vzZn%3DVDm9piVB3kg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Prompt question again. Thanks

2014-10-15 Thread Tiglath
 
Between my lack of Ansible mastery and its kind of syntax, rare is the day 
I don't get stuck...  
 
Either the syntax is not intuitive or I have no intuition.  
 
I am trying to do something very simple and it seems very complicated in 
Ansible.  I hope it just seems so.  
 
I  figure out what release to deploy in a play and then confirm the release 
is correct, if not all stops, if correct run with the wind... 
 
So:
 
If I put vars_prompt between the tasks it gives an error.   Where can the 
prompt go then?When is code position indicative of order of execution 
and when not?  
 

---
 
hosts: appserver
 
tasks:
 
- name: Get the latest release.

   local_action: shell grep XXX  /tmp/releases | cut -f2 -d':' | tr -d "," | 
tr -d "'"

   register: rel

--->>><  "Deploying release {{ rel.stdout }} Correct?  (y/n): "  > prompt 
goes here  <<<    

- name: Remove old installation files.

  script: /tmp/clean.sh "{{ rel.stdout }}"
 
- name: Run local build.

  local_action: shell /tmp/build.py "{{ inventory_hostname }}" "{{ 
rel.stdout }}"
 
- name: Run deploy.py on target.

script: /export/home/jsuriol/deploy/migration/apps/TV2G/tools/deploy.py "{{ 
rel.stdout }}"

Thank you for your patience with neophites...  

 

 

-- 
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/1bbaf9f6-56df-41fa-b3fb-c78faa2d980b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] syntax error in vars bubstution [ shell module ]

2014-10-15 Thread Michael Peters
You need to quote the whole line, not just the templated part:

---
- hosts: service
  vars:
app_service_port: 8080
tomcat_home: /opt/apache-tomcat-8.0.9
  remote_user: deploy
  tasks:
  - name: stop tomcat
shell: "{{ tomcat_home }}/bin/shutdown.sh"
  - name: start tomcat
shell: "{{ tomcat_home }}/bin/startup.sh"

On Wed, Oct 15, 2014 at 12:20 PM, Subramanian Olagappan
 wrote:
> Hi Michael,
>
> ---
> - hosts: service
>   vars:
> app_service_port: 8080
> tomcat_home: /opt/apache-tomcat-8.0.9
>   remote_user: deploy
>   tasks:
>   - name: stop tomcat
> shell: "{{ tomcat_home }}"/bin/shutdown.sh
>   - name: start tomcat
> shell: "{{ tomcat_home }}"/bin/startup.sh
>
> olga@olga-vbox:~$ ansible-playbook test.yml
> ERROR: Syntax Error while loading YAML script, test.yml
> Note: The error may actually appear before this position: line 7, column 31
>   - name: stop tomcat
> shell: "{{ tomcat_home }}"/bin/shutdown.sh
> ^
> We could be wrong, but this one looks like it might be an issue with
> missing quotes.  Always quote template expression brackets when they
> start a value. For instance:
> with_items:
>   - {{ foo }}
> Should be written as:
> with_items:
>   - "{{ foo }}"
>
> Thanks,
> Olga
>
> On Tue, Oct 14, 2014 at 2:20 AM, Michael DeHaan  wrote:
>>
>> "Quoting also did not work. I added "sh" before the {{ and it worked."
>>
>> Please show me what you tried and what the output was?
>>
>> Thanks!
>>
>>
>> On Fri, Oct 10, 2014 at 5:24 AM, olga  wrote:
>>>
>>> Hi Michael,
>>>
>>> Quoting also did not work. I added "sh" before the {{ and it worked.
>>>
>>>   tasks:
>>>   - name: stop tomcat
>>> shell: sh {{ tomcat_home }}/bin/shutdown.sh
>>>   - name: start tomcat
>>> shell: sh {{ tomcat_home }}/bin/startup.sh
>>>
>>> Thanks for the link.
>>>
>>> Regards,
>>> Olga
>>>
>>> On Thursday, October 9, 2014 1:33:15 AM UTC+5:30, Michael Peters wrote:

 Try quoting the templated part. The {{ }} syntax markers mess up the
 yaml parsing - http://docs.ansible.com/YAMLSyntax.html#gotchas

 On Wed, Oct 8, 2014 at 3:41 PM, olga  wrote:
 > Hi,
 >
 > ---
 > - hosts: service
 >   vars:
 > app_service_port: 8080
 > tomcat_home: /opt/apache-tomcat-8.0.9
 >   remote_user: deploy
 >   tasks:
 >   - name: stop tomcat
 > shell: {{ tomcat_home }}/bin/shutdown.sh
 >   - name: start tomcat
 > shell: {{ tomcat_home }}/bin/startup.sh
 >
 > When i run this play, i get
 >
 > ERROR: Syntax Error while loading YAML script, test.yml
 > Note: The error may actually appear before this position: line 8,
 > column 28
 >
 >   tasks:
 >   - shell: {{ tomcat_home}}/bin/shutdown.sh
 >
 > is variable substitution not allowed in shell module.
 >
 > These are custom installed tomcat dir, so i have to use shell command
 > to
 > start and stop the tomcat. Also, has anyone verified if the java
 > process got
 > killed. I have seen some times that after shutdown, the java process
 > still
 > run. OR is there any easy method in ansible to do this.
 >
 > Thanks,
 > olaga
 >
 > --
 > 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/72a6af6d-d972-4747-bb6f-21eb0c63350b%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/7cc0daa5-8d6e-46d8-ba2b-1f35ff8acdc8%40googlegroups.com.
>>>
>>> For more options, visit https://groups.google.com/d/optout.
>>
>>
>> --
>> 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/n5jvt2qOI9I/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/CA%2BnsWgyu79FsM7xmxVjRThbhtzJiQaBuCJhBMni0m9JAwxjOyg%40mail.gmail.com.
>>

Re: [ansible-project] syntax error in vars bubstution [ shell module ]

2014-10-15 Thread Subramanian Olagappan
Hi Michael,

---
- hosts: service
  vars:
app_service_port: 8080
tomcat_home: /opt/apache-tomcat-8.0.9
  remote_user: deploy
  tasks:
  - name: stop tomcat
shell: "{{ tomcat_home }}"/bin/shutdown.sh
  - name: start tomcat
shell: "{{ tomcat_home }}"/bin/startup.sh

olga@olga-vbox:~$ ansible-playbook test.yml
ERROR: Syntax Error while loading YAML script, test.yml
Note: The error may actually appear before this position: line 7, column 31
  - name: stop tomcat
shell: "{{ tomcat_home }}"/bin/shutdown.sh
^
We could be wrong, but this one looks like it might be an issue with
missing quotes.  Always quote template expression brackets when they
start a value. For instance:
with_items:
  - {{ foo }}
Should be written as:
with_items:
  - "{{ foo }}"

Thanks,
Olga

On Tue, Oct 14, 2014 at 2:20 AM, Michael DeHaan  wrote:

> "Quoting also did not work. I added "sh" before the {{ and it worked."
>
> Please show me what you tried and what the output was?
>
> Thanks!
>
>
> On Fri, Oct 10, 2014 at 5:24 AM, olga  wrote:
>
>> Hi Michael,
>>
>> Quoting also did not work. I added "sh" before the {{ and it worked.
>>
>>   tasks:
>>   - name: stop tomcat
>> shell: sh {{ tomcat_home }}/bin/shutdown.sh
>>   - name: start tomcat
>> shell: sh {{ tomcat_home }}/bin/startup.sh
>>
>> Thanks for the link.
>>
>> Regards,
>> Olga
>>
>> On Thursday, October 9, 2014 1:33:15 AM UTC+5:30, Michael Peters wrote:
>>>
>>> Try quoting the templated part. The {{ }} syntax markers mess up the
>>> yaml parsing - http://docs.ansible.com/YAMLSyntax.html#gotchas
>>>
>>> On Wed, Oct 8, 2014 at 3:41 PM, olga  wrote:
>>> > Hi,
>>> >
>>> > ---
>>> > - hosts: service
>>> >   vars:
>>> > app_service_port: 8080
>>> > tomcat_home: /opt/apache-tomcat-8.0.9
>>> >   remote_user: deploy
>>> >   tasks:
>>> >   - name: stop tomcat
>>> > shell: {{ tomcat_home }}/bin/shutdown.sh
>>> >   - name: start tomcat
>>> > shell: {{ tomcat_home }}/bin/startup.sh
>>> >
>>> > When i run this play, i get
>>> >
>>> > ERROR: Syntax Error while loading YAML script, test.yml
>>> > Note: The error may actually appear before this position: line 8,
>>> column 28
>>> >
>>> >   tasks:
>>> >   - shell: {{ tomcat_home}}/bin/shutdown.sh
>>> >
>>> > is variable substitution not allowed in shell module.
>>> >
>>> > These are custom installed tomcat dir, so i have to use shell command
>>> to
>>> > start and stop the tomcat. Also, has anyone verified if the java
>>> process got
>>> > killed. I have seen some times that after shutdown, the java process
>>> still
>>> > run. OR is there any easy method in ansible to do this.
>>> >
>>> > Thanks,
>>> > olaga
>>> >
>>> > --
>>> > 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/
>>> 72a6af6d-d972-4747-bb6f-21eb0c63350b%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/7cc0daa5-8d6e-46d8-ba2b-1f35ff8acdc8%40googlegroups.com
>> 
>> .
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>  --
> 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/n5jvt2qOI9I/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/CA%2BnsWgyu79FsM7xmxVjRThbhtzJiQaBuCJhBMni0m9JAwxjOyg%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 ansib

Re: [ansible-project] Cloudformation - What Does This Mean?

2014-10-15 Thread James Martin
Ben is correct.  The change is determined by AWS CloudFormation API 
endpoint, not by Ansible itself.  Changes to resources, parameters, 
outputs, etc would indicate a change according to the Cloudformation API, 
not to timestamp alone.

On Wednesday, October 15, 2014 5:00:37 AM UTC-4, Ben Symonds wrote:
>
> I haven't actually checked the module code, but I think it _always_ makes 
> the request to cfn, and relies on cfn to determine whether there are any 
> changes or not. So it's up to cfn. Changing the timestamp of the template 
> file has no effect - the template content is unchanged so there is nothing 
> for cfn to do.
>
> On 14 October 2014 22:09, Tennis Smith > 
> wrote:
>
>>
>> I'm using the cloudformation module 
>>  to start a stack.  
>>
>> Everything works.  But, I'd like to update the stack now that it is 
>> running. 
>>
>> According to the documentation, the stack can be updated if the template 
>> changed (below)
>>
>> 
>>
>> Just touching the template file with new date values doesn't work.  What 
>> about the template has to change before the module will update a running 
>> stack?
>>
>> -T
>>
>> -- 
>> 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/6feec89e-4b9e-4f7b-941f-7ac31347c059%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/280f9157-1ba1-4294-8660-024565f4c336%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: Determine if on internal LAN

2014-10-15 Thread James Martin
Rishi,

Let's assume you have an inventory group called  "datacenter" that holds 
all of your datacenter machines and an inventory group named "inhouse" that 
holds all of your in-house machines.

You would then have a group_var file called  "inventory/group_var/inhouse" 
that would contain:

url: http://my.internal.company.com


And also  have a a group_var file called  "inventory/group_var/datacenter" 
that would contain:

url: http://my.datacenter.company.com


your tasks would look something like:

- name: get tmy file
  get_url: {{ url }}/foo.pkg dest=/tmp/foo.pkg



When your run your playbook in-house, it's going to use the internal url 
based on the machine's membership to the inhouse group.  When the physical 
machines have moved from in-house to datacenter, also change their 
inventory group membership.  The playbook will now use the datacenter url 
based on the machine's membership to the datacenter group.


- James

On Wednesday, October 15, 2014 11:07:09 AM UTC-4, Rishi wrote:
>
> I perform a couple steps during server provisioning in-house prior to 
> sending out to a data center. We have most installers/packages available on 
> some internal http servers to speed up retrieving them, I would like to 
> keep the same playbook but change the url to retrieve installers from 
> during the run based on current network.
>
> Any one have any clever ways to alter the url in a "get_url" command to 
> choose the local network if on local network else use an external internet 
> address?
>
> i.e.
> if ansible_ssh_host is in 192.168.0.0/16 do foo else do bar.
>

-- 
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/146c0343-f181-45e5-ade1-e0385486ec31%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Determine if on internal LAN

2014-10-15 Thread Rishi
I perform a couple steps during server provisioning in-house prior to 
sending out to a data center. We have most installers/packages available on 
some internal http servers to speed up retrieving them, I would like to 
keep the same playbook but change the url to retrieve installers from 
during the run based on current network.

Any one have any clever ways to alter the url in a "get_url" command to 
choose the local network if on local network else use an external internet 
address?

i.e.
if ansible_ssh_host is in 192.168.0.0/16 do foo else do bar.

-- 
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/4851987d-6bba-4f9c-9d45-9db6d6792db2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] RHEL6.6 and ControlPersist

2014-10-15 Thread Dag Wieers

Hi,

As some of you may know, Red Hat backported the ControlPersist 
functionality to the OpenSSH version that ships with RHEL6.


This is terrific since RHEL users can now use this technique to speed up 
Ansible.


However, after some testing it seems to fail for the very first 
connection. What happens is that the first connection, when the persistent 
connection has not been set up yet, fails. Any subsequent connection seems 
to work fine, but obviously this fails to work properly with Ansible.


I think this is a bug, has anyone tested this ?
Or am I doing something wrong here ?

--
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.1410151654210.28571%40pikachu.3ti.be.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] SIGHUP sent using ansible ?

2014-10-15 Thread Scott Sturdivant
FWIW, I too saw SIGHUPs as noted in this issue:
https://github.com/ansible/ansible/issues/3063

My resolution?  I just patched supervisord to handle it better (now fixed
in later releases), so your best bet may to find a workaround.

On Wed, Oct 15, 2014 at 8:03 AM, John Favorite 
wrote:

> My guess would be the fire and forget nature of using the shell command.
> If you ran '/usr/sbin/myprogram -C /etc/myconfig/myprogram.conf' it would
> die on exit. I'm curious why you need it instead of just doing:
>
> - service: name=httpd state=started
>
>
>
>
> On Wed, Oct 15, 2014 at 7:39 AM, Alainkr  wrote:
>
>> Hello,
>>
>> I'm very puzzled by the following:
>>
>> using regular ssh I'm not getting SIGHUP at the end.
>> using ansible SIGHUP get's sent  : strace output :
>>
>> 0x7f34a666c9d0, tls=0x7f34a666c700, child_tidptr=0x7f34a666c9d0) = 600
>> futex(0x7f34a666c9d0, FUTEX_WAIT, 600, NULL) = ? ERESTARTSYS (To be
>> restarted)
>> --- SIGHUP (Hangup) @ 0 (0) ---
>> +++ killed by SIGHUP +++
>>
>> This is using an adhoc commands such  :
>> -m shell -a "sudo /etc/init.d/myservice start"
>> -m shell -a "/etc/init.d/myservice start" -s
>> -m shell -a "/etc/init.d/myservice start" -s -c ssh
>>
>> I've tried -c ssh but behavior is unchanged.
>> I'm aware of the service module. But this is just an example.
>> The funny thing is that when using the service module no SIGHUP gets send
>>
>> My shell (bash)  has "huponexit   off" off couse.
>>
>> What is happening here ? Is this the excepted behavior ?
>>
>> I'm using ansible (1.7.1) paramiko (1.15.0) ( upgraded paramiko to
>>  (1.15.1)  same result )
>>
>> Thanks for your help. I'm kind of lost on this.
>>
>> Alain
>>
>>
>>
>>  --
>> 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/90ade591-bcd1-4913-b622-9f74d17c8430%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/CAKsMCERuyq0L%3D-rXdWyw1Uai6FvC%2BE1Xvb%3DLHYMFj21kD%3DuMyQ%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/CAPcsqxk_5yDOXJ_RA3AxUf4FFwVhSbDku9S1iU9xqOi6R5x80A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] SIGHUP sent using ansible ?

2014-10-15 Thread John Favorite
My guess would be the fire and forget nature of using the shell command. If
you ran '/usr/sbin/myprogram -C /etc/myconfig/myprogram.conf' it would die
on exit. I'm curious why you need it instead of just doing:

- service: name=httpd state=started




On Wed, Oct 15, 2014 at 7:39 AM, Alainkr  wrote:

> Hello,
>
> I'm very puzzled by the following:
>
> using regular ssh I'm not getting SIGHUP at the end.
> using ansible SIGHUP get's sent  : strace output :
>
> 0x7f34a666c9d0, tls=0x7f34a666c700, child_tidptr=0x7f34a666c9d0) = 600
> futex(0x7f34a666c9d0, FUTEX_WAIT, 600, NULL) = ? ERESTARTSYS (To be
> restarted)
> --- SIGHUP (Hangup) @ 0 (0) ---
> +++ killed by SIGHUP +++
>
> This is using an adhoc commands such  :
> -m shell -a "sudo /etc/init.d/myservice start"
> -m shell -a "/etc/init.d/myservice start" -s
> -m shell -a "/etc/init.d/myservice start" -s -c ssh
>
> I've tried -c ssh but behavior is unchanged.
> I'm aware of the service module. But this is just an example.
> The funny thing is that when using the service module no SIGHUP gets send
>
> My shell (bash)  has "huponexit   off" off couse.
>
> What is happening here ? Is this the excepted behavior ?
>
> I'm using ansible (1.7.1) paramiko (1.15.0) ( upgraded paramiko to
>  (1.15.1)  same result )
>
> Thanks for your help. I'm kind of lost on this.
>
> Alain
>
>
>
>  --
> 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/90ade591-bcd1-4913-b622-9f74d17c8430%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/CAKsMCERuyq0L%3D-rXdWyw1Uai6FvC%2BE1Xvb%3DLHYMFj21kD%3DuMyQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] SIGHUP sent using ansible ?

2014-10-15 Thread Alainkr
Hello,

I'm very puzzled by the following: 

using regular ssh I'm not getting SIGHUP at the end.
using ansible SIGHUP get's sent  : strace output : 

0x7f34a666c9d0, tls=0x7f34a666c700, child_tidptr=0x7f34a666c9d0) = 600
futex(0x7f34a666c9d0, FUTEX_WAIT, 600, NULL) = ? ERESTARTSYS (To be 
restarted)
--- SIGHUP (Hangup) @ 0 (0) ---
+++ killed by SIGHUP +++ 

This is using an adhoc commands such  :
-m shell -a "sudo /etc/init.d/myservice start"
-m shell -a "/etc/init.d/myservice start" -s
-m shell -a "/etc/init.d/myservice start" -s -c ssh

I've tried -c ssh but behavior is unchanged.
I'm aware of the service module. But this is just an example.
The funny thing is that when using the service module no SIGHUP gets send 

My shell (bash)  has "huponexit   off" off couse.

What is happening here ? Is this the excepted behavior ?

I'm using ansible (1.7.1) paramiko (1.15.0) ( upgraded paramiko to 
 (1.15.1)  same result ) 

Thanks for your help. I'm kind of lost on this.

Alain
 


-- 
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/90ade591-bcd1-4913-b622-9f74d17c8430%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Loop the Hosts in Ansible Playbook with_item or with any condition

2014-10-15 Thread Marc Patermann

aditya,

aditya varma schrieb (13.10.2014 09:57 Uhr):
Want to pass a json variables containing couple of ansible hosts to a 
ansible-playbook so the variables can be looped in for hosts one by 
one.similar to

I think I do not understand clearly what you really want, but:
Can't you just use "hosts" for the hosts you want to loop over, like it 
is intendet to and - if the action should run on another server - use 
the delegate_to option?

http://docs.ansible.com/playbooks_delegation.html#delegation

Marc

--
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/543E48C7.1050607%40ofd-z.niedersachsen.de.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Cloudformation - What Does This Mean?

2014-10-15 Thread Ben Symonds
I haven't actually checked the module code, but I think it _always_ makes
the request to cfn, and relies on cfn to determine whether there are any
changes or not. So it's up to cfn. Changing the timestamp of the template
file has no effect - the template content is unchanged so there is nothing
for cfn to do.

On 14 October 2014 22:09, Tennis Smith  wrote:

>
> I'm using the cloudformation module
>  to start a stack.
>
> Everything works.  But, I'd like to update the stack now that it is
> running.
>
> According to the documentation, the stack can be updated if the template
> changed (below)
>
> 
>
> Just touching the template file with new date values doesn't work.  What
> about the template has to change before the module will update a running
> stack?
>
> -T
>
> --
> 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/6feec89e-4b9e-4f7b-941f-7ac31347c059%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/CADVA9h_Ba2w4o9hb1ev27sPijky12DwQzBQb-7s%3DSgVc7RD2_g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] launch / shutdown a whole application

2014-10-15 Thread Torsten Reinhard
Hi, 

we have a huge application consisting of several components (Apache, 
Tomcat, Weblogic, ...Database)

To shutdown the system properly we want to follow a sequence starting at 
the "top" (Apache) down to the backend (Database)
For launching the system we do the reverse order - starting at the database 
and the UI (or interfaces) will be the last components launched.

For each component we have separate deployment playbooks with tags "stop" 
and "start".

Do i have to create 2 playbooks for the launch/shutdown than like? 

shutdown.yml
- include "apache.yml"
- include "tomcat.yml"
- include "servers.yml"
- include "databaseyml"

and anotherone like
- include "databaseyml"
- include "servers.yml"
- include "tomcat.yml"
- include "apache.yml"

Or is there any option to have only one playbook where I can toggle the 
order of the included playbooks?

Thanx for any ideas, 

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/7cd307e7-ad8b-439c-8517-662e7bacbdea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Relocate an rpm

2014-10-15 Thread James Morgan
Ok thanks for the reply. I'll try and avoid doing it in the first place but 
if I can't do that I'll use one of the two options you mention.

I've already used yumdownloader elsewhere to build a custom repo.

Thanks

On Friday, 10 October 2014 05:48:00 UTC+1, tkuratomi wrote:
>
> Yeah, the command module and either using yum --downloadonly or using 
> yumdownloader (from the yum-utils package) followed by rpm is the way 
> to go here.  Adding a means for the yum module to download an rpm is 
> probably a reasonable feature enhancement but it  doesn't exist at the 
> moment so the command module is the way to go. 
>
> -Toshio 
>
> On Wed, Oct 8, 2014 at 11:38 AM, James Morgan  > wrote: 
> > Hi, 
> > 
> > I have a relocatable rpm that I would like to install into a different 
> > directory. 
> > 
> > I have read that Yum doesn't really support this and a solution with yum 
> is 
> > to use 
> > 
> > yum install XXX --downloadonly --downloaddir=/tmp 
> > 
> > 
> > Then use rpm and --prefix 
> > 
> > http://research.cs.wisc.edu/htcondor/yum/#relocatable 
> > 
> > I was wondering if there was any way of doing this with the core yum 
> module. 
> > 
> > I appreciate that changing the install directory is not the best 
> approach 
> > but I have customers with non-standard release directories. 
> > 
> > My solution at the moment would be to use command and do things more 
> > manually for this pesky rpm. 
> > 
> > Thanks 
> > 
> > James 
> > 
> > -- 
> > 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/ebccbb60-c62a-4287-a989-6b05cc524d71%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/70bfd323-a2a0-4519-8855-d788775ae449%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] site.yml file location and roles

2014-10-15 Thread Daniel Laird
All,

Is it possible to have the site.yml file and hosts file in a subdirectory 
like this:

root/
   group_vars/
   roles
  
   sites/
 office_name/
   hosts
   site.yml
  
When I tried to do this with ansible-playbook sites/office_name/hosts -i 
sites/office_name/site.yml 
I got an error message about being unable to find roles.

Do I need to change the roles_path setting - or is this not possible.
The reason is for a shared project with multiple sites and I dont want 
everything at the top level.

Cheers
Dan

-- 
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/6b5064e9-32a8-448c-af88-34855ad23033%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.