Re: [ansible-project] Ansible 1.5.3 not running ruby scripts

2014-04-10 Thread James Tanner
On 04/09/2014 05:34 AM, Ramesh Raithatha wrote: Hello, I updated to ansible 1.5.3 and now i am not able to run my ruby scripts using "local_action" and "command" module. It was running perfectly fine with ansible 1.4.3. TASK: [Checking elb stat]

Re: [ansible-project] ansible-pull and group_vars

2014-04-10 Thread James Tanner
On 04/10/2014 09:38 AM, Fred Badel wrote: Hello, I am trying to set ansible-pull to provision ec2 instances ... with not much success so far ... I tried using the ec2.py dynamic inventory: ansible-pull -C feature/ci -d /home/ec2-user/ansible -i ansible/ec2.py tag_Name_qatest23 -U ssh://git

Re: [ansible-project] ec2.py groups

2014-04-10 Thread ghexsel
Sorry for necro-ing this. We solved this by adding the whole pair to the tag key itself, so it creates groups like tag_class_database_ (mapped from "class_database": ""). Now you can add machines to multiple groups, filter machines that are in more than one class, etc. On Friday, J

[ansible-project] ec2_group with port range?

2014-04-10 Thread ghexsel
Is there a way to define an ec2_group with port ranges, or maybe allow all ports for the security group? There is one example with a protocol of "all" which the code seems to map to -1, but if I use it, I get the following: ... boto.exception.EC2ResponseError: EC2ResponseError: 400 Bad Reques

Re: [ansible-project] lib/ansible/module_utils/known_hosts.py and sha1 import on 1.5.3, 1.5.4...

2014-04-10 Thread James Tanner
On 04/10/2014 09:24 AM, seanosh wrote: Not sure if this is a bug or not so I didn't want to file in GitHub just yet. A rough timeline: * Support added between 1.5.2 and 1.5.3 for checking hashed entries in SSH known_hosts files * 1.5.3 released * https://github.com/ansible/ansible/pull/6639 *

Re: [ansible-project] Ansible pattern for API-based config management

2014-04-10 Thread Paul Durivage
Hi Drew, You're right, the URI module is available. I didn't mention it because Salman mention he was going to be coordinating the automation for an entire cluster. The URI module is useful, yes, but interacting with a large API for complex tasks? That's what I meant when I said that I don't wa

Re: [ansible-project] Ensuring a command only runs once

2014-04-10 Thread James Tanner
On 04/09/2014 12:23 PM, Stefan Eriksson wrote: hi I have this exact issue but dont understand the anwer "Creates is the way to go here!" could anyone explain in little more detail? thanks. Den tisdagen den 6:e augusti 2013 kl. 03:09:21 UTC+2 skrev Jonathan Rowlands: Cool, thanks! On

Re: [ansible-project] Ansible pattern for API-based config management

2014-04-10 Thread Drew Northup
On Thursday, April 10, 2014 12:14:24 PM UTC-4, Paul Durivage wrote: > > The type of work you're looking to do is best handled by writing a > Cloudera module. I don't want to imagine how one might wrap a REST API in > a playbook -- that does not sound fun or reasonable. :) > Paul, It has alread

Re: [ansible-project] Run command on 1 server from group A, then run another command on 1 from group B, in loop

2014-04-10 Thread Paul Durivage
I don't have any examples for you, but Ansible is definitely the right tool for this kind of orchestration. I'm sure someone here can provide some samples. You'll want to write a playbook that enumerates these steps. Use the "serial" directive in your play so that only one server is touched at o

Re: [ansible-project] Single when for multiple tasks

2014-04-10 Thread Paul Durivage
You're looking for parameterized roles. Put the tasks in a role, call the role conditionally when the criteria is met. http://docs.ansible.com/playbooks_conditionals.html#applying-when-to-roles-and-includes On Thu, Apr 10, 2014 at 4:38 AM, Stephan S. wrote: > Hello. > > I would like to know i

Re: [ansible-project] Ansible pattern for API-based config management

2014-04-10 Thread Paul Durivage
The type of work you're looking to do is best handled by writing a Cloudera module. I don't want to imagine how one might wrap a REST API in a playbook -- that does not sound fun or reasonable. :) On Wed, Apr 9, 2014 at 2:11 PM, Salman Haq wrote: > I am exploring automation of a Hadoop cluster

Re: [ansible-project] Using a sigle 'when' for multiple tasks

2014-04-10 Thread Paul Durivage
Using a role is the way to go here. Yes, you'll need to physically crate the role and use 3 files, but conditionally running the role with a "when" statement is the only way, I think, that you can avoid writing "when: a == b" 10 times. Why do you need 3 files for your role? You said it was simpl

[ansible-project] Run command on 1 server from group A, then run another command on 1 from group B, in loop

2014-04-10 Thread Vladimir Mihailenco
Hello, I have 2 Ansible groups: - nginx_servers. - api_servers. I am trying to automate following: 1. Select 1 API server. 2. Mark selected API server as down in the all nginx configs. Reload nginx. 3. Restart selected API server. 4. Mark selected API server as up in the all nginx configs. 5. Got

[ansible-project] Getting bug fix (pull request) into develop branch

2014-04-10 Thread Patrick Galbraith
Hi all, I have a very simple pull request at https://github.com/CaptTofu/ansible/compare/nova_compute. This fix makes it so the ansible module, nova_compute, works with HP Cloud and any cloud provider that has more than one region. It simply does this by providing the region name which is used

[ansible-project] ansible-pull and group_vars

2014-04-10 Thread Fred Badel
Hello, I am trying to set ansible-pull to provision ec2 instances ... with not much success so far ... I tried using the ec2.py dynamic inventory: ansible-pull -C feature/ci -d /home/ec2-user/ansible -i ansible/ec2.py tag_Name_qatest23 -U ssh://git@repo/infra/ansible-play.git local.yml and I

[ansible-project] lib/ansible/module_utils/known_hosts.py and sha1 import on 1.5.3, 1.5.4...

2014-04-10 Thread seanosh
Not sure if this is a bug or not so I didn't want to file in GitHub just yet. A rough timeline: * Support added between 1.5.2 and 1.5.3 for checking hashed entries in SSH known_hosts files * 1.5.3 released * https://github.com/ansible/ansible/pull/6639 * 1.5.4 released Looks like PR #6639 didn'

[ansible-project] Single when for multiple tasks

2014-04-10 Thread Stephan S.
Hello. I would like to know if it is possible to enclose multiple tasks with one when clause. I am trying to avoid to use the same when statement for all of my tasks in the same playbook. Furthermore, as a requirement is that the above should be implemented while using a single playbook. So a

[ansible-project] Pre-Conditions for a role to execute tasks

2014-04-10 Thread Rui Yang
Hi, Suppose I have a role called Ruby. I will 1. install build tools 2. download ruby source 3. compile 4. install Because it takes long time to do all these tings and I don't want to it it the expected Ruby already installed. How could I do it? I could do it using the "when" condition on eve

[ansible-project] Ansible pattern for API-based config management

2014-04-10 Thread Salman Haq
I am exploring automation of a Hadoop cluster. The vendor (Cloudera) requires that all configuration happen through a REST API. See [1] for Cloudera Python API client. My question is: Is there a prior example of an Ansible playbook that wraps an HTTP api? Thanks! Salman [1] http://cloudera.gi

Re: [ansible-project] Ensuring a command only runs once

2014-04-10 Thread Stefan Eriksson
hi I have this exact issue but dont understand the anwer "Creates is the way to go here!" could anyone explain in little more detail? thanks. Den tisdagen den 6:e augusti 2013 kl. 03:09:21 UTC+2 skrev Jonathan Rowlands: > > Cool, thanks! > > On Monday, August 5, 2013 9:07:36 PM UTC-4, Michael De

[ansible-project] Using a sigle 'when' for multiple tasks

2014-04-10 Thread Stephan S.
Hello, i have a playbook which contains 10 tasks. I want to run those tasks only if a when clause if filled. My first approach was to put on every task the when. E.g.: *- name: My command command: sudo install when: a == b* The above example worked fine but was not ideal. Th

[ansible-project] Ansible 1.5.3 not running ruby scripts

2014-04-10 Thread Ramesh Raithatha
Hello, I updated to ansible 1.5.3 and now i am not able to run my ruby scripts using "local_action" and "command" module. It was running perfectly fine with ansible 1.4.3. TASK: [Checking elb stat] * <127.0.0.1> REMOTE_MODULE command elbinfo

[ansible-project] Issue with loop in template

2014-04-10 Thread Pawel Peryga
Hi, I have some issues with for loop in jinja2 template. In hosts_vars/name_of_host i have defined: add_php_packages: - php5-xcache apps: - { ... postgres: { db_host: 'xxx', db_user: 'xxx', db_name: 'some_name', db_pass: 'xxx', db_port: 5432

[ansible-project] Re: AWS prives required aren't documented

2014-04-10 Thread Will Thames
This is difficult because the underlying library used to talk to AWS, boto, doesn't often expose this either. This is really an AWS question rather than an Ansible question. If you run your playbook with -vvv you might get more of the error messages - or at least it should be obvious where it'

[ansible-project] Re: cannot open `/etc/sudoers' for reading

2014-04-10 Thread Makimoto Marakatti
Petr, Adam, you are both right. I't amazing how you don't see the trees because of the forest sometimes. Thanks both. Very much solved. On Wednesday, 9 April 2014 19:57:35 UTC+1, Adam Morris wrote: > > > > On Wednesday, April 9, 2014 9:30:38 AM UTC-7, Petr Sukharev wrote: >> >> >> >>> And in theo

[ansible-project] Avoid running pre/post tasks without roles/tasks

2014-04-10 Thread Hagai Kariti
Hi all. I have a master deployment playbook that more or less includes all of my servers, which I use with tags to deploy only the apps/configs I want at the time. Hosts are grouped into hostgroups by roles and each hostgroup has it's own pre/post tasks for handling load-balancers, etc. It look

Re: [ansible-project] 1.5.4: apt dist-upgrade fails with "No such file or directory"

2014-04-10 Thread Jens-Christian Fischer
as stated in the subject: It is ansible 1.5.4 cheers jc Am Mittwoch, 9. April 2014 15:53:17 UTC+2 schrieb Michael DeHaan: > > For starters, what version of Ansible is this? > > Thanks! > > > > > On Tue, Apr 8, 2014 at 4:53 AM, Jens-Christian Fischer > > > wrote: > >> I am trying to upgrade all