Re: [ansible-project] In a large enviroment, with duplicated stacks, why use group_vars and host_vars instead of vars_files ?

2014-07-24 Thread Luca Carboni
I like group_vars and host_vars. Using group_vars and host_vars, we have a lot of files for hosts. But, if we use group_vars, and vars_files, we can reduce drastically the number of files, in one or two file, one for credentials and one for other variables . vars_files are not described in

Re: [ansible-project] calculate from facts

2014-07-24 Thread Nico K.
I'm actually using this in a template, however the behavior is not as expected: someVar = {{ ansible_memtotal_mb / 4|int }} The result is '256.0', same when I remove the |int and same when I do * 0.25. Op maandag 17 februari 2014 16:15:07 UTC+1 schreef Brian Coca: something like

Re: [ansible-project] Re: How to detect why Ansible playbook hangs during execution

2014-07-24 Thread Tony Marin
I use a screen trick but mostly useful when using commands modules. Anyway, if it hangs doing apt upgrade, the behavior should be the same if your run it as a command. - debug: msg=Please, connect to {{ inventory_hostname }}, screen -r, and respond the possible questions. when:

[ansible-project] ansible ovirt module

2014-07-24 Thread Piet83
Hello, I'm trying to setup vm provisioning for Rhev with the ansible ovirt module. I have installed ovirt-engine-sdk-python-3.4.0.7-1.el6.noarch on my Centos 6.5 Ansible server and created a simple playbook to play around with this. The playbook tries to provision a vm based on a template

[ansible-project] Play recap or current status programmatically available in task?

2014-07-24 Thread Daniel Schroeder
Hello, I'd like to send a summary of the run (basically the play recap which is shown after playbook execution on the command line) to a hipchat room. PLAY RECAP host1: ok=8changed=0unreachable=0failed=0

[ansible-project] Server Side Module

2014-07-24 Thread Timothy Vandenbrande
(This is a copy from the Ansible Development group, but it seems there aren't as many ppl active there) Hey, I tried making a win_copy module for ansible, but misunderstood Mr De Haan a bit. (on GitHub: https://github.com/ansible/ansible/pull/8241) I thought with an action plugin he meant to

Re: [ansible-project] Server Side Module

2014-07-24 Thread Michael DeHaan
We will answer on the ansible-devel group. Patience grasshopper, we've got all the heavy guns on that side anyway, but have been frying some other fish so don't have our usual 15 second response time :) On Thu, Jul 24, 2014 at 4:19 AM, Timothy Vandenbrande timothy.vandenbra...@gmail.com

Re: [ansible-project] What is the best way of restarting services that are part of a cluster without taking the cluster down?

2014-07-24 Thread Michael DeHaan
Is there a way to tell ansible to set a service restart task sometime in the future? Say, right now for node1, 5 minutes later for node2, 10 minutes later for node3, and so on. There is a module for at which could be used to do this. at runs some commands at scheduled times in the future,

Re: [ansible-project] shortcuts for OpenStack operations

2014-07-24 Thread Michael DeHaan
Common auth functions for things like ec2 live here - https://github.com/ansible/ansible/tree/devel/lib/ansible/module_utils OpenStack really needs stubs here for common auth, and then it can take variables like EC2/RAX/GCE and others. This would also make sure all that happens in one place.

Re: [ansible-project] In a large enviroment, with duplicated stacks, why use group_vars and host_vars instead of vars_files ?

2014-07-24 Thread Michael DeHaan
If your variable information is about multiple hosts, it belongs in group_vars not host_vars. Consider applying more groups if you wish to include them. vars_files is definitely subscribed, but most people set variables in roles now, rather than in the play at the top. You are welcome to use

Re: [ansible-project] calculate from facts

2014-07-24 Thread Michael DeHaan
The precedence of the | is high in Jinja2. You'll need some parenthesis. On Thu, Jul 24, 2014 at 5:14 AM, Nico K. nkrabsh...@gmail.com wrote: I'm actually using this in a template, however the behavior is not as expected: someVar = {{ ansible_memtotal_mb / 4|int }} The result is

Re: [ansible-project] Debugging templates

2014-07-24 Thread Michael DeHaan
Your playbook appears to be manually typed in as I would expect to see tasks starting with a -. Can you please be sure to copy/paste the actual playbook. I say this because even the first task is not correctly formatted, otherwise I would suggest this error with respect to the second, and also

Re: [ansible-project] Play recap or current status programmatically available in task?

2014-07-24 Thread Michael DeHaan
The answer to accessing events programmatically is a callback plugin, and Matt Martz from Rackspace contributed one exactly for hipchat. https://github.com/ansible/ansible/blob/devel/plugins/callbacks/hipchat.py See the docs about callback plugins, but basically you just need to have this stored

Re: [ansible-project] ansible ovirt module

2014-07-24 Thread Michael DeHaan
Are their any ovirt users that would like to help with this one? https://github.com/ansible/ansible/commits/devel/library/cloud/ovirt On Thu, Jul 24, 2014 at 4:26 AM, Piet83 petersmallega...@gmail.com wrote: Hello, I'm trying to setup vm provisioning for Rhev with the ansible ovirt

Re: [ansible-project] locations for the lookup('file'...)

2014-07-24 Thread Michael DeHaan
It won't look in the playbook root when inside a role, no.Sorry I mispoke on that one. You can path the src as {{ lookup('file', playbook_dir + '/filename') }} if you want this, and it will find things there using the (derived) path of the playbook root. Ansible will look in the root if you

Re: [ansible-project] Re: How to detect why Ansible playbook hangs during execution

2014-07-24 Thread Karl E. Jorgensen
Hi On Tue, Jul 22, 2014 at 02:41:53PM -0700, Michael Palumbo wrote: So there is no solution to avoid being stuck on the following? It happens to me often when I am upgrading the system! - name: upgrade all safe packages sudo: yes apt: upgrade=safe Is there at least a way to see the

Re: [ansible-project] ansible ovirt module

2014-07-24 Thread Vincent Van der Kussen
I might have a look at this. Not sure if the API has changed over time. I still have a RHEV setup running where I can test on Regards, Vincent On Thu, Jul 24, 2014 at 1:10 PM, Michael DeHaan mich...@ansible.com wrote: Are their any ovirt users that would like to help with this one?

Re: [ansible-project] ansible ovirt module

2014-07-24 Thread Piet83
That would be very much appreciated. Ansible is awesome. If I need to provide more info please let me know. Regards, Peter Op donderdag 24 juli 2014 13:49:37 UTC+2 schreef Vincent Van der Kussen: I might have a look at this. Not sure if the API has changed over time. I still have a RHEV

[ansible-project] stat upside down

2014-07-24 Thread 'Diogene Laerce' via Ansible Project
Hi, I have this strange issue. The following code was working fine (I think) as : - name: Verify Python-3.4.1.tgz download stat: path=/tmp/Python-3.4.1.tgz register: a - name: Extract archive unarchive: src=/tmp/Python-3.4.1.tgz dest=/home/{{ user_installer }}/src

Re: [ansible-project] What is the best way of restarting services that are part of a cluster without taking the cluster down?

2014-07-24 Thread Michael Peters
On Thu, Jul 24, 2014 at 7:00 AM, Michael DeHaan mich...@ansible.com wrote: You could also set a simple play like this, which would probably be cleaner: - hosts: blarg serial: 1 tasks: - pause: seconds={{ n }} - service: name=foo state=restarted Is there a way to do something

[ansible-project] autoscaling_group + add_host == not possible?

2014-07-24 Thread Guy Matz
Hi! Is there any way to provision hosts built by a rax_scaling_group? Is it possible to re-read dynamic inventory midway through the run - after the servers have been built - and have them ansibled? Or is the only option to have them pull after they build? Thanks a lot! Guy -- You

Re: [ansible-project] autoscaling_group + add_host == not possible?

2014-07-24 Thread Michael Peters
If I understand correctly, this is what add_hosts is for. After you've dynamically created a host you can add it to a group and then in a subsequent play include a role that would configure that group. Is that what you're looking for? On Thu, Jul 24, 2014 at 9:43 AM, Guy Matz guym...@gmail.com

[ansible-project] Update : stat upside down

2014-07-24 Thread 'Diogene Laerce' via Ansible Project
Hi, I have this strange issue. The following code was working fine (I think) as : - name: Verify Python-3.4.1.tgz download stat: path=/tmp/Python-3.4.1.tgz register: a - name: Extract archive unarchive: src=/tmp/Python-3.4.1.tgz dest=/home/{{ user_installer }}/src

Re: [ansible-project] Calling Tags From a Playbook

2014-07-24 Thread Greg Swift
So In my proposal you would specify use_tags (or whatever) when calling the role specifically, not at the play level. If i'm bringing in multiple roles it seems like it would make sense to support it at the role level, or i guess maybe at both? Maybe I'm just over thinking it, but i can

Re: [ansible-project] autoscaling_group + add_host == not possible?

2014-07-24 Thread Guy Matz
Right, but with an auto-scaling group I don't know of a way to get the new hostnames of the servers the AS group creates . . . the new host are not returned in the output from the call to create the autoscaling group Thanks, Guy On Thursday, July 24, 2014 10:09:02 AM UTC-4, Michael Peters

[ansible-project] Re: Connect to remote servers

2014-07-24 Thread Sisu
I found my problem. As I was running ansible with sudo (-s) parameter, my ssh-agent socket was forwarded for the regular user only. Then I need to add sudo: yes to all the tasks I need sudo and be sure the task where I run ssh to remote tasks has no sudo. This link helped me to find the

Re: [ansible-project] Nested directory walking question

2014-07-24 Thread Bill Lubanovic
Thanks, Michael. It looks like with_fileglob() only shows files, not directories, so that wouldn't work for me. I'm testing a workaround using find or ls, then split() to grab b, c, and d. It would be nice to pass b and c as arguments to a task using the synchronize module. On Wednesday, July

[ansible-project] Defining variables and save them as json file.

2014-07-24 Thread Marcin Prączko
Hi, I struggle with some issue with variables definition which I am not totally understand and can't find help in ansible docs. I am trying to have nice variables structure and save it as json file (re-use as local facts). So I have *groups_vars* file: g_core_vars: version : 0.1.0

Re: [ansible-project] autoscaling_group + add_host == not possible?

2014-07-24 Thread Michael DeHaan
Tower provisioning callbacks embedded into the image are a GREAT solution for this. http://www.ansible.com/tower Alternatively schedule a run to configure and apply policy periodically, only adding machines into the LB once configured. Alternatively, ansible-pull The provisioning callbacks are

Re: [ansible-project] What is the best way of restarting services that are part of a cluster without taking the cluster down?

2014-07-24 Thread David Reagan
A possible workaround would be to make a somewhat non-idiomatic version of 'handlers' by putting the tasks that restart the services in a separate play in the end of your playbook with serial: 1. This will cause these tasks to run one after the other. You would also have 'when' conditionals on

[ansible-project] psycopg2.ProgrammingError: conflicting or redundant options

2014-07-24 Thread John Oliver
ansible 1.6.6 This stanza in my playbook: - name: Create database user postgresql_user: name={{rc_db_user}} password={{rc_db_pass}} role_attr_flags=NOSUPERUSER,NOCREATEROLE,NOCREATEUSER,NOCREATEDB login_user={{pg_user}}

Re: [ansible-project] autoscaling_group + add_host == not possible?

2014-07-24 Thread James Martin
Instead of baking the Tower callback script into the AMI, it also can be baked into the ASG's Launch Config User Data. That may be a bitter easier to manage. - James On Thursday, July 24, 2014 11:26:39 AM UTC-4, Michael DeHaan wrote: Tower provisioning callbacks embedded into the image are

Re: [ansible-project] What is the best way of restarting services that are part of a cluster without taking the cluster down?

2014-07-24 Thread Michael Peters
On Thu, Jul 24, 2014 at 11:54 AM, David Reagan jer...@gmail.com wrote: So, handlers seem like they are just special tasks that you can call with the notify option. If that's the case, couldn't I just make a handler that uses the at module instead of the service module? Actually, I think I've

Re: [ansible-project] autoscaling_group + add_host == not possible?

2014-07-24 Thread Guy Matz
:-( I'm on Rackspace :-( ;-) On Thursday, July 24, 2014 1:53:30 PM UTC-4, James Martin wrote: Instead of baking the Tower callback script into the AMI, it also can be baked into the ASG's Launch Config User Data. That may be a bitter easier to manage. - James On Thursday, July 24,

[ansible-project] Subversion only on server

2014-07-24 Thread Mauricio Tavares
If I am storing templates and other files in subversion, does the client need to be able to reach the svn server or can I just have the ansible server grab files from svn server and feed them to client? -- You received this message because you are subscribed to the Google Groups Ansible

[ansible-project] tags

2014-07-24 Thread Michael Dur
I notice when you try use a tag that does not exist ansible happily prints those that do exist in the error output. Would it be possible/desirable to have an option to just print the tags on demand? How about a tree of playbooks by tags (think of the output of the utility tree)? Our

[ansible-project] set_fact on 'meta' playbook

2014-07-24 Thread Michael Dur
I have a role who's sole purpose is as a meta playbook. It has a bunch of includes in meta/main.yml: allow_duplicates: no dependencies: - { role: feature/zypper, when: common_has_executed is defined } - { role: feature/rc.firewall, when: common_has_executed is defined } - { role: base/base,

Re: [ansible-project] Variable registration step, ignore_errors, and idempotency

2014-07-24 Thread Synaesthete
Perfect, exactly what I needed. Thanks! On Wednesday, July 23, 2014 6:15:36 PM UTC-4, Michael DeHaan wrote: Instead of ignore_errors: True, consider: failed_when: False The reporting of changed always can be fixed with changed_when: False On Wed, Jul 23, 2014 at 1:14 PM, Synaesthete

[ansible-project] Error 'msg: You need to be root to perform this command.' with sudo on

2014-07-24 Thread Thomas Hudson
I'm getting this error with the following playbook: --- # file: deploy.yml # usage: ansible-playbook deploy.yml --inventory-file hosts-file --extra-vars service_name=service-name rpm_src_url=rpm URL # extra-vars: # service_name- name of the RPM service e.g. medio-spitback #

[ansible-project] Newby Requirements and missing workarounds

2014-07-24 Thread Bastian Bringenberg
Hey together, I am working with ansible for a few days now and it is perfect and really what I needed, but there are a few things I am not able to solute for myself and where I have ( in my opinion ) ugly workarounds that should be able to be done a lot smoother. *1.) Merging Variables per

Re: [ansible-project] Error 'msg: You need to be root to perform this command.' with sudo on

2014-07-24 Thread Michael DeHaan
What am I doing wrong? Not running this step as root. Consider remote_user: root in your playbook for this step, as you can't run it as user raven. Also, sudo'ing from raven to raven is a little strange, I think you probably want to just not set sudo_user, then it would assume raven is sudoing

Re: [ansible-project] issue setting tags on ec2 module

2014-07-24 Thread Brent Langston
On Tue, Jul 22, 2014 at 3:13 PM, Michael DeHaan mich...@ansible.com wrote: Also local_action is usually not needed in cloud provisioning tasks as you can just have a play that talks to localhost yeah, this was written before localhost was handled the way it is today. I haven't gone back and

Re: [ansible-project] unable to update sudoers file on RH6u5 with validate option.

2014-07-24 Thread Michael DeHaan
H. No such file or directory *MIGHT* be referring to visudo. Can you try explicitly pathing it? On Thu, Jul 24, 2014 at 9:05 AM, Yasir Saleem yasir...@gmail.com wrote: Hi, I am not able to change '/etc/sudoers' file successfully on RH 6.5 (Santiago) when using validate option. The

Re: [ansible-project] stat upside down

2014-07-24 Thread Michael DeHaan
That doesn't quite follow for me. However, I think you might really want this: when: a is defined and a.stat.isfile OR (depending on use case) when: a is defined and not a.stat.isfile Maybe try one of those first... On Thu, Jul 24, 2014 at 9:32 AM, 'Diogene Laerce' via Ansible Project

Re: [ansible-project] Calling Tags From a Playbook

2014-07-24 Thread Michael DeHaan
Role and play level both would be acceptable, but I'd want it in both. We'd need to find a nice way to work it into the docs on tags w/o making it too confusing. On Thu, Jul 24, 2014 at 10:36 AM, Greg Swift gregsw...@gmail.com wrote: So In my proposal you would specify use_tags (or

Re: [ansible-project] Nested directory walking question

2014-07-24 Thread Michael DeHaan
I wouldn't shell out. I'd call python's very handy os.path.walk with a custom function. If you'd like to talk about this, ansible-devel is probably a bit more on topic (and I'm trying to spur that list into greater life). On Thu, Jul 24, 2014 at 10:05 AM, Bill Lubanovic b...@madscheme.com

[ansible-project] Re: psycopg2.ProgrammingError: conflicting or redundant options

2014-07-24 Thread John Oliver
OK, I'm going to answer my own question :-) I got the conflicting or redundant options when I used a command: It turns out that NOSUPERUSER is sufficient, and psycopg just throws a fit instead of accepting the redundant permissions. -- You received this message because you are subscribed to

Re: [ansible-project] Defining variables and save them as json file.

2014-07-24 Thread Michael DeHaan
If you have variables defined centrally, use them via vars_files, group_vars, or whatever, and you don't need to copy them to local facts *at all*. Local facts are there for when an administrator wants to make the mortals who use a system be able to configure it basically. (Or it's a shortcut to

Re: [ansible-project] Subversion only on server

2014-07-24 Thread Michael DeHaan
Could go either way. If you had a pattern like so: - hosts: localhost tasks: - svn: ... - hosts: webservers tasks: - synchronize: ... You could do a local checkout to the server once and then blast it out, rather than have every server connect to SVN directly. unarchive would be

Re: [ansible-project] What is the best way of restarting services that are part of a cluster without taking the cluster down?

2014-07-24 Thread Michael DeHaan
Right now handlers are just about notifying things in the context of one host. There's not (yet) a concept of a global handler, nor really a global: True kind of variant on set_fact. If there were, it would be easy to set a global flag True if a particular host hit a state, and then use that

Re: [ansible-project] Update : stat upside down

2014-07-24 Thread Michael DeHaan
I think I replied to the previous copy of this one, please see the other thread. It can sometimes be confusing as the very first post to the list is moderated to prevent spam, so I occasionally double approve a duplicate post. On Thu, Jul 24, 2014 at 10:11 AM, 'Diogene Laerce' via Ansible

Re: [ansible-project] set_fact on 'meta' playbook

2014-07-24 Thread Michael DeHaan
Well... sort of, not really. What happens when you when a role, it applies a when as the first condition of every task in the role. So I suspect you have applied the when to your set_fact :) All the is_executed stuff is generally non-idiomatic, the goal of a playbook is to allow repeated

Re: [ansible-project] Newby Requirements and missing workarounds

2014-07-24 Thread Michael DeHaan
On Thu, Jul 24, 2014 at 2:38 PM, Bastian Bringenberg avalarionavar...@googlemail.com wrote: Hey together, I am working with ansible for a few days now and it is perfect and really what I needed, but there are a few things I am not able to solute for myself and where I have ( in my opinion )

Re: [ansible-project] Re: psycopg2.ProgrammingError: conflicting or redundant options

2014-07-24 Thread Michael DeHaan
Yeah we should totally catch the Exception and make it look friendly in output regardless, can you file a github ticket on that? We like to treat python tracebacks as bugs even if they are informing someone of an error condition. Thanks! On Thu, Jul 24, 2014 at 6:47 PM, John Oliver

Re: [ansible-project] Ansigenome: A tool to help you gather information and manage your roles

2014-07-24 Thread Michael DeHaan
On Tue, Jul 22, 2014 at 6:47 PM, Nick Janetakis nick.janeta...@gmail.com wrote: Unclear of how inventory and example playbooks are related. In a lot of cases the playbook itself is always the same except for the name of the role. I have around 20 roles on the galaxy and pretty much all of

Re: [ansible-project] using 2 loops with_first_found and with_items

2014-07-24 Thread Michael DeHaan
Can't combine these two things. Also, when using with_foo: var, don't use jinja2. Not like: with_items: {{ foo }} Do it like so: with_items: alist_variable I'd just have a bunch of templates like so: - template: src={{ item}} dest=/etc/apt/sources.list.d/{{ item.basename }} with_fileglob:

[ansible-project] Best Practice to deploy your fleet with asg module

2014-07-24 Thread raul rodriguez
Hi guys, I've been a very happy ansible user for the past 3 months, and I found the docs community are very helpful. But now, I'm looking to deploy three small asg groups. I've been looking to find the best way to do this, but while there is an example for asg module, I haven't seen any best

Re: [ansible-project] Dynamic inventories and variables best practices.

2014-07-24 Thread Michael DeHaan
So quick 'my issue' which looks like 'chicken and egg' problem ;) 1. I would like to use ansible to provision servers. 2. I would like to use ansible to do some small changes on servers (for example add / remote some account etc - depends of dynamic work) 3. I would like to have records

Re: [ansible-project] Debugging templates

2014-07-24 Thread Matt Clarkson
Hi Michael, Thanks for your response. The config in my original email was as it was in my playbook. That being said, your hint to add list item delimiters in front of my tasks did the trick. I am now able to run the tasks. Thanks for that. MTC On Thursday, July 24, 2014 7:06:06 PM

[ansible-project] Ansible 1.6.9 Released

2014-07-24 Thread James Cammarata
Hi everyone, We have released Ansible 1.6.9, which also addresses some regressions in module parameter parsing introduced by the 1.6.7 security release. This update is available via PyPi and releases.ansible.com now, and packages for distros will be available as soon as possible. Thanks! --