diff --git a/files/lineinfile b/files/lineinfile index 29ff9603fdf..7dd38a3cf05 100644 --- a/files/lineinfile +++ b/files/lineinfile @@ -305,7 +305,7 @@ def main(): module.fail_json(rc=256, msg='Destination %s is a directory !' % dest) if params['state'] == 'present': - if 'line' not in params: + if params.get('line') is None: module.fail_json(msg='line= is required with state=present') # Deal with the insertafter default value manually, to avoid errors