March 2019
Intermediate to advanced
412 pages
9h 49m
English
To indicate that a module supports check mode, an argument has to be set when creating the module object. This can be done before or after the argument_spec variable is defined in the module object; here, we will do it after it is defined:
module = AnsibleModule(
argument_spec = dict(
source=dict(required=True, type='str'),
dest=dict(required=True, type='str')
),
supports_check_mode=True
)
If you're modifying your existing code, don't forget to add the comma after the argument_spec dictionary definition, as shown in the preceding code.
Read now
Unlock full access