Repository: ansible-collections/community.general

Issue:
gconftool2 throws an IndexError exception when setting configuration
### Summary

When setting a key using gconftool2, an IndexError exception is thrown because the wrong index is used when formatting the command string. It appears to have been broken since version 4.8.1 of this collection. It should be a simple one character fix and would be great if we could have it back ported as a patch for the older releases.

Effectively 
`cmd.extend(["--type", self.value_type, "--{3}".format(call_type), self.key, self.value])`
Should be
`cmd.extend(["--type", self.value_type, "--{0}".format(call_type), self.key, self.value])`

### Issue Type

Bug Report

### Component Name

gconftool2

### Ansible Version

```console (paste below)
$ ansible --version
ansible [core 2.13.5]
  config file = /Users/***/work/ansible/ansible.cfg
  configured module search path = ['/Users/***/work/ansible/library']
  ansible python module location = /Users/***/Library/Python/3.9/lib/python/site-packages/ansible
  ansible collection location = /Users/***/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/***/Library/Python/3.9/bin/ansible
  python version = 3.9.6 (default, Sep 26 2022, 11:37:49) [Clang 14.0.0 (clang-1400.0.29.202)]
  jinja version = 3.1.2
  libyaml = True
```


### Community.general Version

```console (paste below)
$ ansible-galaxy collection list community.general
Collection        Version
----------------- -------
community.general 5.7.0 
```


### Configuration

```yaml (paste below)
- community.general.gconftool2:
    key: '/desktop/gnome/remote_access/enabled'
    value_type: 'bool'
    value: 'true'
    state: 'present'
```


### OS / Environment

Targeting CentOS 7.9

### Steps to Reproduce

<!--- Paste example playbooks or commands between quotes below -->
```yaml (paste below)

```


### Expected Results

I expect  gconftool2 to set the key and not throw an exception

### Actual Results

```console (paste below)
Traceback (most recent call last):
  File \"/home/***/.ansible/tmp/ansible-tmp-1669197386.99966-48716-109362476478706/AnsiballZ_gconftool2.py\", line 107, in <module>
    _ansiballz_main()
  File \"/home/***/.ansible/tmp/ansible-tmp-1669197386.99966-48716-109362476478706/AnsiballZ_gconftool2.py\", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File \"/home/***/.ansible/tmp/ansible-tmp-1669197386.99966-48716-109362476478706/AnsiballZ_gconftool2.py\", line 48, in invoke_module
    run_name='__main__', alter_sys=True)
  File \"/usr/lib64/python2.7/runpy.py\", line 176, in run_module
    fname, loader, pkg_name)
  File \"/usr/lib64/python2.7/runpy.py\", line 82, in _run_module_code
    mod_name, mod_fname, mod_loader, pkg_name)
  File \"/usr/lib64/python2.7/runpy.py\", line 72, in _run_code
    exec code in run_globals
  File \"/tmp/ansible_community.general.gconftool2_payload__SXOuh/ansible_community.general.gconftool2_payload.zip/ansible_collections/community/general/plugins/modules/system/gconftool2.py\", line 230, in <module>
  File \"/tmp/ansible_community.general.gconftool2_payload__SXOuh/ansible_community.general.gconftool2_payload.zip/ansible_collections/community/general/plugins/modules/system/gconftool2.py\", line 213, in main
  File \"/tmp/ansible_community.general.gconftool2_payload__SXOuh/ansible_community.general.gconftool2_payload.zip/ansible_collections/community/general/plugins/modules/system/gconftool2.py\", line 128, in call
  IndexError: tuple index out of range
```


### Code of Conduct

- [X] I agree to follow the Ansible Code of Conduct


Discussion:
Files identified in the description:
* [`plugins/modules/gconftool2.py`](https://github.com/ansible-collections/community.general/blob/main/plugins/modules/gconftool2.py)

If these files are incorrect, please update the `component name` section of the description or use the `!component` bot command.

[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: components_banner --->
cc @Akasurde @kevensen
[click here for bot help](https://github.com/ansible/ansibullbot/blob/devel/ISSUE_HELP.md)
<!--- boilerplate: notify --->
CC @russoz
Is there a likely timescale for this fix? It's a very small change so hoped it could be picked up quickly. 
@ChrisNicoll-Pro I don't know, but if you want to have it fixed quickly, and understand what needs to be fixed, why not create a PR yourself? (Don't forget to add a [changelog fragment](https://docs.ansible.com/ansible/devel/community/collection_development_process.html#creating-a-changelog-fragment).)
Hi guys, sorry for not responding timely. The module went through a complete revamp, so the development branch doesn't look like that at all. I suppose we could do a bugfix on the backports. 
Hi, backporting the bugfix to older versions would be much appreciated. I had a look through the documentation for creating MRs against this project but it didn't look immediately obvious to me exactly how to do the backports. I thought it might be faster for someone familiar with the process to do it. 
Since the change was a complete rewrite that cannot be backported, a direct PR against the stable-5 branch (https://github.com/ansible-collections/community.general/blob/stable-5/plugins/modules/system/gconftool2.py#L128) will do.

Resolving patch:
diff --git a/plugins/modules/system/gconftool2.py b/plugins/modules/system/gconftool2.py
--- a/plugins/modules/system/gconftool2.py
+++ b/plugins/modules/system/gconftool2.py
@@ -125,7 +125,7 @@ def call(self, call_type, fail_onerr=True):
             elif call_type == 'set':
                 cmd.extend(direct)
                 cmd.extend(config_source)
-                cmd.extend(["--type", self.value_type, "--{3}".format(call_type), self.key, self.value])
+                cmd.extend(["--type", self.value_type, "--{0}".format(call_type), self.key, self.value])
             elif call_type == 'unset':
                 cmd.extend(["--unset", self.key])
 


Test patch: