dominikkaminski.ucs_modules.univention_config_registry (0.0.3) — module

Accessing the Univention Config Registry

Authors: Moritz Bunkus (@MoritzBunkus)

Install collection

Install with ansible-galaxy collection install dominikkaminski.ucs_modules:==0.0.3


Add to requirements.yml

  collections:
    - name: dominikkaminski.ucs_modules
      version: 0.0.3

Description

You can set and unset keys in the Univention Config Registry.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Set various keys
- name: Set proxy configuration
  univention_config_registry:
    keys:
      proxy/http: http://myproxy.mydomain:3128
      proxy/https: http://myproxy.mydomain:3128
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Alternative syntax with use of Jinja.
- name: Set /etc/hosts entries
  univention_config_registry:
    kvlist:
      - key: "hosts/static/{{ item }}"
        value: myhost.fqdn
    loop: [ '192.168.0.1', '192.168.1.1' ]
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Clear proxy configuration
- name: Do not use a proxy
  univention_config_registry:
    keys:
      proxy/http:
      proxy/https:
    state: absent

Inputs

    
keys:
    description:
    - A dict of keys to set or unset. In case of unsetting, the values are ignored.
    - Either this or 'kvlist' must be given.
    required: false
    type: str

state:
    choices:
    - absent
    - present
    default: present
    description:
    - Either 'present' for setting the key/value pairs given with 'keys' or 'absent' for
      unsetting the keys from the 'keys' dict. Default is 'present'.
    type: str

kvlist:
    description:
    - You pass in a list of dicts with this parameter instead of using a dict via 'keys'.
      Each of the dicts passed via 'kvlist' must contain the keys 'key' and 'value'. This
      allows the use of Jinja in the UCR keys to set/unset.
    - Either this or 'keys' must be given.
    required: false

Outputs

message:
  description: A human-readable information about which keys where changed
meta['changed_keys']:
  description: A list of all key names that were changed
  type: array