Subject: [InfluxData Community] [Welcome & Getting Started] Is it possible to merge or (combine) .conf files with an override behavior


Since you are using ansible too, let me show you some examples of what I have.  Instead of editing installed files on a per line basis I use templates for everything.  I create them for either individual plugins or a group of related plugins, making the template configurable with any values that I want to vary across my systems.

`roles/telegraf/templates/inputs.github.conf.j2`:
```
[[inputs.github]]
  interval = "20m"
  repositories = ["influxdata/telegraf"]
  access_token = "{{ github_access_token }}"
```

Then in `roles/telegraf/tasks/main.yml` I have something like this:
```
- name: Enable Telegraf github input plugin
  template:
    src: inputs.{{ item }}.conf.j2
    dest: /etc/telegraf/telegraf.d/inputs.{{ item }}.conf
    owner: telegraf
    group: telegraf
    mode: 0600
  loop:
    - github
  notify:
    - reload telegraf
  when: telegraf_github|bool
  become: yes
```

I have a template for main configuration file as well which removes all the plugins in it, as a starting point the file could even be empty to use the defaults.

Then I use ansible variables to configure the hosts that the template is deployed on and the settings.  I just set everything as an inventory variable, because my setup is very small, but I believe if you take advantage of everything ansible offers you can create a solution that will work for even very large deployments.

---