# Configuration files deployment

**URL:** <https://forum.ansible.com/t/configuration-files-deployment/23192>\
**Category:** Ansible Project\
**Tags:** ansible-project\
**Created:** [December 7, 2016, 6:47pm UTC](https://forum.ansible.com/t/configuration-files-deployment/23192 "2016-12-07T18:47:12Z")\
**Posts on this page:** 2\
**Page:** 1

<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:** [December 7, 2016, 6:47pm UTC](https://forum.ansible.com/t/configuration-files-deployment/23192/1 "2016-12-07T18:47:12Z")

</div>

Make FS a list, then you can do this

- name: Deploy configuration files  
&nbsp;&nbsp;&nbsp;template: src=config1.j2 dest={{ item }}/config1  
&nbsp;&nbsp;&nbsp;with\_items: "{{ FS }}"

---

<div class="post-metadata">

**Author:** ![belajzus](https://avatars.discourse-cdn.com/v4/letter/b/df705f/32.png) [@belajzus](https://forum.ansible.com/u/belajzus)\
**Post date:** [December 13, 2016, 2:46pm UTC](https://forum.ansible.com/t/configuration-files-deployment/23192/2 "2016-12-13T14:46:54Z")

</div>

Hi Kai, thanks for help…

your suggestion could be useful, but it is not the best one.  
If I have let say 10 hosts and 10 config files, on each host for each FS I need to create list where I specify which config files to deploy on which FS.  
i.e.  
config1  
[host1.yml]  
config1: [“FS1”,“FS2”, “FS4”]

[host2.yml]  
config1: [“FS5”]

[host3.yml]  
config1: [“FS7”,“FS9”]

config2

[host1.yml]  
config1: [“FS3”,“FS4”]

[host2.yml]  
config1: [“FS7”]

[host3.yml]  
config1: [“FS1”,“FS3”]

That is to complicate because I have more than 30 hosts, and more than 20 config files.

**My idea was to define list of FS-s in inventory file for each host**  
[**host1**.yml]  
FS\_LISTS:

- name: “FS1”

config\_files: [“config1”,“config3”,“config7”]

- name: “FS3”

config\_files: [“config5”,“config6”,“config7”,“config9”,“config12”,“config13”]

- name: “FS4”

config\_files: [“config1”]

[**host2**.yml]  
FS\_LISTS:

- name: “FS3”

config\_files: [“config1”,]

- name: “FS6”

config\_files: [“config5”,“config6”,“config7”,“config9”,“config12”,“config13”]

- name: “FS7”

config\_files: [“config1”,“config12”,“config13”]

It’s simple when I want to deploy only one config file to each FS.

template: src= **config1**.j2 dest={{ item.name }}/config1  
with\_items: “{{MEMBERS\_LIST}}”

But I can’t figure out how to deploy all config files specified for some host, not just config1.  
How to permutate FS\_LIST.name with every element of list FS\_LIST.config\_files  
I want this on host1  
FS1 config1  
FS1 config2  
FS1 config3

FS3 config5  
FS3 config6

FS3 config7

FS3 config9

FS3 config12

FS3 config13

How to nest that to lists, and do this permutation.

Thanks a lot

but I’m searching for better solution.

Dana srijeda, 7. prosinca 2016. u 19:47:25 UTC+1, korisnik Kai Stian Olstad napisao je:
