[ansible-project] include another role's variables without running it's tasks?

2014-05-27 Thread Brice Burgess
I often need to access the default variables of another role. Currently I'm doing this via role dependencies, and passing a special variable to skip running a roles tasks. E.g. ``` :: my_role/meta/main.yml :: dependencies: - { role: other_role, skip_tasks: True } ::

[ansible-project] Setting a variable by conditional in a playbook

2014-05-27 Thread Lars Sommer
I have spent the last few hours trying to find a way to do this and keep running into formatting issues with every suggestion I find. What I am trying to accomplish is to have a variable that is set based on the value of another variable. So if {{ group }} == dev* then I want to set uwsgi_env:

[ansible-project] Synchronize module and with_first_found

2014-05-27 Thread Carlos A. Carnero Delgado
Hi, I (an Ansible newb) need to pass a directory of configuration files to remote nodes, so that the files on the remote end should *exactly* mirror what I have on the Ansible side. For instance, in my files directory (using a role) I have the following directories

Re: [ansible-project] with_sequence: / with_items: question

2014-05-27 Thread Matt Martz
Your with_items or with_sequence is indented too far. It should match the indentation of register and name. Also be aware of how register and with_ works. There are some docs on the playbooks loops page in the docs. On Tuesday, May 27, 2014, Jimmy Prescott jimmynapk...@gmail.com wrote: I am

Re: [ansible-project] with_sequence: / with_items: question

2014-05-27 Thread Jimmy Prescott
Thanks Matt! On Tuesday, May 27, 2014 11:44:28 AM UTC-5, Matt Martz wrote: Your with_items or with_sequence is indented too far. It should match the indentation of register and name. Also be aware of how register and with_ works. There are some docs on the playbooks loops page in the

Re: [ansible-project] Template/File path for dependencies

2014-05-27 Thread Michael DeHaan
I don't understand what you are suggesting to implement, though this is probably a good discussion for ansible-devel instead of the main list. We would like to see what syntax you are proposing though it *sounds* like you might be saying to search the various role dependency chain items to find

[ansible-project] Re: Early draft of a testing strategies doc

2014-05-27 Thread Adam Morris
On Monday, May 26, 2014 5:28:55 AM UTC-7, Michael DeHaan wrote: There are probably quite a few typos here yet as I just knocked this out, but this is derived from my talk to the New York Continuous Delivery Meetup* last week about achieving Continous Delivery workflows.

[ansible-project] Re: Early draft of a testing strategies doc

2014-05-27 Thread Adam Morris
And again, but with content... Looks good to me... but what do I know. I submitted a pull request for two very minor issues... 1) typo of stage to state and 2) plural unit tests for a singular playbook... Adam On Monday, May 26, 2014 5:28:55 AM UTC-7, Michael DeHaan wrote: There are

Re: [ansible-project] Template/File path for dependencies

2014-05-27 Thread 'Petros Moisiadis' via Ansible Project
On 05/27/14 20:26, Michael DeHaan wrote: Really, role deps shouldn't be looked at like inheritance though - they are simply NOT inheritance. They are things to do *first*. It might be better to pass a parameter into the role instead (like you have) with what filename to use, I'm unclear as

[ansible-project] Using include with_sequence on localhost

2014-05-27 Thread Stephen Gargan
Not to flog a dead horse as there are numerous threads about not allowing with_items and includes, but I have a narrower use case that I could really use this for and hopefully someone can help me here. I have a script that I use to spin up new cloud vm instances, the variables specific to the

Re: [ansible-project] include another role's variables without running it's tasks?

2014-05-27 Thread Michael DeHaan
What you say is a well understood ansible convention I am having trouble processing. I read most of your posts and think you are in general not getting the Zen of Ansible too much. Keep things simple. Don't think about trying to read what some default value is. Just use the value that makes

Re: [ansible-project] rax_cbs module question

2014-05-27 Thread Michael DeHaan
Already merged in by James, thanks Matt! On Sun, May 25, 2014 at 9:51 PM, Jimmy Prescott jimmynapk...@gmail.comwrote: Sounds good! Thank you! -- You received this message because you are subscribed to the Google Groups Ansible Project group. To unsubscribe from this group and stop

Re: [ansible-project] playbook_file

2014-05-27 Thread Michael DeHaan
There is playbook_dir, but not file. I'd generally argue that if your playbook needs to know the filename of itself, it has too much self awareness. I do understand why it would be useful for logging purposes though. I can see this being useful for things like the {{ ansible_managed }} template

Re: [ansible-project] Re: Specifying a variable from command line for a specific host

2014-05-27 Thread Michael DeHaan
I don't understand this. group_vars/ and host_vars/ files are in fact loaded if the host comes from inventory. Consider just using ansible hostname -m ... or ansible-playbook site.yml --limit hostname On Tue, May 27, 2014 at 12:52 AM, Jonathan Ellithorpe jdellitho...@gmail.com wrote:

Re: [ansible-project] Synchronize module and with_first_found

2014-05-27 Thread Michael DeHaan
This works incorrectly, since it will put the containing directory, what has been properly found with with_first_found inside the destination. Seems like you'd want the trailing slash here, since synchronize is in fact just a thin wrapper around local_action: rsync ... On Mon, May 26, 2014 at

Re: [ansible-project] Setting a variable by conditional in a playbook

