Skip to content

Latest commit

 

History

History
74 lines (54 loc) · 1.82 KB

README.md

File metadata and controls

74 lines (54 loc) · 1.82 KB

xml

This role is useful for generating XML configuration files with input-validation and formatting control.

Requirements

None.

Role Variables

Standard template options are supported, except for block_end_string, block_start_string, lstrip_blocks, src, trim_blocks, variable_end_string, and variable_start_string.

Additional parameters are:

Required Type Comment
dest string Path to generated file.
schema dict Allowed tags and attributes.
value dict XML content to render.
Optional Type Comment Default
header string Static header {{ ansible_managed|comment("xml") }}
spaces int Tag indent 2

Dependencies

None.

Example Playbook

(Data copied from Qt Documentation)

Combine recipe values with schema to produce a cookbook.

- hosts: localhost
  tasks:
    - include_role:
        defaults_from: 'examples/recipes/values.yml'
        name: 'xml'
        vars_from: 'examples/recipes/schema.yml'
      vars:
        dest: 'cookbook.xml'

To-Do

  • Tests
  • Better examples
  • Code a way to require that an element must contain one of a list of attributes, or be non-empty.

License

BSD

Author Information

Robert August Vincent II
(pronounced "Bob" or "Bob-Vee")