# Where to put environnement specific config files to copy (not templated)

**URL:** <https://forum.ansible.com/t/where-to-put-environnement-specific-config-files-to-copy-not-templated/25472>\
**Category:** Ansible Project\
**Created:** [September 13, 2017, 9:46am UTC](https://forum.ansible.com/t/where-to-put-environnement-specific-config-files-to-copy-not-templated/25472 "2017-09-13T09:46:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Julien\_Musat](https://avatars.discourse-cdn.com/v4/letter/j/8edcca/32.png) [@Julien\_Musat](https://forum.ansible.com/u/Julien_Musat)\
**Post date:** [September 13, 2017, 9:46am UTC](https://forum.ansible.com/t/where-to-put-environnement-specific-config-files-to-copy-not-templated/25472/1 "2017-09-13T09:46:10Z")

</div>

Hi,

My ansible project is multi env. I managed to put each inventory file in a separate directory (as advise in ansible best practices : [http://docs.ansible.com/ansible/latest/playbooks\_best\_practices.html#alternative-directory-layout](http://docs.ansible.com/ansible/latest/playbooks_best_practices.html#alternative-directory-layout))

I have a question regarding env specific config file. For instance if I want to copy a specific httpd.conf config file (apache) per env on the remote hosts, assuming I don’t want to use a template so I want to copy those files as is.

Currently I put them like this :

```auto
inventories/
   production/
      <b>files/
        configs/
          httpd.conf</b>
      hosts               
      group_vars/
         group1           
         group2           
      host_vars/
         hostname1        
         hostname2        

   staging/
      <b>files/
        configs/
          httpd.conf</b>
      hosts               
      group_vars/
         group1           
         group2           
      host_vars/
         stagehost1       
         stagehost2  

```

```auto
Is there a recommendation where to put those configs files ? 

```

```auto

```

---

<div class="post-metadata">

**Author:** ![Dick\_Davies](https://avatars.discourse-cdn.com/v4/letter/d/b9e5f3/32.png) [@Dick\_Davies](https://forum.ansible.com/u/Dick_Davies)\
**Post date:** [September 13, 2017, 11:25am UTC](https://forum.ansible.com/t/where-to-put-environnement-specific-config-files-to-copy-not-templated/25472/2 "2017-09-13T11:25:42Z")

</div>

What about something like:

copy:  
&nbsp;&nbsp;src: "{{ env }}/config/httpd.conf"  
&nbsp;&nbsp;dest: /etc/httpd/httpd.conf

and then just set env: production  
in production/group\_vars/all

?

(there are a few ways to calculate the 'env' var based on inventory etc. but  
they're a bit arcane IMO. Better to be explicit.)

---

<div class="post-metadata">

**Author:** ![Julien\_Musat](https://avatars.discourse-cdn.com/v4/letter/j/8edcca/32.png) [@Julien\_Musat](https://forum.ansible.com/u/Julien_Musat)\
**Post date:** [September 13, 2017, 12:54pm UTC](https://forum.ansible.com/t/where-to-put-environnement-specific-config-files-to-copy-not-templated/25472/3 "2017-09-13T12:54:24Z")

</div>

Thanks dick,

That get me started, I finally ended up mixing the use of the inventory variables : {{ inventory\_dir }} and {{ inventory\_hostname }} with {{env}}
