From 33ef72b5842f4f1f2550654ac99201c46d761d9f Mon Sep 17 00:00:00 2001 From: Gyorgy Szombathelyi Date: Fri, 11 Nov 2016 14:21:41 +0100 Subject: [PATCH] Ini_file: fix regression with the create option The new create option with the default value 'no' changes the behavior from the previous Ansible releases. Change the default to 'yes' to create missing ini files by default. Fixes: #5488 --- lib/ansible/modules/files/ini_file.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/files/ini_file.py b/lib/ansible/modules/files/ini_file.py index e529987ad3..5c09b2de91 100644 --- a/lib/ansible/modules/files/ini_file.py +++ b/lib/ansible/modules/files/ini_file.py @@ -81,10 +81,10 @@ options: create: required: false choices: [ "yes", "no" ] - default: "no" + default: "yes" description: - - If specified, the file will be created if it does not already exist. - By default it will fail if the file is missing. + - If set to 'no', the module will fail if the file does not already exist. + By default it will create the file if it is missing. version_added: "2.2" notes: - While it is possible to add an I(option) without specifying a I(value), this makes @@ -253,7 +253,7 @@ def main(): backup = dict(default='no', type='bool'), state = dict(default='present', choices=['present', 'absent']), no_extra_spaces = dict(required=False, default=False, type='bool'), - create=dict(default=False, type='bool') + create=dict(default=True, type='bool') ), add_file_common_args = True, supports_check_mode = True