mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Gconf2 module (#19540)
* Pull #19267 broke sysctl module. Minor corrections * Correct description. Functional updates
This commit is contained in:
parent
112d950794
commit
bcace3cfc4
1 changed files with 18 additions and 9 deletions
|
@ -26,9 +26,8 @@ author:
|
||||||
- "Kenneth D. Evensen (@kevensen)"
|
- "Kenneth D. Evensen (@kevensen)"
|
||||||
short_description: Edit GNOME Configurations
|
short_description: Edit GNOME Configurations
|
||||||
description:
|
description:
|
||||||
- Edit PAM service's type, control, module path and module arguments.
|
- This module allows for the manipulation of GNOME 2 Configuration via
|
||||||
In order for a PAM rule to be modified, the type, control and
|
gconftool-2. Please see the gconftool-2(1) man pages for more details.
|
||||||
module_path must match an existing rule. See man(5) pam.d for details.
|
|
||||||
version_added: "2.3"
|
version_added: "2.3"
|
||||||
options:
|
options:
|
||||||
key:
|
key:
|
||||||
|
@ -55,8 +54,8 @@ options:
|
||||||
required: true
|
required: true
|
||||||
choices:
|
choices:
|
||||||
- get
|
- get
|
||||||
- set
|
- present
|
||||||
- unset
|
- absent
|
||||||
description:
|
description:
|
||||||
- The action to take upon the key/value.
|
- The action to take upon the key/value.
|
||||||
config_source:
|
config_source:
|
||||||
|
@ -175,7 +174,7 @@ def main():
|
||||||
value=dict(required=False, default=None,
|
value=dict(required=False, default=None,
|
||||||
type='str'),
|
type='str'),
|
||||||
state=dict(required=True, default=None,
|
state=dict(required=True, default=None,
|
||||||
choices=['set', 'get', 'unset'],
|
choices=['present', 'get', 'absent'],
|
||||||
type='str'),
|
type='str'),
|
||||||
direct=dict(required=False,
|
direct=dict(required=False,
|
||||||
default=False, type='bool'),
|
default=False, type='bool'),
|
||||||
|
@ -185,12 +184,20 @@ def main():
|
||||||
supports_check_mode=True
|
supports_check_mode=True
|
||||||
)
|
)
|
||||||
|
|
||||||
|
state_values = {"present": "set", "absent": "unset", "get": "get"}
|
||||||
|
|
||||||
direct = False
|
direct = False
|
||||||
# Assign module values to dictionary values
|
# Assign module values to dictionary values
|
||||||
key = module.params['key']
|
key = module.params['key']
|
||||||
value_type = module.params['value_type']
|
value_type = module.params['value_type']
|
||||||
|
if module.params['value'].lower() == "true":
|
||||||
|
value = "true"
|
||||||
|
elif module.params['value'] == "false":
|
||||||
|
value = "false"
|
||||||
|
else:
|
||||||
value = module.params['value']
|
value = module.params['value']
|
||||||
state = module.params['state']
|
|
||||||
|
state = state_values[module.params['state']]
|
||||||
if module.params['direct'] in BOOLEANS_TRUE:
|
if module.params['direct'] in BOOLEANS_TRUE:
|
||||||
direct = True
|
direct = True
|
||||||
config_source = module.params['config_source']
|
config_source = module.params['config_source']
|
||||||
|
@ -239,7 +246,9 @@ def main():
|
||||||
|
|
||||||
facts = {}
|
facts = {}
|
||||||
facts['gconftool2'] = {'changed': change, 'key': key,
|
facts['gconftool2'] = {'changed': change, 'key': key,
|
||||||
'value_type': value_type, 'value': new_value}
|
'value_type': value_type, 'new_value': new_value,
|
||||||
|
'previous_value': current_value,
|
||||||
|
'playbook_value': module.params['value']}
|
||||||
|
|
||||||
module.exit_json(changed=change, ansible_facts=facts)
|
module.exit_json(changed=change, ansible_facts=facts)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue