# merge two sets of AWS tags?

**URL:** <https://forum.ansible.com/t/merge-two-sets-of-aws-tags/27572>\
**Category:** Ansible Project\
**Tags:** aws\
**Created:** [May 21, 2018, 3:27am UTC](https://forum.ansible.com/t/merge-two-sets-of-aws-tags/27572 "2018-05-21T03:27:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karl\_Auer](https://avatars.discourse-cdn.com/v4/letter/k/cc9497/32.png) [@Karl\_Auer](https://forum.ansible.com/u/Karl_Auer)\
**Post date:** [May 21, 2018, 3:27am UTC](https://forum.ansible.com/t/merge-two-sets-of-aws-tags/27572/1 "2018-05-21T03:27:56Z")

</div>

I am clearly having a brain failure, but I can’t figure out how to merge two sets of AWS tags.

AWS tags are generally defined as a variable (or attribute in a module) something like this:

tags:  
name1: value1  
name2: value2

So I will generally have some standard tags set up in a variable like this:

standard\_tags:  
Name: AServer  
CostCentre: Operations

Then I generate some extra tags, so I have another variable somewhere like this:

extra\_tags:  
fred: wilma

barney: betty

How can I get one variable that looks like this:

all\_tags:  
Name: AServer

CostCentre: Operations  
fred: wilma

barney: betty

?

Regards, K.

---

<div class="post-metadata">

**Author:** ![Kai\_Stian\_Olstad](https://avatars.discourse-cdn.com/v4/letter/k/e19adc/32.png) [@Kai\_Stian\_Olstad](https://forum.ansible.com/u/Kai_Stian_Olstad)\
**Post date:** [May 21, 2018, 8:03am UTC](https://forum.ansible.com/t/merge-two-sets-of-aws-tags/27572/2 "2018-05-21T08:03:34Z")

</div>

I assume fred: is just indented incorrectly so you are looking for the combine filter.

&nbsp;&nbsp;&nbsp;- set\_fact:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;all\_tags: '{{ standard\_tags | combine(extra\_tags) }}'
