Update various modules for check_mode

This updates the following modules to support check_mode:
* apt_key
* apt_repository
* easy_install
* pip - will always report changed due to the way it handles state
* seboolean
* selinux
* slurp - since nothing changes, it just adds that it supports
  check_mode
* subversion - reports changed when checking out new repo and
  when updating.
* supervisorctl
* svr4pkg

See issue #2114.
This commit is contained in:
Stephen Fromm
2013-02-27 12:23:35 -08:00
parent 0342b054fd
commit 8f0d8a8546
10 changed files with 58 additions and 9 deletions

View File

@@ -130,6 +130,7 @@ def main():
key=dict(required=False),
state=dict(required=False, choices=['present', 'absent'], default='present')
),
supports_check_mode=True
)
key_id = module.params['id']
@@ -153,6 +154,8 @@ def main():
if key_id and key_id in keys:
module.exit_json(changed=False)
else:
if module.check_mode:
module.exit_json(changed=True)
add_key(module, data)
changed=False
keys2 = all_keys(module)
@@ -165,6 +168,8 @@ def main():
if not key_id:
module.fail_json(msg="key is required")
if key_id in keys:
if module.check_mode:
module.exit_json(changed=True)
if remove_key(module, key_id):
changed=True
else: