From 07ccd3c86bda94462ee1bbc05ecd178d66f89842 Mon Sep 17 00:00:00 2001 From: Isaac Simmons Date: Mon, 23 Mar 2015 11:46:59 -0400 Subject: [PATCH] Handle ini file properties that contain interpolation errors in the initial values --- lib/ansible/modules/files/ini_file.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/ansible/modules/files/ini_file.py b/lib/ansible/modules/files/ini_file.py index 9242821ae9e..fff153af6ad 100644 --- a/lib/ansible/modules/files/ini_file.py +++ b/lib/ansible/modules/files/ini_file.py @@ -120,6 +120,9 @@ def do_ini(module, filename, section=None, option=None, value=None, state='prese if cp.get(section, option): cp.remove_option(section, option) changed = True + except ConfigParser.InterpolationError: + cp.remove_option(section, option) + changed = True except: pass @@ -143,6 +146,9 @@ def do_ini(module, filename, section=None, option=None, value=None, state='prese except ConfigParser.NoOptionError: cp.set(section, option, value) changed = True + except ConfigParser.InterpolationError: + cp.set(section, option, value) + changed = True if changed and not module.check_mode: if backup: