[ansible-project] Ansible to adopt molecule and ansible-lint projects.

2018-09-26 Thread Timothy Appnel
To support the continued growth of Ansible we are expanding Ansible Galaxy
to include new functionality and tooling. A goal of this expansion is to
provide a minimum viable level of quality checks for content on Ansible
Galaxy. One of the first steps we are taking is adopting molecule and
ansible-lint as official Red Hat Ansible projects.

ansible-lint and molecule are great tools. They've been built and tested by
the community that we see as essential parts of enhancing development of
Ansible automation. By adopting these tools, Red Hat intends to invest
resources working with the community to make them even better. We are very
excited to integrate ansible-lint and molecule with the rest of the Ansible
projects.

We would like to thank Cisco, specifically John Dewey, for their work on
molecule. Cisco's willingness to transfer this project over to the Red Hat
Ansible team lends great credence to their contributions to the open source
ecosystem. We also want to thank Will Thames, the maintainer of
ansible-lint, for his contributions developing a tool that has done so much
for Playbook authors. We look forward to working with the communities that
have made these projects what they are. We want to share further
improvements with the broader Ansible community as well.

So what happens now? The repos will be migrated to the Ansible organization
on GitHub. The transition and roadmap will be iterated on gradually.
Ideally, the community will help guide our decision making as we go forward.

If you’re not familiar with these projects I encourage you to become more
familiar with them and how they can make automating with Ansible even more
simple and frictionless.

https://github.com/metacloud/molecule
https://molecule.readthedocs.io/en/latest/
https://www.digitalocean.com/community/tutorials/how-to-test-ansible-roles-with-molecule
https://groups.google.com/forum/#!forum/molecule-users

https://github.com/willthames/ansible-lint

Watch this space for more in the coming weeks and months.



Timothy Appnel
Senior Principal Product Manager
Red Hat Ansible

GitHub: tima <https://www.github.com/tima>

Twitter: @appnelgroup <https://www.twitter.com/@appnelgroup>

-- 
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/CAE5Jxhjvvz1z%3DHc1L1C%2BiUSiFp%3DMh116GgtoPDm9FTh%2BdW8e0A%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Proposal for fixing playbooks with dynamic include problems

2016-04-08 Thread Timothy Appnel
>
> So many things are broken with Ansible's notion of "composability" that
> it's hard to know where to begin.


https://github.com/ansible/proposals/pull/4

-- 
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/CAOMCme5YkuZehG8cHNsY13JEtxS037Zva63Mgn807kohe3sz7w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Ansible Tower - Mail callback plugin - Not sending emails correctly

2016-04-04 Thread Timothy Appnel
Are you running v2?  (Guessing so by @sivel's suggestion.) Did you
whitelist your callback in your config?

Timothy Appnel
Principal Architect
Ansible by Red Hat

GitHub: tima <https://www.github.com/tima>

Twitter: @appnelgroup <https://www.twitter.com/@appnelgroup>

On Mon, Apr 4, 2016 at 6:17 PM, Chase Farrant  wrote:

> Hmmm, it appears to still not be working.
>
> I added that function with the mail() call I was using beforehand. No
> dice. If I move that call to the bottom of the script, it sends the
> email. It behaves as if none of the Callback functions are working. This
> also applies to the hipchat.py plugin I've been trying.
>
> I also I tried creating both a 'v2_playbook_on_stats' and
> 'playbook_on_stats' which didn't change anything.
>
>
>
> On Monday, April 4, 2016 at 3:34:33 PM UTC-5, Chase Farrant wrote:
>>
>> Wow that helped a bunch and clears up a bunch of questions I didn't even
>> know I had. Thanks!
>>
>> On Monday, April 4, 2016 at 3:07:19 PM UTC-5, Chase Farrant wrote:
>>>
>>> Hello all,
>>>
>>> I am probably missing something here. I'm trying to get this mail plugin
>>> working -
>>> https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/callback/mail.py
>>>
>>> If I edit the script by adding mail() to the end, I receive a basic
>>> email immediately with no information when I run a job template (I believe
>>> this is expected).
>>>
>>> The problem is I never receive a summary email when the job is complete.
>>> My assumption is this is supposed to wait around until the job is
>>> completed, then send an email. As expected, I never receive an email at all
>>> if I remove the mail() command I appended to the mail.py script.
>>>
>>> Does anyone have any insight in getting this to work?
>>>
>> --
> 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/f24a9d2b-f70d-4a04-b8c9-98ff43ef1b6d%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/f24a9d2b-f70d-4a04-b8c9-98ff43ef1b6d%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
> 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/CAOMCme4K48gFJgULC5H5Vg_fSytJ6R7U7Gbt3Lu9RmjP_Baefw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Re: [ansible-devel] Re: Proposal for fixing playbooks with dynamic include problems

2016-03-15 Thread Timothy Appnel
@jimi-c: Is it possible to evaluate static includes after the setup module
runs to gathering facts? The most common use pattern I see in users plays
and roles are dynamic includes that define the filename based on a fact
like ansible_os_family. Collecting the fact before evaluating includes
would make things even more seamless for users.

Timothy Appnel
Principal Architect
Ansible by Red Hat

+1 718.404.6429 | <+1+718.404.6429> ansible.com <https://www.ansible.com/>

GitHub: tima <https://www.github.com/tima>

Twitter: @appnelgroup <https://www.twitter.com/@appnelgroup>

On Tue, Mar 15, 2016 at 11:32 AM, James Cammarata 
wrote:

> On Tue, Mar 15, 2016 at 11:03 AM, Strahinja Kustudić <
> strahin...@nordeus.eu> wrote:
>
>> So basically now simple includes without any loops or variables in file
>> name will be static by default? That is great news, since most of the
>> includes are like that and it makes them at least backward compatible with
>> 1.x.
>>
>> Could anyone tell me what exactly is the difference between:
>>
>> - include: "{{ some_var }}.yml"
>>   static: yes
>>
>>
> In this case, the include would be processed at playbook parsing time,
> meaning there is no inventory. As such, `some_var` would have to be
> available in playbook vars (vars/vars_files/role vars and defaults), or
> extra vars. Tasks and all related info would be available to things like
> --star-at-task, --list-tags, and --list-tasks.
>
>
>
>>
>> and
>>
>> - include: "{{ some_var }}.yml"
>>   static: no
>>
>> Does it mean for static: yes that some_var would need to be defined
>> statically as a var, and for static: no some_var could be defined during
>> play execution, e.g. set_fact: some_var=something.
>>
>>
> In this case, the include would not be processed until that task was hit
> at execution time, meaning `some_var` could come from any and all available
> variable sources in ansible. Nothing about the tasks in this file would be
> known at compile time, and as such that information would not be available
> for the CLI switches mentioned above.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-devel+unsubscr...@googlegroups.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/CAOMCme6HnpS8PtQVwi%2BP1wgc3J%3D7ow4Om1UJpDhDrUNZZOJ1VQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How do I use status to assign variables

2016-03-14 Thread Timothy Appnel
Essentially. Assign your hosts to a dev, test or prod group and set
variables that apply to those groups.

Timothy Appnel
Principal Architect
Ansible by Red Hat

+1 718.404.6429 | <+1+718.404.6429> ansible.com <https://www.ansible.com/>

GitHub: tima <https://www.github.com/tima>

Twitter: @appnelgroup <https://www.twitter.com/@appnelgroup>

On Mon, Mar 14, 2016 at 5:28 PM, Gilberto Valentin 
wrote:

> Do you mean in group_vars?
>
> On Monday, March 14, 2016 at 5:17:34 PM UTC-4, Timothy Appnel wrote:
>>
>> You should have some form of inventory groups for development, testing
>> and production.
>>
>> Timothy Appnel
>> Principal Architect
>> Ansible by Red Hat
>>
>> +1 718.404.6429 | ansible.com <https://www.ansible.com/>
>>
>> GitHub: tima <https://www.github.com/tima>
>>
>> Twitter: @appnelgroup <https://www.twitter.com/@appnelgroup>
>>
>> On Mon, Mar 14, 2016 at 4:42 PM, Gilberto Valentin 
>> wrote:
>>
>>> I have a couple of systems that follow a strict hostname schema. For
>>> example, depending on the environment, they all follow the same prefix for
>>> that environment:
>>>
>>>- For development = dev-server1.domain.tld
>>>- For testing = test-server1.domain.tld
>>>- For production = prod-server1.domain.tld
>>>
>>> Using Ansible's *setup *module, I know I can call the hostname with a
>>> variable of *facter_hostname*. However, how do I use that variable
>>> value to compare it with a list of environments like the one above so that
>>> if the hostname has the prefix of *dev*, then assign a value of 1; if
>>> it contains a prefix of *test*, then assign it a value of 2; if it has
>>> a prefix of *prod*, then assign it a value of 3.
>>>
>>> --
>>> 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/333f046b-bdd3-48c8-919e-0b7037ebf3a2%40googlegroups.com
>>> <https://groups.google.com/d/msgid/ansible-project/333f046b-bdd3-48c8-919e-0b7037ebf3a2%40googlegroups.com?utm_medium=email&utm_source=footer>
>>> .
>>> 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/c6254117-92b6-41c8-b788-0889d6e23c74%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/c6254117-92b6-41c8-b788-0889d6e23c74%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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/CAOMCme4goxd0b6saTGSgii-r-9sPsBgzDvrJkSCobj9VjrOCWw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] When to call a specific task from a role?

2016-03-14 Thread Timothy Appnel
This is a question I've pondered in my own work. There is no one specific
or recommended way Ansible prescribes for doing this. What follows are my
own personal thoughts and mine alone.

You can do separate role as you suggest. Not ideal because it puts to much
distance between closely related functionality for my liking.

You could tag tasks one or the other -- however you must remember to pass a
tag. No sure this is practical in that it's too easy to mess up.

You can implement something with some combinations of params/variables,
conditionals, includes and/or blocks. This is one I think has the most
promise though the number of ways this could be implemented are pretty
extensive in number.




Timothy Appnel
Principal Architect
Ansible by Red Hat

+1 718.404.6429 | <+1+718.404.6429> ansible.com <https://www.ansible.com/>

GitHub: tima <https://www.github.com/tima>

Twitter: @appnelgroup <https://www.twitter.com/@appnelgroup>

On Mon, Mar 14, 2016 at 4:24 PM, Gilberto Valentin 
wrote:

> I am creating a role with *ansible-galaxy init role_name*. One of the
> tasks in that role will be to install_app.yml and another to remove_app.yml
> (one to install and one to remove). Is it possible to call one task vs the
> other within that role or do I need to create a whole new role for that
> specific task?
>
> --
> 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/77c726a2-29ea-4898-ab05-32b82d5af207%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/77c726a2-29ea-4898-ab05-32b82d5af207%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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/CAOMCme5iuYHT_Hi%3DA%3DRR4eDk3mPjnSGcTyB7fSiN3%3DV1pQFR6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] How do I use status to assign variables

2016-03-14 Thread Timothy Appnel
You should have some form of inventory groups for development, testing and
production.

Timothy Appnel
Principal Architect
Ansible by Red Hat

+1 718.404.6429 | <+1+718.404.6429> ansible.com <https://www.ansible.com/>

GitHub: tima <https://www.github.com/tima>

Twitter: @appnelgroup <https://www.twitter.com/@appnelgroup>

On Mon, Mar 14, 2016 at 4:42 PM, Gilberto Valentin 
wrote:

> I have a couple of systems that follow a strict hostname schema. For
> example, depending on the environment, they all follow the same prefix for
> that environment:
>
>- For development = dev-server1.domain.tld
>- For testing = test-server1.domain.tld
>- For production = prod-server1.domain.tld
>
> Using Ansible's *setup *module, I know I can call the hostname with a
> variable of *facter_hostname*. However, how do I use that variable value
> to compare it with a list of environments like the one above so that if the
> hostname has the prefix of *dev*, then assign a value of 1; if it
> contains a prefix of *test*, then assign it a value of 2; if it has a
> prefix of *prod*, then assign it a value of 3.
>
> --
> 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/333f046b-bdd3-48c8-919e-0b7037ebf3a2%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/333f046b-bdd3-48c8-919e-0b7037ebf3a2%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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/CAOMCme4ozyWo7kV2Jjw8eZu5isw2PndHdRJHU2DvZUGUUd8w-g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: Can't find boto for ansible EC2 module

2015-08-31 Thread Timothy Appnel
Ansible doesn't use a fixed /usr/bin/python necessarily. If you set a
different python interpreter via your inventory as Justin did here and keep
the remotes files, you'll notice that Ansible has replaced with
/usr/bin/python with the python interpreter you have in your inventory.

*> I don't see why, when /usr/bin/env python will mostly be the correct
python, it's still being enforced to use /usr/bin/python :/ .*

The keyword in your sentence here is "mostly." Ansible needs to be using
the intended python interpreter "*always*." I've worked in environments
where the default python was way out of date and the modern version was in
an alternate location. Because Ansible was forced to use a service account
that did not have a profile to alter the PATH, we were forced explictly
specify the python interpreter and let Ansible do it's thing. I've also
worked in environments where python was in different alternate locations.

Think of #!/usr/bin/python as just a placeholder, albeit it a functional
one if left as is.

Hope that helps answer your question.




[image: photo]
Timothy Appnel
Senior Solutions Architect

Ansible, Inc. *•* www.ansible.com

On Sun, Aug 30, 2015 at 4:06 AM, Alex Leonhardt 
wrote:

> I tried a pull request for the GCE modules (as example) to use
> /usr/bin/env python instead of a fixed /usr/bin/python but that was
> dismissed without real consideration of whether it actually be a good idea
> (or not) nor a detailed explanation as to why it was considered "bad".
>
> I don't see why, when /usr/bin/env python will mostly be the correct
> python, it's still being enforced to use /usr/bin/python :/ .
>
> Maybe someone here knows the inner details as to why??
>
> Alex
>
> On 30 August 2015 at 02:36, Justin Phelps  wrote:
>
>> Thanks James.
>>
>> That is easier and I can confirm it works in CircleCI.
>>
>>
>> On Saturday, August 29, 2015 at 2:51:26 PM UTC-5, James Martin wrote:
>>>
>>> Yay, 2 year old thread :).
>>>
>>> The way you solve this is by modifying your inventory for localhost with
>>> the proper setting:
>>>
>>> #inventory file
>>> localhost ansible_python_interpreter="/usr/bin/env python"
>>>
>>>
>>> This will automatically pick up the active virtualenv's python
>>> interpreter and modules that you've installed there, including boto.  You
>>> don't need to run any tasks to discover the path to the python interpreter.
>>>
>>>
>>> On Friday, August 28, 2015 at 6:02:39 PM UTC-5, Justin Phelps wrote:
>>>>
>>>> I managed to fix this with these two tasks:
>>>>
>>>>   - name: Find the path to the python interpreter
>>>> command: which python
>>>> register: pythonpath
>>>> when: lookup('env', 'CI') == "true"
>>>>
>>>>   - name: Set python interpreter path when in CI
>>>> set_fact: ansible_python_interpreter={{ pythonpath.stdout }}
>>>> when: lookup('env', 'CI') == "true"
>>>>
>>>> You would take out the when statements as they are specific to my
>>>> testing environment.
>>>>
>>>> On Friday, August 2, 2013 at 9:52:32 AM UTC-5, Dan McKean wrote:
>>>>>
>>>>> I've been considering Ansible for creating our EC2 instances, and have
>>>>> run into a problem with ansible not finding boto from either the command
>>>>> line or a playbook.
>>>>>
>>>>> Here's the command line and response; the playbook is similar:
>>>>>
>>>>> ansible localhost -m ec2 -a "image=ami-0358ce33 instance_type=t1.micro
>>>>> keypair=myKeypairName group=default wait=true"
>>>>>
>>>>> localhost | FAILED >> {
>>>>> "failed": true,
>>>>> "msg": "boto required for this module"
>>>>> }
>>>>>
>>>>>
>>>>> I'm running Ansible from an activated virtualenv.  Ansible was
>>>>> installed with pip install ansible, and boto's installed as well in the
>>>>> venv (as well as globally).
>>>>>
>>>>> If I activate the venv and open a command prompt, I can import boto
>>>>> without any problem, and a boto.connect_ec2() succeeds (there is a ~/.boto
>>>>> config file present).  Importing ansible and creating a Runner works
>>>>> succeed

