[ansible-project] Intersect and difference in Ansible

2020-09-27 Thread Fred Kanyesigye
I have been trying to create a playbook that removes the resource record 
sets for terminated EC2 instances. 

Other tasks can debug fine, but when it comes to intersect and difference 
to debug/list the common contents to keep and non-common to be removed, the 
output still brings the entire list of resource record sets. If anyone can 
help, I would really appreciate it.

  - name: running Instances
  debug:
msg: "{{item.0 | intersect(item.1)}}"
  with_items:
- "{{record_sets |json_query('ResourceRecordSets[].Name[]')}}"
- "{{running_ec2 |json_query('instances[].tags[].erp_url')}}"


- name: terminated Instances
  debug:
msg: "{{item.0 | difference(item.1)}}"
  with_items:
- "{{record_sets |json_query('ResourceRecordSets[].Name[]')}}"
- "{{running_ec2 |json_query('instances[].tags[].erp_url')}}"


-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/ec7eb879-0aec-44be-b024-2d9e14982d74n%40googlegroups.com.


[ansible-project] clear arp vrf XXX force-complete

2020-09-27 Thread stackf...@gmail.com
I am looking for following command for NXOS ansible module but I am not 
able to find it. it seems it is not available. how to accomplish this?

clear arp vrf XXX force-complete

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d381e379-20a8-4ac5-8b1c-bbbebfaf20ban%40googlegroups.com.


[ansible-project] ansible nxos bgp "restart bgp "

2020-09-27 Thread stackf...@gmail.com
Hello,

I have to write ansible script for Cisco NXOS to restart bgp. I am looking 
"restart bgp " but it looks ansible module doesn't have it available. 
what are my options? how to accomplish it?

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/d1e5c4b7-404e-4535-967c-36e4f93b5258n%40googlegroups.com.


Re: [ansible-project] deprecation of DEFAULT_HASH_BEHAVIOUR option

2020-09-27 Thread Dan Linder
I'll second ND that the hash_behavior option of "merge" is more usable in 
my situation - I have hashes of information that get built up in the 
playbook (one piece sets defaults for a location (i.e. "North America" vs 
"Europe" vs "Asia"), then a later part sets defaults for different 
datacenters, and later a specific subnet might over-ride other settings.  
This way I could have all my European systems default to using settings 
that applied to the entire zone, but my servers in different datacenters 
would get settings specific there (i.e. a Git or NTP server, etc), and 
individual subnets might have different NTP servers but still use the 
datacenters' Git server.

Merging hashes was a big win for this project.  Sadly, we don't have a 
"single source of truth", so we had to use multiple Ansible variable files 
to build up our "truth" and merging them with each other.  Our inventories 
were not the source of truth with all the information needed.  Without an 
external CMDB that could take into account the location, datacenter, and 
subnet (to name a few constraints), getting the data consistent would have 
been impossible with Ansible.

I'm not a programmer to the level that I can determine a better way to 
address this in Ansible, but I'm hoping someone will work through a way to 
merge them together and the hash merge behavior can be exposed again.

On Sunday, September 27, 2020 at 9:56:00 AM UTC-5 dick@geant.org wrote:

>
>
> On Sun, 27 Sep 2020 at 13:44, nd  wrote:
>
>> Hello,
>>
>> is there any documentation on why this was deprecated?
>
>
> According to the docs:
>
> This feature is fragile and not portable, leading to continual confusion 
> and misuse
>
>
>
>
>
> -- 
> Sent from a mobile device - please excuse the brevity, spelling and 
> punctuation.
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b618283e-ef76-44c6-be23-d2e4d7f346a8n%40googlegroups.com.


Re: [ansible-project] deprecation of DEFAULT_HASH_BEHAVIOUR option

2020-09-27 Thread Dick Visser
On Sun, 27 Sep 2020 at 13:44, nd  wrote:

> Hello,
>
> is there any documentation on why this was deprecated?


According to the docs:

This feature is fragile and not portable, leading to continual confusion
and misuse





-- 
Sent from a mobile device - please excuse the brevity, spelling and
punctuation.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAL8fbwP0A8CQ3H0RRnr9sbkocJjWCmSvd%2BH-cLaddMHZqSUA7g%40mail.gmail.com.


[ansible-project] deprecation of DEFAULT_HASH_BEHAVIOUR option

2020-09-27 Thread nd
Hello,

is there any documentation on why this was deprecated? This breaks close to 
all of my ansible roles as well as it results in a full rewrite of the 
inventory for all organisations where I use ansible. I'm using 
"hash_behaviour = merge"

Most of my inventory resides in dictionaries wich depend on getting merged 
on the inventory level. For example I have a "nginx" dictionary with 
"vhost" key in it. I depend on all vhosts from all groups a host is in to 
get merged. I have something like this for nearly all my roles. I could 
rewrite my playbook to merge all dictionaries with a group prefix using the 
combine filter (or similar workarounds) prior to including any roles. But I 
think this results in much less readable playbooks and it definitly results 
in multiple person days of work...

The other option I look into is writing a custom inventory plugin to always 
deep merge dictionaries with the same name, kind of resulting in the 
current behavior.

Anyone else with a similar problem or some insight on why this was changed? 
I was realy taken by surprise when I saw this message. If i could choose, 
I'd prefere deepmerge as default over "replace". It results in better split 
up inventories and more seperation of data in multiple files. "Replace" 
always seemed kind of useless and less useable to me.

Best regards,
nd

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/155ef9b6-63b1-4fcd-a71b-817199a54084n%40googlegroups.com.