"cannot yet run check mode against old-style modules" ??

ansible-1.4.1 exhibits this problem on Fedora. Doing things by the book ( http://docs.ansible.com/developing_modules.html#check-mode ):

module = AnsibleModule(
argument_spec = dict(…),
supports_check_mode=True
)

if module.check_mode:

Check if any changes would be made by don’t actually make those changes

module.exit_json(changed=check_if_system_state_would_be_changed())

I get {“msg”: “cannot yet run check mode against old-style modules”, “skippped”: true}

when attempting to run in “check mode”.

code (still work in progress) at https://github.com/droopy4096/ansible-owncloud/blob/master/library/augeas

found https://github.com/ansible/ansible/pull/5151 - is that the resolution? I’m trying to stick with Fedora packages - does it mean gotta get 1.5 branch?

The issue you reference (5151) is the resolution.

If you do not want to update to ansible 1.5 (devel) yet, you have 1 other option.

Instead of using the following in the module:

from ansible.module_utils.basic import *

You could use:

#<<INCLUDE_ANSIBLE_MODULE_COMMON>>

The way it is being done currently in your module with the import is the new way going forward, and helps code editors figure out where certain things are coming from. But the older way is still valid, and should be used right now with versions of ansible older than 1.5 if --check mode functionality is a requirement. This of course is already fixed in ansible 1.5.

great! much thanks. all works now as expected

so to clarify - when we do upgrade to 1.5+ - above would need to be reversed, correct?

You don’t necessarily have to switch back. Both module replacer strings will still work.

Although it may be a good idea to switch at some point after the 1.5 release.