Re: [ansible-project] Ansible: How to use a Variable as an Index?

2015-08-11 Thread Timothy Appnel
That is a good way of thinking of explaining it in the context of Ansible
-- start Jinja, stop Jinja. At the same time, how would you have
represented this in a Jinja template? Jinja doesn't allow for nested
mustaches in any context that I am aware of.

I'm sure a patch to the docs to make light of this would be appreciated.



[image: photo]
Timothy Appnel
Senior Solutions Architect

Ansible, Inc. *•* www.ansible.com

On Tue, Aug 11, 2015 at 8:38 PM, Josh Smift  wrote:

> TA> Don't use nested mustaches.
>
> This should probably be a FAQ. :^) FWIW, what helped me understand this is
> that the mustaches aren't saying "here's a variable" (in which case you
> might think, incorrectly, that you need to put them around all variables
> all the time everywhere), but rather "start parsing this as Jinja", and
> that once you say that, it keeps happening until you close the mustaches
> (which means "stop parsing this as Jinja"). One of the things that happens
> when you're parsing as Jinja is that variables get expanded, but thinking
> of it as "start Jinja" and "stop Jinja" helped me keep it straight when I
> first started with this stuff, anyway.
>
>   -Josh (j...@care.com)
>
>
>
> This email is intended for the person(s) to whom it is addressed and may
> contain information that is PRIVILEGED or CONFIDENTIAL. Any unauthorized
> use, distribution, copying, or disclosure by any person other than the
> addressee(s) is strictly prohibited. If you have received this email in
> error, please notify the sender immediately by return email and delete the
> message and any attachments from your system.
>
> --
> 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/21962.38250.656216.677376%40gargle.gargle.HOWL
> .
> 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/CAOMCme7aUj%3D%2B5%2Bh5Zo5wQWbCsYfYJ1Npu9TQvOxmPeC7EcnjXg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] "Tuning the External Inventory Script"

2015-08-11 Thread Timothy Appnel
Yes you have. In option #1, when --host is call you only return that one
host and it's host variables, if any. (You said a single group.) You don't
return any groups or group variables.

The dynamic inventory plugin API is a coarse-grained one that slurps in
everything it can get from the inventory source. There are many reasons for
that such as tasks that reference other host resources not targeted by the
play.


[image: photo]
Timothy Appnel
Senior Solutions Architect

Ansible, Inc. *•* www.ansible.com

On Tue, Aug 11, 2015 at 12:21 PM, Andy Baker  wrote:

> This passage:
> http://docs.ansible.com/ansible/developing_inventory.html#tuning-the-external-inventory-script
>
> seems to say you have two options:
>
> 1. Return a list of groups when called with --list and then return all the
> vars for a single group when called with --host
> 2. Return all groups and all vars in one go when called with --list (the
> 'tuned' version)
>
> However in both cases you're forced to generate all groups and all vars.
>
> If I'm running a command on a single host or group - I rather expected
> there would be a way to avoid generating the vars for all the groups or
> hosts that I have no intention of connecting to.
>
> Have I misunderstood something?
>
> --
> 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/99d61d16-f33d-453d-a23c-4663befaa9c5%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/99d61d16-f33d-453d-a23c-4663befaa9c5%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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/CAOMCme6c%2BO1TXBRh%2BD1y8bXQ06S_VUEnmb-0dF_wRKru-wwCiQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Ansible: How to use a Variable as an Index?

2015-08-11 Thread Timothy Appnel
Don't use nested mustaches. In other words try this:

cvmip: "{{ nics[num].ip }}"



[image: photo]
Timothy Appnel
Senior Solutions Architect

Ansible, Inc. *•* www.ansible.com

On Tue, Aug 11, 2015 at 5:19 PM,  wrote:

> Hi Ansible Users,
>
> I am trying to use a variable passed in via "--extra-vars" to index into
> 'nics' which is defined in nics.yml.
>
> It works fine in the "when" clause, but not in the "set_fact". Any
> suggestions?
>
> Thanks,
> Lilian
>
>
> host# cat nics.yml
> ---
> nics:
> - {type: 'static', ip: '10.3.5.4'}
> - {type: 'dhcp'}
> - {type: 'static', ip: '10.3.5.5'}
>
> host # cat test.yml
> - hosts: 127.0.0.1
>   vars_files:
> - "nics.yml"
>   tasks:
> - name: Static IP Case - Find out Static Overlay IP
>   set_fact:
>  cvmip: "{{nics[{{num}}].ip}}" <- HOW DO I
> GET PAST THIS?
>   when: nics[{{num}}].type == "static"   <--- It works fine
> here
>
> - name: Write Overlay IP to file
>   shell: echo {{cvmip}} >> /tmp/staticip.txt
>   when: nics[{{num}}].type == "static"
>
> host# ansible-playbook test.yml --extra-vars "num=0"
> [SNIP]
> TASK: [Static IP Case - Find out Static Overlay IP]
> ***
> fatal: [127.0.0.1] => Failed to template {{nics[{{num}}].ip}}: template
> error while templating string: expected token ':', got '}'
>
> --
> 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/8066dec4-1cae-4ca7-b75d-d4d0e8e09397%40googlegroups.com
> <https://groups.google.com/d/msgid/ansible-project/8066dec4-1cae-4ca7-b75d-d4d0e8e09397%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> 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/CAOMCme7xD9Wt5k6VVN67ee%2BxVYq3NnPYn5QrkCXx7RJcMGLfQw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] delegate_to from inventory? copy between remote hosts

2015-08-03 Thread Timothy Appnel
Right. Thanks bcoca. Always forget that one until I run. 


[image: photo]
Timothy Appnel
Senior Solutions Architect

Ansible, Inc. *•* www.ansible.com

On Mon, Aug 3, 2015 at 12:45 PM, Brian Coca  wrote:

> quote it
>
> delegate_to: "{{ mons[0] }}"
>
>
>
>
> --
> Brian Coca
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Project" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to ansible-project+unsubscr...@googlegroups.com.
> To post to this group, send email to ansible-project@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAJ5XC8kvqPNLuFFO86n3aD7-swK-WObM-0nfMRe2hG-5um%3D9bQ%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/CAOMCme6Ecv%2Bo_prZhW83vggkjMDcTt7hWMmM9tHmssjfqJ73qA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] delegate_to from inventory? copy between remote hosts

2015-08-03 Thread Timothy Appnel
Try wrapping your mons variable in {{ }} like this...

delegate_to: {{ mons[0] }}


I'm pretty sure without them your variable is being interpreted as a
literal.


On Sat, Aug 1, 2015 at 2:01 AM, pixel fairy  wrote:

> making a playbook to set up ceph clients, so want to transfer a client key
> from server (a monitor host) to client. since the server and client are
> both far away and sitting next to each other, id like to copy between them,
> so of course, i tried
>
>- name: make sure the client key is in place
>  copy: src=/etc/ceph/ceph.client.admin.keyring
> dest=/etc/pve/priv/ceph/rbd.keyring
>  delegate_to: mons[0]
>
> and to make sure it knew what i wanted,
>
> $ ansible mons[0] --list-hosts
> c1
>
> ran the playbook and got this,
>
> failed: [proxbox -> mons[0]] => {"failed": true}
> msg: could not find src=/etc/ceph/ceph.client.admin.keyring
>
> (maybe it was looking on the local filesystem?)
>
> then i tried synchronize, as suggested here,
> http://stackoverflow.com/questions/25505146/how-to-copy-files-between-two-nodes-using-ansible
> but got this,
>
> fatal: [proxbox -> mons[0]] => SSH Error: ssh: Could not resolve hostname
> mons[0]: nodename nor servname provided, or not known
>
> does delegate_to not use the inventory?
>
>
>
> --
> 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/27bc3f75-6222-4c8d-bf0a-89068317bb9b%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/CAOMCme6QEMUioSQu6pcHbdK%2B7obgMCz-5p2-F4BO%2BunhLj2aDA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: variable set to a default value in play vars unexpectedly becomes not the default value

2015-07-27 Thread Timothy Appnel
I realize your are using includes. I was pointing out that you want to use
roles for the benefit of the namespacing protection that roles have and
includes do not. From what I see this is correct behavior for what you've
implemented and not a bug. A role should give you the separate variable
namespace scope you seem to be expecting. 

On Mon, Jul 27, 2015 at 2:17 PM, Kathy Allen  wrote:

> Thank you. However, our playbooks don't use roles. For our deployment
> orchestration, it doesn't seem necessary, or at least it works well without
> them.
>
> Can anyone speak to how that variable is getting set as the playbook
> executes the second include? Will this absolutely not work without roles?
>
> On Friday, July 24, 2015 at 7:16:29 AM UTC-7, Timothy Appnel wrote:
>>
>> If I am following what behavior you are looking for (what you describe is
>> how includes are intended to work) your playbook includes should be
>> implemented as a role and then called with parameters. See if the added
>> namespacing protections roles have, but includes does not kicks in.
>>
>> 
>>
>

-- 
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/CAOMCme7fOihJx948YkHWizGs5CRwdFPvLXg8imP1h2VRKrbCJQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Re: variable set to a default value in play vars unexpectedly becomes not the default value

2015-07-24 Thread Timothy Appnel
If I am following what behavior you are looking for (what you describe is
how includes are intended to work) your playbook includes should be
implemented as a role and then called with parameters. See if the added
namespacing protections roles have, but includes does not kicks in.




On Thu, Jul 23, 2015 at 3:21 PM, Kathy Allen  wrote:

