mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-06-27 10:40:22 -07:00
host: fix changed is not available on fail
This commit is contained in:
parent
009fdbf96a
commit
ca5e5cfebc
1 changed files with 6 additions and 6 deletions
|
@ -167,13 +167,13 @@ def main():
|
||||||
result['state'] = host.state
|
result['state'] = host.state
|
||||||
result['changed'] = False
|
result['changed'] = False
|
||||||
|
|
||||||
err = host.validate_has_hostname_on_present()
|
result['msg'] = host.validate_has_hostname_on_present()
|
||||||
if err:
|
if result['msg']:
|
||||||
module.fail_json(msg=err)
|
module.fail_json(**result)
|
||||||
|
|
||||||
err = host.validate_has_ip_or_hostname_on_absent()
|
result['msg'] = host.validate_has_ip_or_hostname_on_absent()
|
||||||
if err:
|
if result['msg']:
|
||||||
module.fail_json(msg=err)
|
module.fail_json(**result)
|
||||||
|
|
||||||
host.proceed_hosts_entries()
|
host.proceed_hosts_entries()
|
||||||
if host.state == 'present':
|
if host.state == 'present':
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue