Re: [ansible-devel] Re: Examples of diverse large and inventories

2018-03-23 Thread Josiah Niedrauer
I concur on the dynamic inventory with tags idea. Beyond a certain point, I don't think it's realistic to use a static inventory. I've used this script for 3 companies now in AWS, and it gets the job done:

[ansible-devel] Re: Examples of diverse large and inventories

2018-03-23 Thread Trond Hindenes
Btw those rest services we use as inventory scripts for both azure and aws essentially make instance tags into groups/subgroups. I guess that was the essence of your question (how to manage groups) and the answer is that we don't - we use instance tags for that and groups/subgroups are built

[ansible-devel] Re: Examples of diverse large and inventories

2018-03-23 Thread Trond Hindenes
We don't have quite those numbers, but I'm happy to share anyways: We have hosts in 3 datacenters: local, azure, aws. We're transitioning to pure aws. We use a custom rest service for both azure and aws-based hosts, while "local" hosts are maintained using a good ol' hosts file (these servers

Re: [ansible-devel] get_config in Ansible 2.5.0 API

2018-03-23 Thread Trond Hindenes
the new api looks super-clean btw, sweet! On Friday, March 23, 2018 at 6:51:04 PM UTC+1, Brian Coca wrote: > > I'm writing the new docs, but the short, DONT use get_config, use > self.get_option('passwordstate_uri') after you define the option in > the DOCUMENTATION variable inside the lookup

Re: [ansible-devel] get_config in Ansible 2.5.0 API

2018-03-23 Thread Trond Hindenes
awesome, thanks for the quick reply!! On Friday, March 23, 2018 at 6:51:04 PM UTC+1, Brian Coca wrote: > > I'm writing the new docs, but the short, DONT use get_config, use > self.get_option('passwordstate_uri') after you define the option in > the DOCUMENTATION variable inside the lookup > >

[ansible-devel] Re: Set fact based on particular condition of list variable not working

2018-03-23 Thread Mohammed Yasar Akthar
Unfortunately its the same error fatal: [abc.xyz.com]: FAILED! => {"msg": "The conditional check 'builds[item] == pkgversion' failed. The error was: error while evaluating conditional (builds[item] == pkgversion): 'list object' has no attribute u'0' On Friday, March 23, 2018 at 10:48:47 PM

Re: [ansible-devel] Set fact based on particular condition of list variable not working

2018-03-23 Thread Brian Coca
You dont need moustaches in conditionals: when: builds[item] == pkgversion -- -- Brian Coca -- 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

Re: [ansible-devel] get_config in Ansible 2.5.0 API

2018-03-23 Thread Brian Coca
I'm writing the new docs, but the short, DONT use get_config, use self.get_option('passwordstate_uri') after you define the option in the DOCUMENTATION variable inside the lookup in this example https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/lookup/redis.py#L7 you can see how

Re: [ansible-devel] Ansible API how to use "get_config" in Ansible 2.5.0

2018-03-23 Thread Brian Coca
You don't use get_config, you use self.get_option('optoinname'), see shipped plugins for how to define options inside the DOCUMENTATION= variable for the config system to automatically recognize them. -- -- Brian Coca -- You received this message because you are subscribed to the

[ansible-devel] Ansible API how to use "get_config" in Ansible 2.5.0

2018-03-23 Thread Trond Hindenes
I have some lookup plugins that I'd like to move to Ansible 2.5.0. Parts of the code: imports: ```python from ansible.constants import p, get_config ``` and then in the code I can do: ```python passwordstate_uri = get_config(p, passwordstate_config, "passwordstate_uri", "PASSWORDSTATE_URI","")

[ansible-devel] Set fact based on particular condition of list variable not working

2018-03-23 Thread Mohammed Yasar Akthar
I have vars file as below --- builds: - 10350.0.0 - 10351.0.0 - 10352.0.0 - 10360.0.0 - 10361.0.0 - 10362.0.0 - 10363.0.0 - 10364.0.0 - 10365.0.0 - 10366.0.0 - 10367.0.0 - 10368.0.0 - 10370.0.0 - 10371.0.0 - 10372.0.0 - 10380.0.0 - 10381.0.0 - 10382.0.0 - 10383.0.0 -