> bump?
>
>
>  --
> 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/a18a929b-e1bc-4540-8314-2abaee50ed65%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/CAOMCme7xtNdmrrqTf5NkyvuyxrNymA%2Bzov_izrSbLoW-FTfymw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Not using simplejson

2015-07-22 Thread Timothy Appnel
Then you have json (what simplejson became when it was brought in to the
python core). 

On Wed, Jul 22, 2015 at 3:47 PM, Mauricio Tavares 
wrote:

> On Wed, Jul 22, 2015 at 3:37 PM, Brian Coca  wrote:
> > pretty much raw is the only thing you can run w/o a json library, what
> > version of python are you running on the targets?
> >
>   For this specific target,
>
> ~ # python -V
> Python 2.6.7
> ~ #
>
> >
> > --
> > Brian Coca
> >
> > --
> > You received this message because you are subscribed to the Google
> Groups "Ansible Project" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> an email to ansible-project+unsubscr...@googlegroups.com.
> > To post to this group, send email to ansible-project@googlegroups.com.
> > To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/CAJ5XC8kBMXaCZLzar7e7Gi6fxni6DL6bqFqnqaVe%2BRfVgO0afA%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/CAHEKYV5ku0dPnR0hexj%3DHY%2B2ZsKiFdzktCWBgDfOD7yKvXy4XQ%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/CAOMCme4e8G%3DnprsfOuHvrG-Fad8UiBhuSzmL5HxyYkB5JH%3DUvg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Importing custom python library from ansible custom module

2015-07-16 Thread Timothy Appnel
I'm glad you were able to work something out and I was helpful. A couple of
quick added thoughts on this.

I wouldn't recommend just dropping your library in to just /tmp to avoid a
potential conflict with another job or process. Perhaps create a separate
directory like the name of your project or playbook under tmp and store it
there? I think create a specific directory helps avoid this.

I also wouldn't recommend embedding a library path in your custom module
for maintainability. It's working for you now, but the thought of having to
have that path line up in two different places make me uneasy. I used the
environment arg and appended the path to our libraries to PYTHONPATH.
Everything is in one place: the playbook. A var to hold the path (you can
use Ansible facts to really create a unique path that won't get tread on),
the path create, the copy, the environment setting. Change it in one place
and the change probates thru.

Just some food for thought.




On Thu, Jul 16, 2015 at 3:30 PM, Olivier Lauret <
olivier.lau...@googlemail.com> wrote:

> Hi Tim,
>
> Thank you very much for the update. It helps a lot, thank you very much.
> Indeed, I have chosen your second option as it is easier to maintain and
> avoid any conflict with other systems. The inifile.py is too big to be
> included in the custom module but I would not do this as I wouldn't be able
> to re-utilise it.
>
> Here is how I did it:
>
> In my playbook or role:
> tasks:
>   - name: Upload python module
> copy: src=library/inifile.py dest=/tmp/inifile.py
> In my custom module:
> import sys
> sys.path.append('/tmp')
> from inifile import IniFile
>
> And to answer your question, what I am trying to achieve here is an
> extension to the ini_file module in Ansible. The current module doesn't
> answer my needs such as:
>
>- setting easily a continious list of options such as:
>   - whitelist.0 = item1
>   - whitelist.1 = item2
>   - whitelist.2 = item3
>- checking and replacing a list of options (such as ["ower", "owne"])
>by one option name ("owner")
>- Dealing with options that doesn't have section (generally mean that
>this is default to all sections)
>- Dealing with empty name section ([]) and comments - this one I am
>less sure about but I know that the ConfigParser cannot handle this.
>
> Thank you again for your precious help.
>
>
> Regards,
>
> Olivier
>
> On Thursday, 16 July 2015 15:20:03 UTC+1, Timothy Appnel wrote:
>>
>> I didn't give up at all. Far from it! I started working for Ansible.
>>
>> Last I spoke to my former co-workers they are still using options 2 that
>> I setup because they do not have the ability to install python libraries in
>> the default library path.
>>
>> 
>>
>>
>> On Thu, Jul 16, 2015 at 10:14 AM, Martin  wrote:
>>
>>> Hi,
>>>
>>> On Thu, Jul 16, 2015 at 4:05 PM Timothy Appnel 
>>> wrote:
>>>
>>>> In a previous life I've had to do what you are attempting.
>>>>
>>>
>>> So what do you do now? It sound like you went on and are using a
>>> completely different approach to achieve what the op wants to do (load
>>> custom code)
>>>
>>> I'm not asking about options but rather what you actually ended up with
>>> doing (give up and/or stopped using the tool are viable answers to me)
>>>
>>> /Martin
>>>
>>> --
>>> --
>>> http://www.xing.com/profile/Martin_Marcher
>>> http://www.linkedin.com/in/martinmarcher
>>> Mobil: +43 / 660 / 62 45 103
>>> UID: ATU68801424
>>>
>>> --
>>> 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/CAK1mKEQxjUW0kB9Yb426THm8HZCMOy%3DbdbCzztjARScFrYsKzQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/ansible-project/CAK1mKEQxjUW0kB9Yb426THm8HZCMOy%3DbdbCzztjARScFrYsKzQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>> 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 a

Re: [ansible-project] Importing custom python library from ansible custom module

2015-07-16 Thread Timothy Appnel
I didn't give up at all. Far from it! I started working for Ansible.

Last I spoke to my former co-workers they are still using options 2 that I
setup because they do not have the ability to install python libraries in
the default library path.




On Thu, Jul 16, 2015 at 10:14 AM, Martin  wrote:

> Hi,
>
> On Thu, Jul 16, 2015 at 4:05 PM Timothy Appnel  wrote:
>
>> In a previous life I've had to do what you are attempting.
>>
>
> So what do you do now? It sound like you went on and are using a
> completely different approach to achieve what the op wants to do (load
> custom code)
>
> I'm not asking about options but rather what you actually ended up with
> doing (give up and/or stopped using the tool are viable answers to me)
>
> /Martin
>
> --
> --
> http://www.xing.com/profile/Martin_Marcher
> http://www.linkedin.com/in/martinmarcher
> Mobil: +43 / 660 / 62 45 103
> UID: ATU68801424
>
> --
> 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/CAK1mKEQxjUW0kB9Yb426THm8HZCMOy%3DbdbCzztjARScFrYsKzQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/ansible-project/CAK1mKEQxjUW0kB9Yb426THm8HZCMOy%3DbdbCzztjARScFrYsKzQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
> 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/CAOMCme7JjHtUYE%3D4DRSyCd1tsEL19w0-1BRSnunD9xHbfc-8EQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Importing custom python library from ansible custom module

2015-07-16 Thread Timothy Appnel
In a previous life I've had to do what you are attempting. Ansible will not
automatically know to install dependencies like your custom library for
you.That is up to you to handle. There are two ways I've gone about it
resolving this:

1) Install said libraries in your default python library path on each
remote box.
2) Copy/install your libraries to an alternate path location (could be one
time could be an earlier task of the play) and use the environment argument
on the task that uses your custom module to append said library path to
PYTHONPATH.

Not knowing what is in your infile.py, you may want to consider embedding
that library in the module if it's a single library file that's not too
complex. I didn't personally use this approach, though I considered it, in
my own because the library files had other usage outside of my custom
Ansible module and I didn't want to play around keeping the code in sync.

Hope that helps.



-- 
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/CAOMCme63ZpWdD9nOzgBZvNKpW29zkAQUYwG8t8oSnMXYUb%3DOuw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] lookup -csvfile - special character delimiter

2015-04-29 Thread Timothy Appnel
That's single quotes wrapping double quotes from what I can tell. Would love to 
understand why that works at some point but great. 

-- 
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/e2fb2735-9306-4864-858a-f660cb10ec75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] lookup -csvfile - special character delimiter

2015-04-29 Thread Timothy Appnel
The problem is that Raj is already inside of a single quoted string inside of a 
double quoted string. Doing what you suggest trips up the template parser. 

-- 
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/3335ab2a-e7c0-4c78-838e-d27d6845e1d7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] lookup -csvfile - special character delimiter

2015-04-29 Thread Timothy Appnel
Looks like there are a couple of things getting in your way. 

The first is that the YAML parser thinks the : (colon without escaping or 
quoting) is a misplaced key/value delimiter. If you put that in double quotes 
it passes thru to the next issue that being the csvfile lookup plugin makes a 
call to csvfile.reader with the delimiter string still wrapped in quotes. The 
delimiter param must be a single character causing another error. 

I guess there are a few ways to go about addressing this in the core. 

One is to have special string like COLON (like TAB) that gets converted to its 
single character form. 

The other is to detect the delimiter string is more than a single character and 
assume that it's probably quoted. 

I like the later solution because it handles any sort of quoted character 
someone may throw at it. I'm not fond of the idea of introducing a regex for an 
edge case where there wheren't any before. Perhaps a len and split combo like 
this would suffice?

   if len(delimiter) > 1:
   delimiter = delimiter.split(delimiter[0])[1]

Not exactly a bulletproof solution, but it's a pretty low cost fix to the issue.

Thoughts from the core team?



-- 
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/5916ee94-c9a9-432b-a0df-4a48bca35b63%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] -m setup -a filter="ansible_eth0.ipv4.address" returns no results

2015-04-29 Thread Timothy Appnel
One of the notes in the docs of the setup module reads: "the filter option 
filters only the first level subkey below ansible_facts." So you don't. Not 
that way at least. 

What about ansible_all_ipv4_addresses? 

-- 
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/130d0350-7fc9-447f-b944-c4b926d5b2d4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Spawning background processes that are not services

2015-04-27 Thread Timothy Appnel
So a few things here.

Having just breezed over what WebLogic Node Runner does, I see where something 
like service or supervisor is somewhat redundent for you. That wasn't clear to 
me from from this thread until I did that though. That's not the norm for most 
though and you weren't clear on that so I don't think its fair to say Brian is 
missing the point.

So I think I get what you are trying to do. 

We've been in a similar spot here with long running processes rather than 
daemons, but I think what we did applies here. Use the the wait_for directive 
right after your shell nohup async task and look for a sign that the 
initialization of the previous task has reached a ready state. What is "ready" 
will depend on you. In our case it's a specific line in a log file. 

Not ideal or elegant, but it should work.

Now, based on what I read, it sounds like the elegant solution would be to 
create a noderunner module where you can better manage and control the jobs 
abstracted from your playbook or role.

Hope that helps.

-- 
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/9e182cb7-e345-470e-9e93-6b12967b85b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] 127.0.0.1 and localhost in synchronize module

2014-07-21 Thread Timothy Appnel
Given the nature of rsync and what it does, your question can be read a few 
ways but let me guess at what you are getting at. 

127.0.0.1 and localhost are treated specially because you're already on that 
box so you don't need to provide all of the SSH credentials. You can do a sync 
that doesn't go out to the network at all. 



-- 
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/6b04ddad-bb78-45e0-8c73-cf3cac103726%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] synchronize module update request

2014-07-10 Thread Timothy Appnel
Sounds about right to me. I don't recall forcing the compress option when I 
initially wrote that module and submitted it to core. Maybe I did. Not sure why 
now tho. 

Regardless. Have you created a PR for this yet? My only suggestion is that 
compression is on by default but a user can disable it by default with a 
--no-compress flag. The behavior everyone is accustomed to continues as it's 
been but users like yourself have the means to turn that off. 



-- 
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/7e8fb761-e17e-411b-a0cc-8c4df75d93e2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Helper library for modules written in PHP?

2014-07-09 Thread Timothy Appnel
I've absolutely read over this thread and the project page. You've ported the 
ansible module helpers to PHP so you can write your modules in PHP rather than 
learn some Python and use what's already there. 

-- 
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/e4277a12-25da-4d19-bb55-1a3d0384f20e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Helper library for modules written in PHP?

2014-07-09 Thread Timothy Appnel
Seems like a whole lot of trouble to avoid learning python. I don't see why 
this is any better or really necessary otherwise. 

-- 
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/7bd61c06-cfb0-4a27-b431-37da0428a2ce%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] List of Ansible default variables

2014-07-01 Thread Timothy Appnel
What you are describing sounds a lot like what I have at my day job -- hundreds 
of instances of dozens of Java applications each with their own properties like 
unique ports, file paths and whatnot.

We addressed the things you are talking about by treating each app as a host 
regardless of physical server and from there used host and groups vars, not 
roles for what you are trying to do. Essentially roles start with tasks and 
sometimes specialized modules. The variables and defaults are there to support 
those tasks. Recently I created a module that reads the properties file all of 
these application use for their configuration and imports them as facts so 
later roles and playbooks can remain in sync with little to no effort.  

We did toy with something like your approach of wrapping application specific 
meta data as roles, but found that was messy and hard to manage. (Roles get 
checked in and treated like code, inventory not so much.) 

So based on my experience I think your struggles are a modeling problem like 
Michael suggested. 



-- 
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/519faf83-1f5c-4058-a189-0689ffe46905%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Jinja2 extract single value for key/value pair without looping

2014-06-27 Thread Timothy Appnel
Theoretically in Jinja 2.8 when it's released you could perform this operation 
with something like this:

{{ 
fusemq_auth|selectattr('username','equalto','LOGSTASH')|map(attribute='password')|first
 }}

selectattr and map are new to version 2.7. The 'equalto' test is the problem 
you'll run in to. 

So the map function with an optional selectattr provides the dict_to_list 
function you are looking for. (Your gist wouldn't load.) I don't see how a 
general purpose list_to_dict would be possible without some specific logic be 
written. 

 

-- 
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/a26ab6ed-8f6c-4a2f-a3e5-c4d436503af2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] for loop in template how do I avoid trailing comma on last iteration?

2014-06-26 Thread Timothy Appnel
OK try this...

"tcp://{{ groups['fusemq']|join(',tcp://') }}"

Not exactly pretty but better than a for loop with conditionals. 



-- 
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/adbd59de-3bc2-43e3-860b-9c424d7484ef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] Having problems with --exclude, --include with synchronize module using rsync_opts

2014-06-18 Thread Timothy Appnel
I found what the problem is though I don't know what the right solution is. 

https://github.com/ansible/ansible/pull/7820

Essentially safe shell module causes wildcards to be treated as literals 
with rsync. As long as that is the case you can't use wildcards with sync 
module, but you can't do that either as stated in the pull request comments 
so I'm at a bit of a loss how to resolve this issue.

On Tuesday, June 17, 2014 3:18:14 PM UTC-4, Michael DeHaan wrote:
>
> Don't know, any debugging would be appreciated.
>

-- 
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/5cc65bdb-9455-4667-9bfa-5cd6db678dfc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[ansible-project] Having problems with --exclude, --include with synchronize module using rsync_opts

2014-06-17 Thread Timothy Appnel
We are also having some problems at the day job with wild cards and the 
synchronize module however ours is tied to the src argument. 

htttps://github.com/ansible/ansible/issues/7728

I've been looking when I have a chance but haven't figured out what's going 
wrong. I just know the command Ansible is reporting it runs works fine on the 
command line. Remove the wildcard and Ansible runs. Put it back in and it 
fails. 



-- 
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/18295ccd-d544-4d10-9e75-a32c497a51e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [ansible-project] date format

2014-03-24 Thread Timothy Appnel
Sounds like something Jinja2 can handle pretty easily. 

http://stackoverflow.com/questions/4830535/python-how-do-i-format-a-date-in-jinja2



Sent from my iPhone

-- 
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/EF469DB1-AD42-4EFE-B21C-32EB180B4AFE%40gmail.com.
For more options, visit https://groups.google.com/d/optout.