2014-05-27 Thread Michael DeHaan
+1 to group_variables over set_fact. It's more native and probably more intuitive. set_fact should only be used for really oddball niche scenarios, like when you need to multiply a number by 10 or round a value, etc. On Tue, May 27, 2014 at 10:42 AM, Brian Coca brianc...@gmail.com wrote:

Re: [ansible-project] Template/File path for dependencies

2014-05-27 Thread Michael DeHaan
But we could make role dependencies allow for template overrides / injections I find this kind of language hard to understand. , I can see great potential if we make role dependencies smart enough to allow template inheritance between dependent roles. I don't even know what this means.

Re: [ansible-project] Using include with_sequence on localhost

2014-05-27 Thread Michael DeHaan
That hash syntax I find around the include is pretty uncommon for the way most people write playbooks. While we do accept arbitrary YAML, I'd suggest you standardize. Using tags to mean something other than ansible tags is also confusing, especially as tags in Ansible does not take a

Re: [ansible-project] Ansible Doesn't Use SSH Config File specified by ssh_args?

2014-05-27 Thread Michael DeHaan
Then I'd have to simply have a separate entry in my ssh config file for each one? Yes, because you just said you couldn't use wildcards :) +1 to having private hostnames or conventions to make that easier. On Sun, May 25, 2014 at 11:51 PM, Slim Slam slimands...@gmail.com wrote: To clarify

Re: [ansible-project] Inventory file - different groups with same variables but not the same value

2014-05-27 Thread Michael DeHaan
If I want to use tomcat's role for two instances on same host is better to use group_vars than the inventory file ? group_vars and inventory variables are the same thing expressed two different ways. If you want to use the role twice on the same box, this is a different pattern, which are

[ansible-project] The Zen of Ansible?

2014-05-27 Thread Adam Morris
I have heard rumours that there is a mystic who enlightens his disciples with the Zen of Ansible... I have even seen some bits and pieces of his teachings along the way, but was wondering if there was a more definitive source somewhere. Here is some of the advice I have seen attributed to this

[ansible-project] Hipchat module not compatible with hipchat API v2?

2014-05-27 Thread Lars Sommer
http://docs.ansible.com/hipchat_module.html https://www.hipchat.com/docs/apiv2/method/send_room_notification Difference in expected URL: https://api.hipchat.com/v1/rooms/message vs https://api.hipchat.com/v2/room/{id_or_name}/notification I was receiving a 401 until I started messing with the

Re: [ansible-project] include another role's variables without running it's tasks?

2014-05-27 Thread Brice Burgess
Thanks Michael. In my example I have a backup role. It would like to know the path where the apache-role stores websites by default so that it can back them up. Lets say the apache role stores this variable as `apache_sites_dir` in its default/main.yml (and of course it can be specified as

Re: [ansible-project] Using include with_sequence on localhost

2014-05-27 Thread Stephen Gargan
So the tags in this case are ec2 tags not ansible tags, it really wan't important anyway, takeaway was i was parameterizing my include and I wanted to iterate it. If the hash syntax is non-standard i'd happily hear the standard way to change a variable in an include? anyhow sorry for irritating

[ansible-project] Re: New URI module from Romeo Theriault

2014-05-27 Thread Guy Matz
Sorry to be a bother . . . can anyone say how I should be formatting the data ion my body here: - name: artifactory | TEST - create repo uri: url={{ baseurl }}/api/repositories/__test__ method=PUT user=user password=password body='{rclass: local}' force_basic_auth=yes

Re: [ansible-project] How to target one host from a list?

2014-05-27 Thread Steve Ims
Much better. Thanks for the example. Good lesson: Playbooks may contain multiple hosts. Thanks for the help! On Sunday, May 25, 2014 4:58:45 PM UTC-4, Michael DeHaan wrote: The Ansible way would prefer it simpler. Here's how you select the first node out of a group: - hosts:

Re: [ansible-project] include another role's variables without running it's tasks?

2014-05-27 Thread Adam Morris
On Tuesday, May 27, 2014 2:00:20 PM UTC-7, Brice Burgess wrote: In my example I have a backup role. It would like to know the path where the apache-role stores websites by default so that it can back them up. Lets say the apache role stores this variable as `apache_sites_dir` in its

Re: [ansible-project] include another role's variables without running it's tasks?

2014-05-27 Thread Brice Burgess
On Tuesday, May 27, 2014 5:33:38 PM UTC-5, Adam Morris wrote: I'm curious why you would do this (not because there is anything inherently wrong with it, but I'm wondering what your thinking is here). In short -- I am trying to avoid running 88 non-changing tasks to execute 2 changing

[ansible-project] can github.com/ansible/ansible-examples/tree/master/lamp_haproxy be executed simply, using dynamic inventory?

2014-05-27 Thread Gallagher Polyn
Hey, It feels like that all-important beginner's Ansible example github.com/ansible/ansible-examples/tree/master/lamp_haproxy can only be used, as written, with static inventory. For example, I modified the example's site.yml to use the ec2.py tag_blah-blah option for all named hosts, but the

Re: [ansible-project] Using a conditional (when) in conjunction with a loop

2014-05-27 Thread James Cammarata
I'm unclear why you can't do this? Is it failing with an error or some other problem? On Tue, May 27, 2014 at 4:43 PM, Alex King a...@king.net.nz wrote: Currently I add system users with the following play: # # Create system users # - name: sys admin users tags: sys_admin_users