# Question on using Ansible to upgrade Linux with config file overwrites

**URL:** <https://forum.ansible.com/t/question-on-using-ansible-to-upgrade-linux-with-config-file-overwrites/28945>\
**Category:** Ansible Project\
**Created:** [November 5, 2018, 5:33pm UTC](https://forum.ansible.com/t/question-on-using-ansible-to-upgrade-linux-with-config-file-overwrites/28945 "2018-11-05T17:33:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![EspressoBeanies](https://avatars.discourse-cdn.com/v4/letter/e/ea666f/32.png) [@EspressoBeanies](https://forum.ansible.com/u/EspressoBeanies)\
**Post date:** [November 5, 2018, 5:33pm UTC](https://forum.ansible.com/t/question-on-using-ansible-to-upgrade-linux-with-config-file-overwrites/28945/1 "2018-11-05T17:33:32Z")

</div>

What’s the best way to use Ansible to manage software updates where installer config files have the potential to overwrite the config settings you currently have in place? I’m trying to see if there’s a way for Ansible to apply software upgrades on all my \*NIX machines but notify me when it runs into packages that require config file replacements so that I can take a look at the changes and see how best to apply my current settings to meet the new ones. Curious to see if anyone found an effective workaround to this problem.

---

<div class="post-metadata">

**Author:** ![Dick\_Visser](https://avatars.discourse-cdn.com/v4/letter/d/d9b06d/32.png) [@Dick\_Visser](https://forum.ansible.com/u/Dick_Visser)\
**Post date:** [November 6, 2018, 7:42am UTC](https://forum.ansible.com/t/question-on-using-ansible-to-upgrade-linux-with-config-file-overwrites/28945/2 "2018-11-06T07:42:40Z")

</div>

Hi

The idea behind using Ansible is that you want to make sure a system  
is configured the way you want it.  
This works best if you use it to configure more (ideally, all) aspects  
of a system.  
Basically Ansible (or any other configuration management tool) is  
designed to make sure you don't end up in the situation you're in.  
That said, it can of course be used to bring existing systems closer  
back to what you want, but as you already know hand crafted systems  
can contain quite a lot of configuration drift.  
You also seem to be looking for some sort of interactivity when  
upgrading. What you describe is exactly how upgrades work in the  
Debian based distros.

But really you should be looking at spending effort on ansible  
playbooks that carefully set up configuration files the way you need  
them.  
If you do this right, it will cost you less work. Also you should  
consider redeploying systems onto a new version of the base OS, rather  
than upgrading them. IMHO upgrading an OS introduces a lot of subtle  
configuration drift.

Dick

---

<div class="post-metadata">

**Author:** ![Brad2](https://avatars.discourse-cdn.com/v4/letter/b/49beb7/32.png) [@Brad2](https://forum.ansible.com/u/Brad2)\
**Post date:** [November 6, 2018, 10:12am UTC](https://forum.ansible.com/t/question-on-using-ansible-to-upgrade-linux-with-config-file-overwrites/28945/3 "2018-11-06T10:12:05Z")

</div>

I’d say, just run your update. If you suspect a configuration file has changed, just run your original script that set up the configuration file. If it was changed, it will be changed back to your original configuration. If it was not changed, then nothing will happen.
