Skip to content

suggestion for datatype parameter #20

@joba12

Description

@joba12

Hey Joseph,

any possiblity to change the type implementation in your gconftool2 module?

I've got a big list of key value pairs with along with the data type

For example a snippet of my guake variables:

gconf:
  - path: "/apps/guake/style"
    config:
      - key: "cursor_shape"
        value: "0"
        type: "int"
  - path: "/apps/guake/style/background"
    config:
      - key: "color"
        value: "#000000000000"
        type: "string"
  - path: "/apps/guake/style/font"
    config:
      - key: "allow_bold"
        value: "true"
        type: "bool"

to use this with the module i made one task for each data type, as the parameter name cannot be a variable:

- name: configure gconf string parameters
  gconftool2:
    key: "{{ item.0.path }}/{{ item.1.key }}"
    string: "{{ item.1.value }}"
  when: "'{{ item.1.type }}' == 'string'"
  with_subelements:
    - gconf
    - config

- name: configure gconf int parameters
  gconftool2:
    key: "{{ item.0.path }}/{{ item.1.key }}"
    int: "{{ item.1.value }}"
  when: "'{{ item.1.type }}' == 'int'"
  with_subelements:
    - gconf
    - config

- name: configure gconf bool parameters
  gconftool2:
    key: "{{ item.0.path }}/{{ item.1.key }}"
    bool: "{{ item.1.value }}"
  when: "'{{ item.1.type }}' == 'bool'"
  with_subelements:
    - gconf
    - config

I think it would be a lot more flexible if the datatype is defined via one parameter

i.e.:

- name: configure gconf parameters
  gconftool2:
    key: "{{ item.0.path }}/{{ item.1.key }}"
    value: "{{ item.1.value }}"
    type: "{{ item.1.type }}"
  with_subelements:
    - gconf
    - config

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions