ma*.py: normalize docs (#9389)
* ma*.py: normalize docs * Update plugins/modules/matrix.py Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de>pull/8676/merge
parent
a99f72fc36
commit
a9fca56374
|
@ -12,54 +12,54 @@ from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: macports
|
module: macports
|
||||||
author: "Jimmy Tang (@jcftang)"
|
author: "Jimmy Tang (@jcftang)"
|
||||||
short_description: Package manager for MacPorts
|
short_description: Package manager for MacPorts
|
||||||
description:
|
description:
|
||||||
- Manages MacPorts packages (ports)
|
- Manages MacPorts packages (ports).
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
attributes:
|
attributes:
|
||||||
check_mode:
|
check_mode:
|
||||||
support: none
|
support: none
|
||||||
diff_mode:
|
diff_mode:
|
||||||
support: none
|
support: none
|
||||||
options:
|
options:
|
||||||
name:
|
name:
|
||||||
description:
|
description:
|
||||||
- A list of port names.
|
- A list of port names.
|
||||||
aliases: ['port']
|
aliases: ['port']
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
selfupdate:
|
selfupdate:
|
||||||
description:
|
description:
|
||||||
- Update Macports and the ports tree, either prior to installing ports or as a separate step.
|
- Update Macports and the ports tree, either prior to installing ports or as a separate step.
|
||||||
- Equivalent to running C(port selfupdate).
|
- Equivalent to running C(port selfupdate).
|
||||||
aliases: ['update_cache', 'update_ports']
|
aliases: ['update_cache', 'update_ports']
|
||||||
default: false
|
default: false
|
||||||
type: bool
|
type: bool
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Indicates the desired state of the port.
|
- Indicates the desired state of the port.
|
||||||
choices: [ 'present', 'absent', 'active', 'inactive', 'installed', 'removed']
|
choices: ['present', 'absent', 'active', 'inactive', 'installed', 'removed']
|
||||||
default: present
|
default: present
|
||||||
type: str
|
type: str
|
||||||
upgrade:
|
upgrade:
|
||||||
description:
|
description:
|
||||||
- Upgrade all outdated ports, either prior to installing ports or as a separate step.
|
- Upgrade all outdated ports, either prior to installing ports or as a separate step.
|
||||||
- Equivalent to running C(port upgrade outdated).
|
- Equivalent to running C(port upgrade outdated).
|
||||||
default: false
|
default: false
|
||||||
type: bool
|
type: bool
|
||||||
variant:
|
variant:
|
||||||
description:
|
description:
|
||||||
- A port variant specification.
|
- A port variant specification.
|
||||||
- 'O(variant) is only supported with O(state=installed) and O(state=present).'
|
- O(variant) is only supported with O(state=installed) and O(state=present).
|
||||||
aliases: ['variants']
|
aliases: ['variants']
|
||||||
type: str
|
type: str
|
||||||
'''
|
"""
|
||||||
EXAMPLES = '''
|
|
||||||
|
EXAMPLES = r"""
|
||||||
- name: Install the foo port
|
- name: Install the foo port
|
||||||
community.general.macports:
|
community.general.macports:
|
||||||
name: foo
|
name: foo
|
||||||
|
@ -74,8 +74,8 @@ EXAMPLES = '''
|
||||||
name: "{{ ports }}"
|
name: "{{ ports }}"
|
||||||
vars:
|
vars:
|
||||||
ports:
|
ports:
|
||||||
- foo
|
- foo
|
||||||
- foo-tools
|
- foo-tools
|
||||||
|
|
||||||
- name: Update Macports and the ports tree, then upgrade all outdated ports
|
- name: Update Macports and the ports tree, then upgrade all outdated ports
|
||||||
community.general.macports:
|
community.general.macports:
|
||||||
|
@ -101,7 +101,7 @@ EXAMPLES = '''
|
||||||
community.general.macports:
|
community.general.macports:
|
||||||
name: foo
|
name: foo
|
||||||
state: inactive
|
state: inactive
|
||||||
'''
|
"""
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
|
@ -9,27 +9,21 @@ from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = r'''
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
author:
|
author:
|
||||||
- Dag Wieers (@dagwieers)
|
- Dag Wieers (@dagwieers)
|
||||||
module: mail
|
module: mail
|
||||||
short_description: Send an email
|
short_description: Send an email
|
||||||
description:
|
description:
|
||||||
- This module is useful for sending emails from playbooks.
|
- This module is useful for sending emails from playbooks.
|
||||||
- One may wonder why automate sending emails? In complex environments
|
- One may wonder why automate sending emails? In complex environments there are from time to time processes that cannot be automated, either
|
||||||
there are from time to time processes that cannot be automated, either
|
because you lack the authority to make it so, or because not everyone agrees to a common approach.
|
||||||
because you lack the authority to make it so, or because not everyone
|
- If you cannot automate a specific step, but the step is non-blocking, sending out an email to the responsible party to make them perform their
|
||||||
agrees to a common approach.
|
part of the bargain is an elegant way to put the responsibility in someone else's lap.
|
||||||
- If you cannot automate a specific step, but the step is non-blocking,
|
- Of course sending out a mail can be equally useful as a way to notify one or more people in a team that a specific action has been (successfully)
|
||||||
sending out an email to the responsible party to make them perform their
|
taken.
|
||||||
part of the bargain is an elegant way to put the responsibility in
|
|
||||||
someone else's lap.
|
|
||||||
- Of course sending out a mail can be equally useful as a way to notify
|
|
||||||
one or more people in a team that a specific action has been
|
|
||||||
(successfully) taken.
|
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
attributes:
|
attributes:
|
||||||
check_mode:
|
check_mode:
|
||||||
support: none
|
support: none
|
||||||
|
@ -38,106 +32,105 @@ attributes:
|
||||||
options:
|
options:
|
||||||
sender:
|
sender:
|
||||||
description:
|
description:
|
||||||
- The email-address the mail is sent from. May contain address and phrase.
|
- The email-address the mail is sent from. May contain address and phrase.
|
||||||
type: str
|
type: str
|
||||||
default: root
|
default: root
|
||||||
aliases: [ from ]
|
aliases: [from]
|
||||||
to:
|
to:
|
||||||
description:
|
description:
|
||||||
- The email-address(es) the mail is being sent to.
|
- The email-address(es) the mail is being sent to.
|
||||||
- This is a list, which may contain address and phrase portions.
|
- This is a list, which may contain address and phrase portions.
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
default: root
|
default: root
|
||||||
aliases: [ recipients ]
|
aliases: [recipients]
|
||||||
cc:
|
cc:
|
||||||
description:
|
description:
|
||||||
- The email-address(es) the mail is being copied to.
|
- The email-address(es) the mail is being copied to.
|
||||||
- This is a list, which may contain address and phrase portions.
|
- This is a list, which may contain address and phrase portions.
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
default: []
|
default: []
|
||||||
bcc:
|
bcc:
|
||||||
description:
|
description:
|
||||||
- The email-address(es) the mail is being 'blind' copied to.
|
- The email-address(es) the mail is being 'blind' copied to.
|
||||||
- This is a list, which may contain address and phrase portions.
|
- This is a list, which may contain address and phrase portions.
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
default: []
|
default: []
|
||||||
subject:
|
subject:
|
||||||
description:
|
description:
|
||||||
- The subject of the email being sent.
|
- The subject of the email being sent.
|
||||||
required: true
|
required: true
|
||||||
type: str
|
type: str
|
||||||
aliases: [ msg ]
|
aliases: [msg]
|
||||||
body:
|
body:
|
||||||
description:
|
description:
|
||||||
- The body of the email being sent.
|
- The body of the email being sent.
|
||||||
type: str
|
type: str
|
||||||
username:
|
username:
|
||||||
description:
|
description:
|
||||||
- If SMTP requires username.
|
- If SMTP requires username.
|
||||||
type: str
|
type: str
|
||||||
password:
|
password:
|
||||||
description:
|
description:
|
||||||
- If SMTP requires password.
|
- If SMTP requires password.
|
||||||
type: str
|
type: str
|
||||||
host:
|
host:
|
||||||
description:
|
description:
|
||||||
- The mail server.
|
- The mail server.
|
||||||
type: str
|
type: str
|
||||||
default: localhost
|
default: localhost
|
||||||
port:
|
port:
|
||||||
description:
|
description:
|
||||||
- The mail server port.
|
- The mail server port.
|
||||||
- This must be a valid integer between 1 and 65534
|
- This must be a valid integer between V(1) and V(65534).
|
||||||
type: int
|
type: int
|
||||||
default: 25
|
default: 25
|
||||||
attach:
|
attach:
|
||||||
description:
|
description:
|
||||||
- A list of pathnames of files to attach to the message.
|
- A list of pathnames of files to attach to the message.
|
||||||
- Attached files will have their content-type set to C(application/octet-stream).
|
- Attached files will have their content-type set to C(application/octet-stream).
|
||||||
type: list
|
type: list
|
||||||
elements: path
|
elements: path
|
||||||
default: []
|
default: []
|
||||||
headers:
|
headers:
|
||||||
description:
|
description:
|
||||||
- A list of headers which should be added to the message.
|
- A list of headers which should be added to the message.
|
||||||
- Each individual header is specified as C(header=value) (see example below).
|
- Each individual header is specified as V(header=value) (see example below).
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
default: []
|
default: []
|
||||||
charset:
|
charset:
|
||||||
description:
|
description:
|
||||||
- The character set of email being sent.
|
- The character set of email being sent.
|
||||||
type: str
|
type: str
|
||||||
default: utf-8
|
default: utf-8
|
||||||
subtype:
|
subtype:
|
||||||
description:
|
description:
|
||||||
- The minor mime type, can be either V(plain) or V(html).
|
- The minor mime type, can be either V(plain) or V(html).
|
||||||
- The major type is always V(text).
|
- The major type is always V(text).
|
||||||
type: str
|
type: str
|
||||||
choices: [ html, plain ]
|
choices: [html, plain]
|
||||||
default: plain
|
default: plain
|
||||||
secure:
|
secure:
|
||||||
description:
|
description:
|
||||||
- If V(always), the connection will only send email if the connection is Encrypted.
|
- If V(always), the connection will only send email if the connection is Encrypted. If the server does not accept the encrypted connection
|
||||||
If the server doesn't accept the encrypted connection it will fail.
|
it will fail.
|
||||||
- If V(try), the connection will attempt to setup a secure SSL/TLS session, before trying to send.
|
- If V(try), the connection will attempt to setup a secure SSL/TLS session, before trying to send.
|
||||||
- If V(never), the connection will not attempt to setup a secure SSL/TLS session, before sending
|
- If V(never), the connection will not attempt to setup a secure SSL/TLS session, before sending.
|
||||||
- If V(starttls), the connection will try to upgrade to a secure SSL/TLS connection, before sending.
|
- If V(starttls), the connection will try to upgrade to a secure SSL/TLS connection, before sending. If it is unable to do so it will fail.
|
||||||
If it is unable to do so it will fail.
|
|
||||||
type: str
|
type: str
|
||||||
choices: [ always, never, starttls, try ]
|
choices: [always, never, starttls, try]
|
||||||
default: try
|
default: try
|
||||||
timeout:
|
timeout:
|
||||||
description:
|
description:
|
||||||
- Sets the timeout in seconds for connection attempts.
|
- Sets the timeout in seconds for connection attempts.
|
||||||
type: int
|
type: int
|
||||||
default: 20
|
default: 20
|
||||||
ehlohost:
|
ehlohost:
|
||||||
description:
|
description:
|
||||||
- Allows for manual specification of host for EHLO.
|
- Allows for manual specification of host for EHLO.
|
||||||
type: str
|
type: str
|
||||||
version_added: 3.8.0
|
version_added: 3.8.0
|
||||||
message_id_domain:
|
message_id_domain:
|
||||||
|
@ -147,9 +140,9 @@ options:
|
||||||
type: str
|
type: str
|
||||||
default: ansible
|
default: ansible
|
||||||
version_added: 8.2.0
|
version_added: 8.2.0
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = r'''
|
EXAMPLES = r"""
|
||||||
- name: Example playbook sending mail to root
|
- name: Example playbook sending mail to root
|
||||||
community.general.mail:
|
community.general.mail:
|
||||||
subject: System {{ ansible_hostname }} has been successfully provisioned.
|
subject: System {{ ansible_hostname }} has been successfully provisioned.
|
||||||
|
@ -174,15 +167,15 @@ EXAMPLES = r'''
|
||||||
body: Hello, this is an e-mail. I hope you like it ;-)
|
body: Hello, this is an e-mail. I hope you like it ;-)
|
||||||
from: jane@example.net (Jane Jolie)
|
from: jane@example.net (Jane Jolie)
|
||||||
to:
|
to:
|
||||||
- John Doe <j.d@example.org>
|
- John Doe <j.d@example.org>
|
||||||
- Suzie Something <sue@example.com>
|
- Suzie Something <sue@example.com>
|
||||||
cc: Charlie Root <root@localhost>
|
cc: Charlie Root <root@localhost>
|
||||||
attach:
|
attach:
|
||||||
- /etc/group
|
- /etc/group
|
||||||
- /tmp/avatar2.png
|
- /tmp/avatar2.png
|
||||||
headers:
|
headers:
|
||||||
- Reply-To=john@example.com
|
- Reply-To=john@example.com
|
||||||
- X-Special="Something or other"
|
- X-Special="Something or other"
|
||||||
charset: us-ascii
|
charset: us-ascii
|
||||||
delegate_to: localhost
|
delegate_to: localhost
|
||||||
|
|
||||||
|
@ -222,7 +215,7 @@ EXAMPLES = r'''
|
||||||
subject: Ansible-report
|
subject: Ansible-report
|
||||||
body: System {{ ansible_hostname }} has been successfully provisioned.
|
body: System {{ ansible_hostname }} has been successfully provisioned.
|
||||||
secure: starttls
|
secure: starttls
|
||||||
'''
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import smtplib
|
import smtplib
|
||||||
|
|
|
@ -8,8 +8,7 @@
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
DOCUMENTATION = r'''
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: make
|
module: make
|
||||||
short_description: Run targets in a Makefile
|
short_description: Run targets in a Makefile
|
||||||
requirements:
|
requirements:
|
||||||
|
@ -65,9 +64,9 @@ options:
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
version_added: 7.2.0
|
version_added: 7.2.0
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = r'''
|
EXAMPLES = r"""
|
||||||
- name: Build the default target
|
- name: Build the default target
|
||||||
community.general.make:
|
community.general.make:
|
||||||
chdir: /home/ubuntu/cool-project
|
chdir: /home/ubuntu/cool-project
|
||||||
|
@ -103,9 +102,9 @@ EXAMPLES = r'''
|
||||||
# The following adds TARGET=arm64 TARGET_ARCH=aarch64 to the command line:
|
# The following adds TARGET=arm64 TARGET_ARCH=aarch64 to the command line:
|
||||||
TARGET: arm64
|
TARGET: arm64
|
||||||
TARGET_ARCH: aarch64
|
TARGET_ARCH: aarch64
|
||||||
'''
|
"""
|
||||||
|
|
||||||
RETURN = r'''
|
RETURN = r"""
|
||||||
chdir:
|
chdir:
|
||||||
description:
|
description:
|
||||||
- The value of the module parameter O(chdir).
|
- The value of the module parameter O(chdir).
|
||||||
|
@ -143,7 +142,7 @@ targets:
|
||||||
type: str
|
type: str
|
||||||
returned: success
|
returned: success
|
||||||
version_added: 7.2.0
|
version_added: 7.2.0
|
||||||
'''
|
"""
|
||||||
|
|
||||||
from ansible.module_utils.six import iteritems
|
from ansible.module_utils.six import iteritems
|
||||||
from ansible.module_utils.six.moves import shlex_quote
|
from ansible.module_utils.six.moves import shlex_quote
|
||||||
|
|
|
@ -8,8 +8,7 @@ from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
|
|
||||||
module: manageiq_alert_profiles
|
module: manageiq_alert_profiles
|
||||||
|
|
||||||
short_description: Configuration of alert profiles for ManageIQ
|
short_description: Configuration of alert profiles for ManageIQ
|
||||||
|
@ -20,7 +19,6 @@ extends_documentation_fragment:
|
||||||
author: Elad Alfassa (@elad661) <ealfassa@redhat.com>
|
author: Elad Alfassa (@elad661) <ealfassa@redhat.com>
|
||||||
description:
|
description:
|
||||||
- The manageiq_alert_profiles module supports adding, updating and deleting alert profiles in ManageIQ.
|
- The manageiq_alert_profiles module supports adding, updating and deleting alert profiles in ManageIQ.
|
||||||
|
|
||||||
attributes:
|
attributes:
|
||||||
check_mode:
|
check_mode:
|
||||||
support: none
|
support: none
|
||||||
|
@ -31,8 +29,8 @@ options:
|
||||||
state:
|
state:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- absent - alert profile should not exist,
|
- V(absent) - alert profile should not exist,
|
||||||
- present - alert profile should exist,
|
- V(present) - alert profile should exist.
|
||||||
choices: ['absent', 'present']
|
choices: ['absent', 'present']
|
||||||
default: 'present'
|
default: 'present'
|
||||||
name:
|
name:
|
||||||
|
@ -43,23 +41,21 @@ options:
|
||||||
resource_type:
|
resource_type:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- The resource type for the alert profile in ManageIQ. Required when state is "present".
|
- The resource type for the alert profile in ManageIQ. Required when O(state=present).
|
||||||
choices: ['Vm', 'ContainerNode', 'MiqServer', 'Host', 'Storage', 'EmsCluster',
|
choices: ['Vm', 'ContainerNode', 'MiqServer', 'Host', 'Storage', 'EmsCluster', 'ExtManagementSystem', 'MiddlewareServer']
|
||||||
'ExtManagementSystem', 'MiddlewareServer']
|
|
||||||
alerts:
|
alerts:
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
description:
|
description:
|
||||||
- List of alert descriptions to assign to this profile.
|
- List of alert descriptions to assign to this profile.
|
||||||
- Required if state is "present"
|
- Required if O(state=present).
|
||||||
notes:
|
notes:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- Optional notes for this profile
|
- Optional notes for this profile.
|
||||||
|
"""
|
||||||
|
|
||||||
'''
|
EXAMPLES = r"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
|
||||||
- name: Add an alert profile to ManageIQ
|
- name: Add an alert profile to ManageIQ
|
||||||
community.general.manageiq_alert_profiles:
|
community.general.manageiq_alert_profiles:
|
||||||
state: present
|
state: present
|
||||||
|
@ -72,7 +68,7 @@ EXAMPLES = '''
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
username: 'admin'
|
username: 'admin'
|
||||||
password: 'smartvm'
|
password: 'smartvm'
|
||||||
validate_certs: false # only do this when you trust the network!
|
validate_certs: false # only do this when you trust the network!
|
||||||
|
|
||||||
- name: Delete an alert profile from ManageIQ
|
- name: Delete an alert profile from ManageIQ
|
||||||
community.general.manageiq_alert_profiles:
|
community.general.manageiq_alert_profiles:
|
||||||
|
@ -82,11 +78,11 @@ EXAMPLES = '''
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
username: 'admin'
|
username: 'admin'
|
||||||
password: 'smartvm'
|
password: 'smartvm'
|
||||||
validate_certs: false # only do this when you trust the network!
|
validate_certs: false # only do this when you trust the network!
|
||||||
'''
|
"""
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r"""
|
||||||
'''
|
"""
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible_collections.community.general.plugins.module_utils.manageiq import ManageIQ, manageiq_argument_spec
|
from ansible_collections.community.general.plugins.module_utils.manageiq import ManageIQ, manageiq_argument_spec
|
||||||
|
|
|
@ -8,8 +8,7 @@ from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
|
|
||||||
module: manageiq_alerts
|
module: manageiq_alerts
|
||||||
|
|
||||||
short_description: Configuration of alerts in ManageIQ
|
short_description: Configuration of alerts in ManageIQ
|
||||||
|
@ -20,7 +19,6 @@ extends_documentation_fragment:
|
||||||
author: Elad Alfassa (@elad661) <ealfassa@redhat.com>
|
author: Elad Alfassa (@elad661) <ealfassa@redhat.com>
|
||||||
description:
|
description:
|
||||||
- The manageiq_alerts module supports adding, updating and deleting alerts in ManageIQ.
|
- The manageiq_alerts module supports adding, updating and deleting alerts in ManageIQ.
|
||||||
|
|
||||||
attributes:
|
attributes:
|
||||||
check_mode:
|
check_mode:
|
||||||
support: none
|
support: none
|
||||||
|
@ -31,8 +29,8 @@ options:
|
||||||
state:
|
state:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- absent - alert should not exist,
|
- V(absent) - alert should not exist,
|
||||||
- present - alert should exist,
|
- V(present) - alert should exist.
|
||||||
required: false
|
required: false
|
||||||
choices: ['absent', 'present']
|
choices: ['absent', 'present']
|
||||||
default: 'present'
|
default: 'present'
|
||||||
|
@ -44,9 +42,8 @@ options:
|
||||||
resource_type:
|
resource_type:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- The entity type for the alert in ManageIQ. Required when state is "present".
|
- The entity type for the alert in ManageIQ. Required when O(state=present).
|
||||||
choices: ['Vm', 'ContainerNode', 'MiqServer', 'Host', 'Storage', 'EmsCluster',
|
choices: ['Vm', 'ContainerNode', 'MiqServer', 'Host', 'Storage', 'EmsCluster', 'ExtManagementSystem', 'MiddlewareServer']
|
||||||
'ExtManagementSystem', 'MiddlewareServer']
|
|
||||||
expression_type:
|
expression_type:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
|
@ -58,20 +55,18 @@ options:
|
||||||
description:
|
description:
|
||||||
- The alert expression for ManageIQ.
|
- The alert expression for ManageIQ.
|
||||||
- Can either be in the "Miq Expression" format or the "Hash Expression format".
|
- Can either be in the "Miq Expression" format or the "Hash Expression format".
|
||||||
- Required if state is "present".
|
- Required if O(state=present).
|
||||||
enabled:
|
enabled:
|
||||||
description:
|
description:
|
||||||
- Enable or disable the alert. Required if state is "present".
|
- Enable or disable the alert. Required if O(state=present).
|
||||||
type: bool
|
type: bool
|
||||||
options:
|
options:
|
||||||
type: dict
|
type: dict
|
||||||
description:
|
description:
|
||||||
- Additional alert options, such as notification type and frequency
|
- Additional alert options, such as notification type and frequency.
|
||||||
|
"""
|
||||||
|
|
||||||
|
EXAMPLES = r"""
|
||||||
'''
|
|
||||||
|
|
||||||
EXAMPLES = '''
|
|
||||||
- name: Add an alert with a "hash expression" to ManageIQ
|
- name: Add an alert with a "hash expression" to ManageIQ
|
||||||
community.general.manageiq_alerts:
|
community.general.manageiq_alerts:
|
||||||
state: present
|
state: present
|
||||||
|
@ -83,15 +78,15 @@ EXAMPLES = '''
|
||||||
from: "example@example.com"
|
from: "example@example.com"
|
||||||
resource_type: ContainerNode
|
resource_type: ContainerNode
|
||||||
expression:
|
expression:
|
||||||
eval_method: hostd_log_threshold
|
eval_method: hostd_log_threshold
|
||||||
mode: internal
|
mode: internal
|
||||||
options: {}
|
options: {}
|
||||||
enabled: true
|
enabled: true
|
||||||
manageiq_connection:
|
manageiq_connection:
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
username: 'admin'
|
username: 'admin'
|
||||||
password: 'smartvm'
|
password: 'smartvm'
|
||||||
validate_certs: false # only do this when you trust the network!
|
validate_certs: false # only do this when you trust the network!
|
||||||
|
|
||||||
- name: Add an alert with a "miq expression" to ManageIQ
|
- name: Add an alert with a "miq expression" to ManageIQ
|
||||||
community.general.manageiq_alerts:
|
community.general.manageiq_alerts:
|
||||||
|
@ -105,20 +100,20 @@ EXAMPLES = '''
|
||||||
resource_type: Vm
|
resource_type: Vm
|
||||||
expression_type: miq
|
expression_type: miq
|
||||||
expression:
|
expression:
|
||||||
and:
|
and:
|
||||||
- CONTAINS:
|
- CONTAINS:
|
||||||
tag: Vm.managed-environment
|
tag: Vm.managed-environment
|
||||||
value: prod
|
value: prod
|
||||||
- not:
|
- not:
|
||||||
CONTAINS:
|
CONTAINS:
|
||||||
tag: Vm.host.managed-environment
|
tag: Vm.host.managed-environment
|
||||||
value: prod
|
value: prod
|
||||||
enabled: true
|
enabled: true
|
||||||
manageiq_connection:
|
manageiq_connection:
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
username: 'admin'
|
username: 'admin'
|
||||||
password: 'smartvm'
|
password: 'smartvm'
|
||||||
validate_certs: false # only do this when you trust the network!
|
validate_certs: false # only do this when you trust the network!
|
||||||
|
|
||||||
- name: Delete an alert from ManageIQ
|
- name: Delete an alert from ManageIQ
|
||||||
community.general.manageiq_alerts:
|
community.general.manageiq_alerts:
|
||||||
|
@ -128,11 +123,11 @@ EXAMPLES = '''
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
username: 'admin'
|
username: 'admin'
|
||||||
password: 'smartvm'
|
password: 'smartvm'
|
||||||
validate_certs: false # only do this when you trust the network!
|
validate_certs: false # only do this when you trust the network!
|
||||||
'''
|
"""
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r"""
|
||||||
'''
|
"""
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible_collections.community.general.plugins.module_utils.manageiq import ManageIQ, manageiq_argument_spec
|
from ansible_collections.community.general.plugins.module_utils.manageiq import ManageIQ, manageiq_argument_spec
|
||||||
|
|
|
@ -8,8 +8,7 @@ from __future__ import (absolute_import, division, print_function)
|
||||||
|
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
|
|
||||||
module: manageiq_group
|
module: manageiq_group
|
||||||
|
|
||||||
short_description: Management of groups in ManageIQ
|
short_description: Management of groups in ManageIQ
|
||||||
|
@ -33,70 +32,69 @@ options:
|
||||||
state:
|
state:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- absent - group should not exist, present - group should be.
|
- V(absent) - group should not exist,
|
||||||
|
- V(present) - group should exist.
|
||||||
choices: ['absent', 'present']
|
choices: ['absent', 'present']
|
||||||
default: 'present'
|
default: 'present'
|
||||||
description:
|
description:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- The group description.
|
- The group description.
|
||||||
required: true
|
required: true
|
||||||
default: null
|
|
||||||
role_id:
|
role_id:
|
||||||
type: int
|
type: int
|
||||||
description:
|
description:
|
||||||
- The the group role id
|
- The the group role id.
|
||||||
required: false
|
required: false
|
||||||
default: null
|
|
||||||
role:
|
role:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- The the group role name
|
- The the group role name.
|
||||||
- The O(role_id) has precedence over the O(role) when supplied.
|
- The O(role_id) has precedence over the O(role) when supplied.
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default:
|
||||||
tenant_id:
|
tenant_id:
|
||||||
type: int
|
type: int
|
||||||
description:
|
description:
|
||||||
- The tenant for the group identified by the tenant id.
|
- The tenant for the group identified by the tenant id.
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default:
|
||||||
tenant:
|
tenant:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- The tenant for the group identified by the tenant name.
|
- The tenant for the group identified by the tenant name.
|
||||||
- The O(tenant_id) has precedence over the O(tenant) when supplied.
|
- The O(tenant_id) has precedence over the O(tenant) when supplied.
|
||||||
- Tenant names are case sensitive.
|
- Tenant names are case sensitive.
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default:
|
||||||
managed_filters:
|
managed_filters:
|
||||||
description: The tag values per category
|
description: The tag values per category.
|
||||||
type: dict
|
type: dict
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default:
|
||||||
managed_filters_merge_mode:
|
managed_filters_merge_mode:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- In merge mode existing categories are kept or updated, new categories are added.
|
- In merge mode existing categories are kept or updated, new categories are added.
|
||||||
- In replace mode all categories will be replaced with the supplied O(managed_filters).
|
- In replace mode all categories will be replaced with the supplied O(managed_filters).
|
||||||
choices: [ merge, replace ]
|
choices: [merge, replace]
|
||||||
default: replace
|
default: replace
|
||||||
belongsto_filters:
|
belongsto_filters:
|
||||||
description: A list of strings with a reference to the allowed host, cluster or folder
|
description: A list of strings with a reference to the allowed host, cluster or folder.
|
||||||
type: list
|
type: list
|
||||||
elements: str
|
elements: str
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default:
|
||||||
belongsto_filters_merge_mode:
|
belongsto_filters_merge_mode:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- In merge mode existing settings are merged with the supplied O(belongsto_filters).
|
- In merge mode existing settings are merged with the supplied O(belongsto_filters).
|
||||||
- In replace mode current values are replaced with the supplied O(belongsto_filters).
|
- In replace mode current values are replaced with the supplied O(belongsto_filters).
|
||||||
choices: [ merge, replace ]
|
choices: [merge, replace]
|
||||||
default: replace
|
default: replace
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: Create a group in ManageIQ with the role EvmRole-user and tenant 'my_tenant'
|
- name: Create a group in ManageIQ with the role EvmRole-user and tenant 'my_tenant'
|
||||||
community.general.manageiq_group:
|
community.general.manageiq_group:
|
||||||
description: 'MyGroup-user'
|
description: 'MyGroup-user'
|
||||||
|
@ -106,7 +104,7 @@ EXAMPLES = '''
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
username: 'admin'
|
username: 'admin'
|
||||||
password: 'smartvm'
|
password: 'smartvm'
|
||||||
validate_certs: false # only do this when you trust the network!
|
validate_certs: false # only do this when you trust the network!
|
||||||
|
|
||||||
- name: Create a group in ManageIQ with the role EvmRole-user and tenant with tenant_id 4
|
- name: Create a group in ManageIQ with the role EvmRole-user and tenant with tenant_id 4
|
||||||
community.general.manageiq_group:
|
community.general.manageiq_group:
|
||||||
|
@ -117,33 +115,33 @@ EXAMPLES = '''
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
username: 'admin'
|
username: 'admin'
|
||||||
password: 'smartvm'
|
password: 'smartvm'
|
||||||
validate_certs: false # only do this when you trust the network!
|
validate_certs: false # only do this when you trust the network!
|
||||||
|
|
||||||
- name:
|
- name:
|
||||||
- Create or update a group in ManageIQ with the role EvmRole-user and tenant my_tenant.
|
- Create or update a group in ManageIQ with the role EvmRole-user and tenant my_tenant.
|
||||||
- Apply 3 prov_max_cpu and 2 department tags to the group.
|
- Apply 3 prov_max_cpu and 2 department tags to the group.
|
||||||
- Limit access to a cluster for the group.
|
- Limit access to a cluster for the group.
|
||||||
community.general.manageiq_group:
|
community.general.manageiq_group:
|
||||||
description: 'MyGroup-user'
|
description: 'MyGroup-user'
|
||||||
role: 'EvmRole-user'
|
role: 'EvmRole-user'
|
||||||
tenant: my_tenant
|
tenant: my_tenant
|
||||||
managed_filters:
|
managed_filters:
|
||||||
prov_max_cpu:
|
prov_max_cpu:
|
||||||
- '1'
|
- '1'
|
||||||
- '2'
|
- '2'
|
||||||
- '4'
|
- '4'
|
||||||
department:
|
department:
|
||||||
- defense
|
- defense
|
||||||
- engineering
|
- engineering
|
||||||
managed_filters_merge_mode: replace
|
managed_filters_merge_mode: replace
|
||||||
belongsto_filters:
|
belongsto_filters:
|
||||||
- "/belongsto/ExtManagementSystem|ProviderName/EmsFolder|Datacenters/EmsFolder|dc_name/EmsFolder|host/EmsCluster|Cluster name"
|
- "/belongsto/ExtManagementSystem|ProviderName/EmsFolder|Datacenters/EmsFolder|dc_name/EmsFolder|host/EmsCluster|Cluster name"
|
||||||
belongsto_filters_merge_mode: merge
|
belongsto_filters_merge_mode: merge
|
||||||
manageiq_connection:
|
manageiq_connection:
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
username: 'admin'
|
username: 'admin'
|
||||||
password: 'smartvm'
|
password: 'smartvm'
|
||||||
validate_certs: false # only do this when you trust the network!
|
validate_certs: false # only do this when you trust the network!
|
||||||
|
|
||||||
- name: Delete a group in ManageIQ
|
- name: Delete a group in ManageIQ
|
||||||
community.general.manageiq_group:
|
community.general.manageiq_group:
|
||||||
|
@ -161,53 +159,53 @@ EXAMPLES = '''
|
||||||
manageiq_connection:
|
manageiq_connection:
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
token: 'sometoken'
|
token: 'sometoken'
|
||||||
'''
|
"""
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r"""
|
||||||
group:
|
group:
|
||||||
description: The group.
|
description: The group.
|
||||||
returned: success
|
returned: success
|
||||||
type: complex
|
type: complex
|
||||||
contains:
|
contains:
|
||||||
description:
|
description:
|
||||||
description: The group description
|
description: The group description.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
id:
|
id:
|
||||||
description: The group id
|
description: The group id.
|
||||||
returned: success
|
returned: success
|
||||||
type: int
|
type: int
|
||||||
group_type:
|
group_type:
|
||||||
description: The group type, system or user
|
description: The group type, system or user.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
role:
|
role:
|
||||||
description: The group role name
|
description: The group role name.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
tenant:
|
tenant:
|
||||||
description: The group tenant name
|
description: The group tenant name.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
managed_filters:
|
managed_filters:
|
||||||
description: The tag values per category
|
description: The tag values per category.
|
||||||
returned: success
|
returned: success
|
||||||
type: dict
|
type: dict
|
||||||
belongsto_filters:
|
belongsto_filters:
|
||||||
description: A list of strings with a reference to the allowed host, cluster or folder
|
description: A list of strings with a reference to the allowed host, cluster or folder.
|
||||||
returned: success
|
returned: success
|
||||||
type: list
|
type: list
|
||||||
created_on:
|
created_on:
|
||||||
description: Group creation date
|
description: Group creation date.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
sample: "2018-08-12T08:37:55+00:00"
|
sample: "2018-08-12T08:37:55+00:00"
|
||||||
updated_on:
|
updated_on:
|
||||||
description: Group update date
|
description: Group update date.
|
||||||
returned: success
|
returned: success
|
||||||
type: int
|
type: int
|
||||||
sample: "2018-08-12T08:37:55+00:00"
|
sample: "2018-08-12T08:37:55+00:00"
|
||||||
'''
|
"""
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible_collections.community.general.plugins.module_utils.manageiq import ManageIQ, manageiq_argument_spec
|
from ansible_collections.community.general.plugins.module_utils.manageiq import ManageIQ, manageiq_argument_spec
|
||||||
|
|
|
@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
|
|
||||||
module: manageiq_policies
|
module: manageiq_policies
|
||||||
|
|
||||||
short_description: Management of resource policy_profiles in ManageIQ
|
short_description: Management of resource policy_profiles in ManageIQ
|
||||||
|
@ -21,7 +20,6 @@ extends_documentation_fragment:
|
||||||
author: Daniel Korn (@dkorn)
|
author: Daniel Korn (@dkorn)
|
||||||
description:
|
description:
|
||||||
- The manageiq_policies module supports adding and deleting policy_profiles in ManageIQ.
|
- The manageiq_policies module supports adding and deleting policy_profiles in ManageIQ.
|
||||||
|
|
||||||
attributes:
|
attributes:
|
||||||
check_mode:
|
check_mode:
|
||||||
support: none
|
support: none
|
||||||
|
@ -33,7 +31,7 @@ options:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- V(absent) - policy_profiles should not exist,
|
- V(absent) - policy_profiles should not exist,
|
||||||
- V(present) - policy_profiles should exist,
|
- V(present) - policy_profiles should exist.
|
||||||
choices: ['absent', 'present']
|
choices: ['absent', 'present']
|
||||||
default: 'present'
|
default: 'present'
|
||||||
policy_profiles:
|
policy_profiles:
|
||||||
|
@ -47,9 +45,8 @@ options:
|
||||||
description:
|
description:
|
||||||
- The type of the resource to which the profile should be [un]assigned.
|
- The type of the resource to which the profile should be [un]assigned.
|
||||||
required: true
|
required: true
|
||||||
choices: ['provider', 'host', 'vm', 'blueprint', 'category', 'cluster',
|
choices: ['provider', 'host', 'vm', 'blueprint', 'category', 'cluster', 'data store', 'group', 'resource pool', 'service', 'service template',
|
||||||
'data store', 'group', 'resource pool', 'service', 'service template',
|
'template', 'tenant', 'user']
|
||||||
'template', 'tenant', 'user']
|
|
||||||
resource_name:
|
resource_name:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
|
@ -61,9 +58,9 @@ options:
|
||||||
- The ID of the resource to which the profile should be [un]assigned.
|
- The ID of the resource to which the profile should be [un]assigned.
|
||||||
- Must be specified if O(resource_name) is not set. Both options are mutually exclusive.
|
- Must be specified if O(resource_name) is not set. Both options are mutually exclusive.
|
||||||
version_added: 2.2.0
|
version_added: 2.2.0
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: Assign new policy_profile for a provider in ManageIQ
|
- name: Assign new policy_profile for a provider in ManageIQ
|
||||||
community.general.manageiq_policies:
|
community.general.manageiq_policies:
|
||||||
resource_name: 'EngLab'
|
resource_name: 'EngLab'
|
||||||
|
@ -74,7 +71,7 @@ EXAMPLES = '''
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
username: 'admin'
|
username: 'admin'
|
||||||
password: 'smartvm'
|
password: 'smartvm'
|
||||||
validate_certs: false # only do this when you trust the network!
|
validate_certs: false # only do this when you trust the network!
|
||||||
|
|
||||||
- name: Unassign a policy_profile for a provider in ManageIQ
|
- name: Unassign a policy_profile for a provider in ManageIQ
|
||||||
community.general.manageiq_policies:
|
community.general.manageiq_policies:
|
||||||
|
@ -87,13 +84,13 @@ EXAMPLES = '''
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
username: 'admin'
|
username: 'admin'
|
||||||
password: 'smartvm'
|
password: 'smartvm'
|
||||||
validate_certs: false # only do this when you trust the network!
|
validate_certs: false # only do this when you trust the network!
|
||||||
'''
|
"""
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r"""
|
||||||
manageiq_policies:
|
manageiq_policies:
|
||||||
description:
|
description:
|
||||||
- List current policy_profile and policies for a provider in ManageIQ
|
- List current policy_profile and policies for a provider in ManageIQ.
|
||||||
returned: always
|
returned: always
|
||||||
type: dict
|
type: dict
|
||||||
sample: '{
|
sample: '{
|
||||||
|
@ -122,7 +119,7 @@ manageiq_policies:
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}'
|
}'
|
||||||
'''
|
"""
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible_collections.community.general.plugins.module_utils.manageiq import ManageIQ, manageiq_argument_spec, manageiq_entities
|
from ansible_collections.community.general.plugins.module_utils.manageiq import ManageIQ, manageiq_argument_spec, manageiq_entities
|
||||||
|
|
|
@ -10,8 +10,7 @@ from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
|
|
||||||
module: manageiq_policies_info
|
module: manageiq_policies_info
|
||||||
version_added: 5.8.0
|
version_added: 5.8.0
|
||||||
|
|
||||||
|
@ -24,16 +23,14 @@ extends_documentation_fragment:
|
||||||
author: Alexei Znamensky (@russoz)
|
author: Alexei Znamensky (@russoz)
|
||||||
description:
|
description:
|
||||||
- The manageiq_policies module supports listing policy_profiles in ManageIQ.
|
- The manageiq_policies module supports listing policy_profiles in ManageIQ.
|
||||||
|
|
||||||
options:
|
options:
|
||||||
resource_type:
|
resource_type:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- The type of the resource to obtain the profile for.
|
- The type of the resource to obtain the profile for.
|
||||||
required: true
|
required: true
|
||||||
choices: ['provider', 'host', 'vm', 'blueprint', 'category', 'cluster',
|
choices: ['provider', 'host', 'vm', 'blueprint', 'category', 'cluster', 'data store', 'group', 'resource pool', 'service', 'service template',
|
||||||
'data store', 'group', 'resource pool', 'service', 'service template',
|
'template', 'tenant', 'user']
|
||||||
'template', 'tenant', 'user']
|
|
||||||
resource_name:
|
resource_name:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
|
@ -44,9 +41,9 @@ options:
|
||||||
description:
|
description:
|
||||||
- The ID of the resource to obtain the profile for.
|
- The ID of the resource to obtain the profile for.
|
||||||
- Must be specified if O(resource_name) is not set. Both options are mutually exclusive.
|
- Must be specified if O(resource_name) is not set. Both options are mutually exclusive.
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: List current policy_profile and policies for a provider in ManageIQ
|
- name: List current policy_profile and policies for a provider in ManageIQ
|
||||||
community.general.manageiq_policies_info:
|
community.general.manageiq_policies_info:
|
||||||
resource_name: 'EngLab'
|
resource_name: 'EngLab'
|
||||||
|
@ -56,9 +53,9 @@ EXAMPLES = '''
|
||||||
username: 'admin'
|
username: 'admin'
|
||||||
password: 'smartvm'
|
password: 'smartvm'
|
||||||
register: result
|
register: result
|
||||||
'''
|
"""
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r"""
|
||||||
profiles:
|
profiles:
|
||||||
description:
|
description:
|
||||||
- List current policy_profile and policies for a provider in ManageIQ.
|
- List current policy_profile and policies for a provider in ManageIQ.
|
||||||
|
@ -78,7 +75,7 @@ profiles:
|
||||||
name: schedule compliance after smart state analysis
|
name: schedule compliance after smart state analysis
|
||||||
profile_description: OpenSCAP profile
|
profile_description: OpenSCAP profile
|
||||||
profile_name: openscap profile
|
profile_name: openscap profile
|
||||||
'''
|
"""
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible_collections.community.general.plugins.module_utils.manageiq import ManageIQ, manageiq_argument_spec, manageiq_entities
|
from ansible_collections.community.general.plugins.module_utils.manageiq import ManageIQ, manageiq_argument_spec, manageiq_entities
|
||||||
|
|
|
@ -9,7 +9,7 @@ from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
module: manageiq_provider
|
module: manageiq_provider
|
||||||
short_description: Management of provider in ManageIQ
|
short_description: Management of provider in ManageIQ
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
|
@ -19,7 +19,6 @@ extends_documentation_fragment:
|
||||||
author: Daniel Korn (@dkorn)
|
author: Daniel Korn (@dkorn)
|
||||||
description:
|
description:
|
||||||
- The manageiq_provider module supports adding, updating, and deleting provider in ManageIQ.
|
- The manageiq_provider module supports adding, updating, and deleting provider in ManageIQ.
|
||||||
|
|
||||||
attributes:
|
attributes:
|
||||||
check_mode:
|
check_mode:
|
||||||
support: none
|
support: none
|
||||||
|
@ -30,7 +29,9 @@ options:
|
||||||
state:
|
state:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- absent - provider should not exist, present - provider should be present, refresh - provider will be refreshed
|
- V(absent) - provider should not exist,
|
||||||
|
- V(present) - provider should be present,
|
||||||
|
- V(refresh) - provider will be refreshed.
|
||||||
choices: ['absent', 'present', 'refresh']
|
choices: ['absent', 'present', 'refresh']
|
||||||
default: 'present'
|
default: 'present'
|
||||||
name:
|
name:
|
||||||
|
@ -47,30 +48,30 @@ options:
|
||||||
default: 'default'
|
default: 'default'
|
||||||
provider_region:
|
provider_region:
|
||||||
type: str
|
type: str
|
||||||
description: The provider region name to connect to (e.g. AWS region for Amazon).
|
description: The provider region name to connect to (for example AWS region for Amazon).
|
||||||
host_default_vnc_port_start:
|
host_default_vnc_port_start:
|
||||||
type: str
|
type: str
|
||||||
description: The first port in the host VNC range. defaults to None.
|
description: The first port in the host VNC range.
|
||||||
host_default_vnc_port_end:
|
host_default_vnc_port_end:
|
||||||
type: str
|
type: str
|
||||||
description: The last port in the host VNC range. defaults to None.
|
description: The last port in the host VNC range.
|
||||||
subscription:
|
subscription:
|
||||||
type: str
|
type: str
|
||||||
description: Microsoft Azure subscription ID. defaults to None.
|
description: Microsoft Azure subscription ID.
|
||||||
project:
|
project:
|
||||||
type: str
|
type: str
|
||||||
description: Google Compute Engine Project ID. defaults to None.
|
description: Google Compute Engine Project ID.
|
||||||
azure_tenant_id:
|
azure_tenant_id:
|
||||||
type: str
|
type: str
|
||||||
description: Tenant ID. defaults to None.
|
description: Tenant ID. defaults to None.
|
||||||
aliases: [ keystone_v3_domain_id ]
|
aliases: [keystone_v3_domain_id]
|
||||||
tenant_mapping_enabled:
|
tenant_mapping_enabled:
|
||||||
type: bool
|
type: bool
|
||||||
default: false
|
default: false
|
||||||
description: Whether to enable mapping of existing tenants. defaults to False.
|
description: Whether to enable mapping of existing tenants.
|
||||||
api_version:
|
api_version:
|
||||||
type: str
|
type: str
|
||||||
description: The OpenStack Keystone API version. defaults to None.
|
description: The OpenStack Keystone API version.
|
||||||
choices: ['v2', 'v3']
|
choices: ['v2', 'v3']
|
||||||
|
|
||||||
provider:
|
provider:
|
||||||
|
@ -79,32 +80,32 @@ options:
|
||||||
suboptions:
|
suboptions:
|
||||||
hostname:
|
hostname:
|
||||||
type: str
|
type: str
|
||||||
description: The provider's api hostname.
|
description: The provider's API hostname.
|
||||||
required: true
|
required: true
|
||||||
port:
|
port:
|
||||||
type: int
|
type: int
|
||||||
description: The provider's api port.
|
description: The provider's API port.
|
||||||
userid:
|
userid:
|
||||||
type: str
|
type: str
|
||||||
description: Provider's api endpoint authentication userid. defaults to None.
|
description: Provider's API endpoint authentication userid.
|
||||||
password:
|
password:
|
||||||
type: str
|
type: str
|
||||||
description: Provider's api endpoint authentication password. defaults to None.
|
description: Provider's API endpoint authentication password.
|
||||||
auth_key:
|
auth_key:
|
||||||
type: str
|
type: str
|
||||||
description: Provider's api endpoint authentication bearer token. defaults to None.
|
description: Provider's API endpoint authentication bearer token.
|
||||||
validate_certs:
|
validate_certs:
|
||||||
description: Whether SSL certificates should be verified for HTTPS requests (deprecated). defaults to True.
|
description: Whether SSL certificates should be verified for HTTPS requests (deprecated).
|
||||||
type: bool
|
type: bool
|
||||||
default: true
|
default: true
|
||||||
aliases: [ verify_ssl ]
|
aliases: [verify_ssl]
|
||||||
security_protocol:
|
security_protocol:
|
||||||
type: str
|
type: str
|
||||||
description: How SSL certificates should be used for HTTPS requests. defaults to None.
|
description: How SSL certificates should be used for HTTPS requests.
|
||||||
choices: ['ssl-with-validation','ssl-with-validation-custom-ca','ssl-without-validation','non-ssl']
|
choices: ['ssl-with-validation', 'ssl-with-validation-custom-ca', 'ssl-without-validation', 'non-ssl']
|
||||||
certificate_authority:
|
certificate_authority:
|
||||||
type: str
|
type: str
|
||||||
description: The CA bundle string with custom certificates. defaults to None.
|
description: The CA bundle string with custom certificates.
|
||||||
path:
|
path:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
|
@ -125,39 +126,38 @@ options:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- TODO needs documentation.
|
- TODO needs documentation.
|
||||||
|
|
||||||
metrics:
|
metrics:
|
||||||
description: Metrics endpoint connection information.
|
description: Metrics endpoint connection information.
|
||||||
type: dict
|
type: dict
|
||||||
suboptions:
|
suboptions:
|
||||||
hostname:
|
hostname:
|
||||||
type: str
|
type: str
|
||||||
description: The provider's api hostname.
|
description: The provider's API hostname.
|
||||||
required: true
|
required: true
|
||||||
port:
|
port:
|
||||||
type: int
|
type: int
|
||||||
description: The provider's api port.
|
description: The provider's API port.
|
||||||
userid:
|
userid:
|
||||||
type: str
|
type: str
|
||||||
description: Provider's api endpoint authentication userid. defaults to None.
|
description: Provider's API endpoint authentication userid.
|
||||||
password:
|
password:
|
||||||
type: str
|
type: str
|
||||||
description: Provider's api endpoint authentication password. defaults to None.
|
description: Provider's API endpoint authentication password.
|
||||||
auth_key:
|
auth_key:
|
||||||
type: str
|
type: str
|
||||||
description: Provider's api endpoint authentication bearer token. defaults to None.
|
description: Provider's API endpoint authentication bearer token.
|
||||||
validate_certs:
|
validate_certs:
|
||||||
description: Whether SSL certificates should be verified for HTTPS requests (deprecated). defaults to True.
|
description: Whether SSL certificates should be verified for HTTPS requests (deprecated).
|
||||||
type: bool
|
type: bool
|
||||||
default: true
|
default: true
|
||||||
aliases: [ verify_ssl ]
|
aliases: [verify_ssl]
|
||||||
security_protocol:
|
security_protocol:
|
||||||
type: str
|
type: str
|
||||||
choices: ['ssl-with-validation','ssl-with-validation-custom-ca','ssl-without-validation','non-ssl']
|
choices: ['ssl-with-validation', 'ssl-with-validation-custom-ca', 'ssl-without-validation', 'non-ssl']
|
||||||
description: How SSL certificates should be used for HTTPS requests. defaults to None.
|
description: How SSL certificates should be used for HTTPS requests.
|
||||||
certificate_authority:
|
certificate_authority:
|
||||||
type: str
|
type: str
|
||||||
description: The CA bundle string with custom certificates. defaults to None.
|
description: The CA bundle string with custom certificates.
|
||||||
path:
|
path:
|
||||||
type: str
|
type: str
|
||||||
description: Database name for oVirt metrics. Defaults to V(ovirt_engine_history).
|
description: Database name for oVirt metrics. Defaults to V(ovirt_engine_history).
|
||||||
|
@ -177,35 +177,34 @@ options:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- TODO needs documentation.
|
- TODO needs documentation.
|
||||||
|
|
||||||
alerts:
|
alerts:
|
||||||
description: Alerts endpoint connection information.
|
description: Alerts endpoint connection information.
|
||||||
type: dict
|
type: dict
|
||||||
suboptions:
|
suboptions:
|
||||||
hostname:
|
hostname:
|
||||||
type: str
|
type: str
|
||||||
description: The provider's api hostname.
|
description: The provider's API hostname.
|
||||||
required: true
|
required: true
|
||||||
port:
|
port:
|
||||||
type: int
|
type: int
|
||||||
description: The provider's api port.
|
description: The provider's API port.
|
||||||
userid:
|
userid:
|
||||||
type: str
|
type: str
|
||||||
description: Provider's api endpoint authentication userid. defaults to None.
|
description: Provider's API endpoint authentication userid. defaults to None.
|
||||||
password:
|
password:
|
||||||
type: str
|
type: str
|
||||||
description: Provider's api endpoint authentication password. defaults to None.
|
description: Provider's API endpoint authentication password. defaults to None.
|
||||||
auth_key:
|
auth_key:
|
||||||
type: str
|
type: str
|
||||||
description: Provider's api endpoint authentication bearer token. defaults to None.
|
description: Provider's API endpoint authentication bearer token. defaults to None.
|
||||||
validate_certs:
|
validate_certs:
|
||||||
type: bool
|
type: bool
|
||||||
description: Whether SSL certificates should be verified for HTTPS requests (deprecated). defaults to True.
|
description: Whether SSL certificates should be verified for HTTPS requests (deprecated). defaults to True.
|
||||||
default: true
|
default: true
|
||||||
aliases: [ verify_ssl ]
|
aliases: [verify_ssl]
|
||||||
security_protocol:
|
security_protocol:
|
||||||
type: str
|
type: str
|
||||||
choices: ['ssl-with-validation','ssl-with-validation-custom-ca','ssl-without-validation', 'non-ssl']
|
choices: ['ssl-with-validation', 'ssl-with-validation-custom-ca', 'ssl-without-validation', 'non-ssl']
|
||||||
description: How SSL certificates should be used for HTTPS requests. defaults to None.
|
description: How SSL certificates should be used for HTTPS requests. defaults to None.
|
||||||
certificate_authority:
|
certificate_authority:
|
||||||
type: str
|
type: str
|
||||||
|
@ -230,7 +229,6 @@ options:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- TODO needs documentation.
|
- TODO needs documentation.
|
||||||
|
|
||||||
ssh_keypair:
|
ssh_keypair:
|
||||||
description: SSH key pair used for SSH connections to all hosts in this provider.
|
description: SSH key pair used for SSH connections to all hosts in this provider.
|
||||||
type: dict
|
type: dict
|
||||||
|
@ -250,10 +248,10 @@ options:
|
||||||
- Whether certificates should be verified for connections.
|
- Whether certificates should be verified for connections.
|
||||||
type: bool
|
type: bool
|
||||||
default: true
|
default: true
|
||||||
aliases: [ verify_ssl ]
|
aliases: [verify_ssl]
|
||||||
security_protocol:
|
security_protocol:
|
||||||
type: str
|
type: str
|
||||||
choices: ['ssl-with-validation','ssl-with-validation-custom-ca','ssl-without-validation', 'non-ssl']
|
choices: ['ssl-with-validation', 'ssl-with-validation-custom-ca', 'ssl-without-validation', 'non-ssl']
|
||||||
description:
|
description:
|
||||||
- TODO needs documentation.
|
- TODO needs documentation.
|
||||||
certificate_authority:
|
certificate_authority:
|
||||||
|
@ -288,9 +286,9 @@ options:
|
||||||
type: int
|
type: int
|
||||||
description:
|
description:
|
||||||
- TODO needs documentation.
|
- TODO needs documentation.
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: Create a new provider in ManageIQ ('Hawkular' metrics)
|
- name: Create a new provider in ManageIQ ('Hawkular' metrics)
|
||||||
community.general.manageiq_provider:
|
community.general.manageiq_provider:
|
||||||
name: 'EngLab'
|
name: 'EngLab'
|
||||||
|
@ -507,10 +505,10 @@ EXAMPLES = '''
|
||||||
hostname: 'gce.example.com'
|
hostname: 'gce.example.com'
|
||||||
auth_key: 'google_json_key'
|
auth_key: 'google_json_key'
|
||||||
validate_certs: 'false'
|
validate_certs: 'false'
|
||||||
'''
|
"""
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r"""
|
||||||
'''
|
"""
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible_collections.community.general.plugins.module_utils.manageiq import ManageIQ, manageiq_argument_spec
|
from ansible_collections.community.general.plugins.module_utils.manageiq import ManageIQ, manageiq_argument_spec
|
||||||
|
|
|
@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
|
|
||||||
module: manageiq_tags
|
module: manageiq_tags
|
||||||
|
|
||||||
short_description: Management of resource tags in ManageIQ
|
short_description: Management of resource tags in ManageIQ
|
||||||
|
@ -21,7 +20,6 @@ extends_documentation_fragment:
|
||||||
author: Daniel Korn (@dkorn)
|
author: Daniel Korn (@dkorn)
|
||||||
description:
|
description:
|
||||||
- The manageiq_tags module supports adding, updating and deleting tags in ManageIQ.
|
- The manageiq_tags module supports adding, updating and deleting tags in ManageIQ.
|
||||||
|
|
||||||
attributes:
|
attributes:
|
||||||
check_mode:
|
check_mode:
|
||||||
support: none
|
support: none
|
||||||
|
@ -32,7 +30,7 @@ options:
|
||||||
state:
|
state:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- V(absent) - tags should not exist.
|
- V(absent) - tags should not exist,
|
||||||
- V(present) - tags should exist.
|
- V(present) - tags should exist.
|
||||||
choices: ['absent', 'present']
|
choices: ['absent', 'present']
|
||||||
default: 'present'
|
default: 'present'
|
||||||
|
@ -47,9 +45,8 @@ options:
|
||||||
description:
|
description:
|
||||||
- The relevant resource type in manageiq.
|
- The relevant resource type in manageiq.
|
||||||
required: true
|
required: true
|
||||||
choices: ['provider', 'host', 'vm', 'blueprint', 'category', 'cluster',
|
choices: ['provider', 'host', 'vm', 'blueprint', 'category', 'cluster', 'data store', 'group', 'resource pool', 'service', 'service template',
|
||||||
'data store', 'group', 'resource pool', 'service', 'service template',
|
'template', 'tenant', 'user']
|
||||||
'template', 'tenant', 'user']
|
|
||||||
resource_name:
|
resource_name:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
|
@ -61,38 +58,38 @@ options:
|
||||||
- Must be specified if O(resource_name) is not set. Both options are mutually exclusive.
|
- Must be specified if O(resource_name) is not set. Both options are mutually exclusive.
|
||||||
type: int
|
type: int
|
||||||
version_added: 2.2.0
|
version_added: 2.2.0
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: Create new tags for a provider in ManageIQ.
|
- name: Create new tags for a provider in ManageIQ.
|
||||||
community.general.manageiq_tags:
|
community.general.manageiq_tags:
|
||||||
resource_name: 'EngLab'
|
resource_name: 'EngLab'
|
||||||
resource_type: 'provider'
|
resource_type: 'provider'
|
||||||
tags:
|
tags:
|
||||||
- category: environment
|
- category: environment
|
||||||
name: prod
|
name: prod
|
||||||
- category: owner
|
- category: owner
|
||||||
name: prod_ops
|
name: prod_ops
|
||||||
manageiq_connection:
|
manageiq_connection:
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
username: 'admin'
|
username: 'admin'
|
||||||
password: 'smartvm'
|
password: 'smartvm'
|
||||||
validate_certs: false # only do this when connecting to localhost!
|
validate_certs: false # only do this when connecting to localhost!
|
||||||
|
|
||||||
- name: Create new tags for a provider in ManageIQ.
|
- name: Create new tags for a provider in ManageIQ.
|
||||||
community.general.manageiq_tags:
|
community.general.manageiq_tags:
|
||||||
resource_id: 23000000790497
|
resource_id: 23000000790497
|
||||||
resource_type: 'provider'
|
resource_type: 'provider'
|
||||||
tags:
|
tags:
|
||||||
- category: environment
|
- category: environment
|
||||||
name: prod
|
name: prod
|
||||||
- category: owner
|
- category: owner
|
||||||
name: prod_ops
|
name: prod_ops
|
||||||
manageiq_connection:
|
manageiq_connection:
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
username: 'admin'
|
username: 'admin'
|
||||||
password: 'smartvm'
|
password: 'smartvm'
|
||||||
validate_certs: false # only do this when connecting to localhost!
|
validate_certs: false # only do this when connecting to localhost!
|
||||||
|
|
||||||
- name: Remove tags for a provider in ManageIQ.
|
- name: Remove tags for a provider in ManageIQ.
|
||||||
community.general.manageiq_tags:
|
community.general.manageiq_tags:
|
||||||
|
@ -100,19 +97,19 @@ EXAMPLES = '''
|
||||||
resource_name: 'EngLab'
|
resource_name: 'EngLab'
|
||||||
resource_type: 'provider'
|
resource_type: 'provider'
|
||||||
tags:
|
tags:
|
||||||
- category: environment
|
- category: environment
|
||||||
name: prod
|
name: prod
|
||||||
- category: owner
|
- category: owner
|
||||||
name: prod_ops
|
name: prod_ops
|
||||||
manageiq_connection:
|
manageiq_connection:
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
username: 'admin'
|
username: 'admin'
|
||||||
password: 'smartvm'
|
password: 'smartvm'
|
||||||
validate_certs: false # only do this when connecting to localhost!
|
validate_certs: false # only do this when connecting to localhost!
|
||||||
'''
|
"""
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r"""
|
||||||
'''
|
"""
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible_collections.community.general.plugins.module_utils.manageiq import (
|
from ansible_collections.community.general.plugins.module_utils.manageiq import (
|
||||||
|
|
|
@ -9,8 +9,7 @@ from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
|
|
||||||
module: manageiq_tags_info
|
module: manageiq_tags_info
|
||||||
version_added: 5.8.0
|
version_added: 5.8.0
|
||||||
short_description: Retrieve resource tags in ManageIQ
|
short_description: Retrieve resource tags in ManageIQ
|
||||||
|
@ -22,16 +21,14 @@ extends_documentation_fragment:
|
||||||
author: Alexei Znamensky (@russoz)
|
author: Alexei Znamensky (@russoz)
|
||||||
description:
|
description:
|
||||||
- This module supports retrieving resource tags from ManageIQ.
|
- This module supports retrieving resource tags from ManageIQ.
|
||||||
|
|
||||||
options:
|
options:
|
||||||
resource_type:
|
resource_type:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- The relevant resource type in ManageIQ.
|
- The relevant resource type in ManageIQ.
|
||||||
required: true
|
required: true
|
||||||
choices: ['provider', 'host', 'vm', 'blueprint', 'category', 'cluster',
|
choices: ['provider', 'host', 'vm', 'blueprint', 'category', 'cluster', 'data store', 'group', 'resource pool', 'service', 'service template',
|
||||||
'data store', 'group', 'resource pool', 'service', 'service template',
|
'template', 'tenant', 'user']
|
||||||
'template', 'tenant', 'user']
|
|
||||||
resource_name:
|
resource_name:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
|
@ -42,9 +39,9 @@ options:
|
||||||
- The ID of the resource at which tags will be controlled.
|
- The ID of the resource at which tags will be controlled.
|
||||||
- Must be specified if O(resource_name) is not set. Both options are mutually exclusive.
|
- Must be specified if O(resource_name) is not set. Both options are mutually exclusive.
|
||||||
type: int
|
type: int
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: List current tags for a provider in ManageIQ.
|
- name: List current tags for a provider in ManageIQ.
|
||||||
community.general.manageiq_tags_info:
|
community.general.manageiq_tags_info:
|
||||||
resource_name: 'EngLab'
|
resource_name: 'EngLab'
|
||||||
|
@ -54,15 +51,15 @@ EXAMPLES = '''
|
||||||
username: 'admin'
|
username: 'admin'
|
||||||
password: 'smartvm'
|
password: 'smartvm'
|
||||||
register: result
|
register: result
|
||||||
'''
|
"""
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r"""
|
||||||
tags:
|
tags:
|
||||||
description: List of tags associated with the resource.
|
description: List of tags associated with the resource.
|
||||||
returned: on success
|
returned: on success
|
||||||
type: list
|
type: list
|
||||||
elements: dict
|
elements: dict
|
||||||
'''
|
"""
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible_collections.community.general.plugins.module_utils.manageiq import (
|
from ansible_collections.community.general.plugins.module_utils.manageiq import (
|
||||||
|
|
|
@ -8,8 +8,7 @@ from __future__ import (absolute_import, division, print_function)
|
||||||
|
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
|
|
||||||
module: manageiq_tenant
|
module: manageiq_tenant
|
||||||
|
|
||||||
short_description: Management of tenants in ManageIQ
|
short_description: Management of tenants in ManageIQ
|
||||||
|
@ -31,7 +30,8 @@ options:
|
||||||
state:
|
state:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- absent - tenant should not exist, present - tenant should be.
|
- V(absent) - tenant should not exist,
|
||||||
|
- V(present) - tenant should be.
|
||||||
choices: ['absent', 'present']
|
choices: ['absent', 'present']
|
||||||
default: 'present'
|
default: 'present'
|
||||||
name:
|
name:
|
||||||
|
@ -39,42 +39,42 @@ options:
|
||||||
description:
|
description:
|
||||||
- The tenant name.
|
- The tenant name.
|
||||||
required: true
|
required: true
|
||||||
default: null
|
default:
|
||||||
description:
|
description:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- The tenant description.
|
- The tenant description.
|
||||||
required: true
|
required: true
|
||||||
default: null
|
default:
|
||||||
parent_id:
|
parent_id:
|
||||||
type: int
|
type: int
|
||||||
description:
|
description:
|
||||||
- The id of the parent tenant. If not supplied the root tenant is used.
|
- The id of the parent tenant. If not supplied the root tenant is used.
|
||||||
- The O(parent_id) takes president over O(parent) when supplied
|
- The O(parent_id) takes president over O(parent) when supplied.
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default:
|
||||||
parent:
|
parent:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- The name of the parent tenant. If not supplied and no O(parent_id) is supplied the root tenant is used.
|
- The name of the parent tenant. If not supplied and no O(parent_id) is supplied the root tenant is used.
|
||||||
required: false
|
required: false
|
||||||
default: null
|
default:
|
||||||
quotas:
|
quotas:
|
||||||
type: dict
|
type: dict
|
||||||
description:
|
description:
|
||||||
- The tenant quotas.
|
- The tenant quotas.
|
||||||
- All parameters case sensitive.
|
- All parameters case sensitive.
|
||||||
- 'Valid attributes are:'
|
- 'Valid attributes are:'
|
||||||
- ' - C(cpu_allocated) (int): use null to remove the quota.'
|
- '- V(cpu_allocated) (int): use null to remove the quota.'
|
||||||
- ' - C(mem_allocated) (GB): use null to remove the quota.'
|
- '- V(mem_allocated) (GB): use null to remove the quota.'
|
||||||
- ' - C(storage_allocated) (GB): use null to remove the quota.'
|
- '- V(storage_allocated) (GB): use null to remove the quota.'
|
||||||
- ' - C(vms_allocated) (int): use null to remove the quota.'
|
- '- V(vms_allocated) (int): use null to remove the quota.'
|
||||||
- ' - C(templates_allocated) (int): use null to remove the quota.'
|
- '- V(templates_allocated) (int): use null to remove the quota.'
|
||||||
required: false
|
required: false
|
||||||
default: {}
|
default: {}
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: Update the root tenant in ManageIQ
|
- name: Update the root tenant in ManageIQ
|
||||||
community.general.manageiq_tenant:
|
community.general.manageiq_tenant:
|
||||||
name: 'My Company'
|
name: 'My Company'
|
||||||
|
@ -83,7 +83,7 @@ EXAMPLES = '''
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
username: 'admin'
|
username: 'admin'
|
||||||
password: 'smartvm'
|
password: 'smartvm'
|
||||||
validate_certs: false # only do this when you trust the network!
|
validate_certs: false # only do this when you trust the network!
|
||||||
|
|
||||||
- name: Create a tenant in ManageIQ
|
- name: Create a tenant in ManageIQ
|
||||||
community.general.manageiq_tenant:
|
community.general.manageiq_tenant:
|
||||||
|
@ -94,7 +94,7 @@ EXAMPLES = '''
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
username: 'admin'
|
username: 'admin'
|
||||||
password: 'smartvm'
|
password: 'smartvm'
|
||||||
validate_certs: false # only do this when you trust the network!
|
validate_certs: false # only do this when you trust the network!
|
||||||
|
|
||||||
- name: Delete a tenant in ManageIQ
|
- name: Delete a tenant in ManageIQ
|
||||||
community.general.manageiq_tenant:
|
community.general.manageiq_tenant:
|
||||||
|
@ -105,7 +105,7 @@ EXAMPLES = '''
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
username: 'admin'
|
username: 'admin'
|
||||||
password: 'smartvm'
|
password: 'smartvm'
|
||||||
validate_certs: false # only do this when you trust the network!
|
validate_certs: false # only do this when you trust the network!
|
||||||
|
|
||||||
- name: Set tenant quota for cpu_allocated, mem_allocated, remove quota for vms_allocated
|
- name: Set tenant quota for cpu_allocated, mem_allocated, remove quota for vms_allocated
|
||||||
community.general.manageiq_tenant:
|
community.general.manageiq_tenant:
|
||||||
|
@ -114,12 +114,12 @@ EXAMPLES = '''
|
||||||
quotas:
|
quotas:
|
||||||
- cpu_allocated: 100
|
- cpu_allocated: 100
|
||||||
- mem_allocated: 50
|
- mem_allocated: 50
|
||||||
- vms_allocated: null
|
- vms_allocated:
|
||||||
manageiq_connection:
|
manageiq_connection:
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
username: 'admin'
|
username: 'admin'
|
||||||
password: 'smartvm'
|
password: 'smartvm'
|
||||||
validate_certs: false # only do this when you trust the network!
|
validate_certs: false # only do this when you trust the network!
|
||||||
|
|
||||||
|
|
||||||
- name: Delete a tenant in ManageIQ using a token
|
- name: Delete a tenant in ManageIQ using a token
|
||||||
|
@ -130,39 +130,39 @@ EXAMPLES = '''
|
||||||
manageiq_connection:
|
manageiq_connection:
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
token: 'sometoken'
|
token: 'sometoken'
|
||||||
validate_certs: false # only do this when you trust the network!
|
validate_certs: false # only do this when you trust the network!
|
||||||
'''
|
"""
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r"""
|
||||||
tenant:
|
tenant:
|
||||||
description: The tenant.
|
description: The tenant.
|
||||||
returned: success
|
returned: success
|
||||||
type: complex
|
type: complex
|
||||||
contains:
|
contains:
|
||||||
id:
|
id:
|
||||||
description: The tenant id
|
description: The tenant id.
|
||||||
returned: success
|
returned: success
|
||||||
type: int
|
type: int
|
||||||
name:
|
name:
|
||||||
description: The tenant name
|
description: The tenant name.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
description: The tenant description
|
description: The tenant description.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
parent_id:
|
parent_id:
|
||||||
description: The id of the parent tenant
|
description: The id of the parent tenant.
|
||||||
returned: success
|
returned: success
|
||||||
type: int
|
type: int
|
||||||
quotas:
|
quotas:
|
||||||
description: List of tenant quotas
|
description: List of tenant quotas.
|
||||||
returned: success
|
returned: success
|
||||||
type: list
|
type: list
|
||||||
sample:
|
sample:
|
||||||
cpu_allocated: 100
|
cpu_allocated: 100
|
||||||
mem_allocated: 50
|
mem_allocated: 50
|
||||||
'''
|
"""
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible_collections.community.general.plugins.module_utils.manageiq import ManageIQ, manageiq_argument_spec
|
from ansible_collections.community.general.plugins.module_utils.manageiq import ManageIQ, manageiq_argument_spec
|
||||||
|
|
|
@ -8,8 +8,7 @@ from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
|
|
||||||
module: manageiq_user
|
module: manageiq_user
|
||||||
|
|
||||||
short_description: Management of users in ManageIQ
|
short_description: Management of users in ManageIQ
|
||||||
|
@ -20,7 +19,6 @@ extends_documentation_fragment:
|
||||||
author: Daniel Korn (@dkorn)
|
author: Daniel Korn (@dkorn)
|
||||||
description:
|
description:
|
||||||
- The manageiq_user module supports adding, updating and deleting users in ManageIQ.
|
- The manageiq_user module supports adding, updating and deleting users in ManageIQ.
|
||||||
|
|
||||||
attributes:
|
attributes:
|
||||||
check_mode:
|
check_mode:
|
||||||
support: none
|
support: none
|
||||||
|
@ -31,7 +29,8 @@ options:
|
||||||
state:
|
state:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- absent - user should not exist, present - user should be.
|
- V(absent) - user should not exist,
|
||||||
|
- V(present) - user should be.
|
||||||
choices: ['absent', 'present']
|
choices: ['absent', 'present']
|
||||||
default: 'present'
|
default: 'present'
|
||||||
userid:
|
userid:
|
||||||
|
@ -60,10 +59,11 @@ options:
|
||||||
default: always
|
default: always
|
||||||
choices: ['always', 'on_create']
|
choices: ['always', 'on_create']
|
||||||
description:
|
description:
|
||||||
- V(always) will update passwords unconditionally. V(on_create) will only set the password for a newly created user.
|
- V(always) will update passwords unconditionally.
|
||||||
'''
|
- V(on_create) will only set the password for a newly created user.
|
||||||
|
"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: Create a new user in ManageIQ
|
- name: Create a new user in ManageIQ
|
||||||
community.general.manageiq_user:
|
community.general.manageiq_user:
|
||||||
userid: 'jdoe'
|
userid: 'jdoe'
|
||||||
|
@ -75,7 +75,7 @@ EXAMPLES = '''
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
username: 'admin'
|
username: 'admin'
|
||||||
password: 'smartvm'
|
password: 'smartvm'
|
||||||
validate_certs: false # only do this when you trust the network!
|
validate_certs: false # only do this when you trust the network!
|
||||||
|
|
||||||
- name: Create a new user in ManageIQ using a token
|
- name: Create a new user in ManageIQ using a token
|
||||||
community.general.manageiq_user:
|
community.general.manageiq_user:
|
||||||
|
@ -87,7 +87,7 @@ EXAMPLES = '''
|
||||||
manageiq_connection:
|
manageiq_connection:
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
token: 'sometoken'
|
token: 'sometoken'
|
||||||
validate_certs: false # only do this when you trust the network!
|
validate_certs: false # only do this when you trust the network!
|
||||||
|
|
||||||
- name: Delete a user in ManageIQ
|
- name: Delete a user in ManageIQ
|
||||||
community.general.manageiq_user:
|
community.general.manageiq_user:
|
||||||
|
@ -97,7 +97,7 @@ EXAMPLES = '''
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
username: 'admin'
|
username: 'admin'
|
||||||
password: 'smartvm'
|
password: 'smartvm'
|
||||||
validate_certs: false # only do this when you trust the network!
|
validate_certs: false # only do this when you trust the network!
|
||||||
|
|
||||||
- name: Delete a user in ManageIQ using a token
|
- name: Delete a user in ManageIQ using a token
|
||||||
community.general.manageiq_user:
|
community.general.manageiq_user:
|
||||||
|
@ -106,7 +106,7 @@ EXAMPLES = '''
|
||||||
manageiq_connection:
|
manageiq_connection:
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
token: 'sometoken'
|
token: 'sometoken'
|
||||||
validate_certs: false # only do this when you trust the network!
|
validate_certs: false # only do this when you trust the network!
|
||||||
|
|
||||||
- name: Update email of user in ManageIQ
|
- name: Update email of user in ManageIQ
|
||||||
community.general.manageiq_user:
|
community.general.manageiq_user:
|
||||||
|
@ -116,7 +116,7 @@ EXAMPLES = '''
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
username: 'admin'
|
username: 'admin'
|
||||||
password: 'smartvm'
|
password: 'smartvm'
|
||||||
validate_certs: false # only do this when you trust the network!
|
validate_certs: false # only do this when you trust the network!
|
||||||
|
|
||||||
- name: Update email of user in ManageIQ using a token
|
- name: Update email of user in ManageIQ using a token
|
||||||
community.general.manageiq_user:
|
community.general.manageiq_user:
|
||||||
|
@ -125,11 +125,11 @@ EXAMPLES = '''
|
||||||
manageiq_connection:
|
manageiq_connection:
|
||||||
url: 'http://127.0.0.1:3000'
|
url: 'http://127.0.0.1:3000'
|
||||||
token: 'sometoken'
|
token: 'sometoken'
|
||||||
validate_certs: false # only do this when you trust the network!
|
validate_certs: false # only do this when you trust the network!
|
||||||
'''
|
"""
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r"""
|
||||||
'''
|
"""
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible_collections.community.general.plugins.module_utils.manageiq import ManageIQ, manageiq_argument_spec
|
from ansible_collections.community.general.plugins.module_utils.manageiq import ManageIQ, manageiq_argument_spec
|
||||||
|
|
|
@ -10,54 +10,54 @@ from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
module: mas
|
module: mas
|
||||||
short_description: Manage Mac App Store applications with mas-cli
|
short_description: Manage Mac App Store applications with mas-cli
|
||||||
description:
|
description:
|
||||||
- Installs, uninstalls and updates macOS applications from the Mac App Store using the C(mas-cli).
|
- Installs, uninstalls and updates macOS applications from the Mac App Store using the C(mas-cli).
|
||||||
version_added: '0.2.0'
|
version_added: '0.2.0'
|
||||||
author:
|
author:
|
||||||
- Michael Heap (@mheap)
|
- Michael Heap (@mheap)
|
||||||
- Lukas Bestle (@lukasbestle)
|
- Lukas Bestle (@lukasbestle)
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
attributes:
|
attributes:
|
||||||
check_mode:
|
check_mode:
|
||||||
support: full
|
support: full
|
||||||
diff_mode:
|
diff_mode:
|
||||||
support: none
|
support: none
|
||||||
options:
|
options:
|
||||||
id:
|
id:
|
||||||
description:
|
description:
|
||||||
- The Mac App Store identifier of the app(s) you want to manage.
|
- The Mac App Store identifier of the app(s) you want to manage.
|
||||||
- This can be found by running C(mas search APP_NAME) on your machine.
|
- This can be found by running C(mas search APP_NAME) on your machine.
|
||||||
type: list
|
type: list
|
||||||
elements: int
|
elements: int
|
||||||
state:
|
state:
|
||||||
description:
|
description:
|
||||||
- Desired state of the app installation.
|
- Desired state of the app installation.
|
||||||
- The V(absent) value requires root permissions, also see the examples.
|
- The V(absent) value requires root permissions, also see the examples.
|
||||||
type: str
|
type: str
|
||||||
choices:
|
choices:
|
||||||
- absent
|
- absent
|
||||||
- latest
|
- latest
|
||||||
- present
|
- present
|
||||||
default: present
|
default: present
|
||||||
upgrade_all:
|
upgrade_all:
|
||||||
description:
|
description:
|
||||||
- Upgrade all installed Mac App Store apps.
|
- Upgrade all installed Mac App Store apps.
|
||||||
type: bool
|
type: bool
|
||||||
default: false
|
default: false
|
||||||
aliases: ["upgrade"]
|
aliases: ["upgrade"]
|
||||||
requirements:
|
requirements:
|
||||||
- macOS 10.11+
|
- macOS 10.11 or higher.
|
||||||
- "mas-cli (U(https://github.com/mas-cli/mas)) 1.5.0+ available as C(mas) in the bin path"
|
- "mas-cli (U(https://github.com/mas-cli/mas)) 1.5.0+ available as C(mas) in the bin path"
|
||||||
- The Apple ID to use already needs to be signed in to the Mac App Store (check with C(mas account)).
|
- The Apple ID to use already needs to be signed in to the Mac App Store (check with C(mas account)).
|
||||||
- The feature of "checking if user is signed in" is disabled for anyone using macOS 12.0+.
|
- The feature of "checking if user is signed in" is disabled for anyone using macOS 12.0+.
|
||||||
- Users need to sign in via the Mac App Store GUI beforehand for anyone using macOS 12.0+ due to U(https://github.com/mas-cli/mas/issues/417).
|
- Users need to sign in to the Mac App Store GUI beforehand for anyone using macOS 12.0+ due to U(https://github.com/mas-cli/mas/issues/417).
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: Install Keynote
|
- name: Install Keynote
|
||||||
community.general.mas:
|
community.general.mas:
|
||||||
id: 409183694
|
id: 409183694
|
||||||
|
@ -99,9 +99,9 @@ EXAMPLES = '''
|
||||||
id: 413857545
|
id: 413857545
|
||||||
state: absent
|
state: absent
|
||||||
become: true # Uninstallation requires root permissions
|
become: true # Uninstallation requires root permissions
|
||||||
'''
|
"""
|
||||||
|
|
||||||
RETURN = r''' # '''
|
RETURN = r""" # """
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
import os
|
import os
|
||||||
|
|
|
@ -8,58 +8,57 @@
|
||||||
from __future__ import (absolute_import, division, print_function)
|
from __future__ import (absolute_import, division, print_function)
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
author: "Jan Christian Grünhage (@jcgruenhage)"
|
author: "Jan Christian Grünhage (@jcgruenhage)"
|
||||||
module: matrix
|
module: matrix
|
||||||
short_description: Send notifications to matrix
|
short_description: Send notifications to matrix
|
||||||
description:
|
description:
|
||||||
- This module sends html formatted notifications to matrix rooms.
|
- This module sends html formatted notifications to matrix rooms.
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
attributes:
|
attributes:
|
||||||
check_mode:
|
check_mode:
|
||||||
support: full
|
support: full
|
||||||
diff_mode:
|
diff_mode:
|
||||||
support: none
|
support: none
|
||||||
options:
|
options:
|
||||||
msg_plain:
|
msg_plain:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- Plain text form of the message to send to matrix, usually markdown
|
- Plain text form of the message to send to matrix, usually markdown.
|
||||||
required: true
|
required: true
|
||||||
msg_html:
|
msg_html:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- HTML form of the message to send to matrix
|
- HTML form of the message to send to matrix.
|
||||||
required: true
|
required: true
|
||||||
room_id:
|
room_id:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- ID of the room to send the notification to
|
- ID of the room to send the notification to.
|
||||||
required: true
|
required: true
|
||||||
hs_url:
|
hs_url:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- URL of the homeserver, where the CS-API is reachable
|
- URL of the homeserver, where the CS-API is reachable.
|
||||||
required: true
|
required: true
|
||||||
token:
|
token:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- Authentication token for the API call. If provided, user_id and password are not required
|
- Authentication token for the API call. If provided, O(user_id) and O(password) are not required.
|
||||||
user_id:
|
user_id:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- The user id of the user
|
- The user id of the user.
|
||||||
password:
|
password:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- The password to log in with
|
- The password to log in with.
|
||||||
requirements:
|
requirements:
|
||||||
- matrix-client (Python library)
|
- matrix-client (Python library)
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: Send matrix notification with token
|
- name: Send matrix notification with token
|
||||||
community.general.matrix:
|
community.general.matrix:
|
||||||
msg_plain: "**hello world**"
|
msg_plain: "**hello world**"
|
||||||
|
@ -76,10 +75,10 @@ EXAMPLES = '''
|
||||||
hs_url: "https://matrix.org"
|
hs_url: "https://matrix.org"
|
||||||
user_id: "ansible_notification_bot"
|
user_id: "ansible_notification_bot"
|
||||||
password: "{{ matrix_auth_password }}"
|
password: "{{ matrix_auth_password }}"
|
||||||
'''
|
"""
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r"""
|
||||||
'''
|
"""
|
||||||
import traceback
|
import traceback
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
from ansible.module_utils.basic import AnsibleModule, missing_required_lib
|
||||||
|
|
|
@ -15,14 +15,14 @@ from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
|
|
||||||
DOCUMENTATION = '''
|
DOCUMENTATION = r"""
|
||||||
module: mattermost
|
module: mattermost
|
||||||
short_description: Send Mattermost notifications
|
short_description: Send Mattermost notifications
|
||||||
description:
|
description:
|
||||||
- Sends notifications to U(http://your.mattermost.url) via the Incoming WebHook integration.
|
- Sends notifications to U(http://your.mattermost.url) using the Incoming WebHook integration.
|
||||||
author: "Benjamin Jolivot (@bjolivot)"
|
author: "Benjamin Jolivot (@bjolivot)"
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
attributes:
|
attributes:
|
||||||
check_mode:
|
check_mode:
|
||||||
support: full
|
support: full
|
||||||
|
@ -32,15 +32,13 @@ options:
|
||||||
url:
|
url:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- Mattermost url (i.e. http://mattermost.yourcompany.com).
|
- Mattermost url (for example V(http://mattermost.yourcompany.com)).
|
||||||
required: true
|
required: true
|
||||||
api_key:
|
api_key:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- Mattermost webhook api key. Log into your mattermost site, go to
|
- Mattermost webhook api key. Log into your mattermost site, go to Menu -> Integration -> Incoming Webhook -> Add Incoming Webhook. This
|
||||||
Menu -> Integration -> Incoming Webhook -> Add Incoming Webhook.
|
will give you full URL. O(api_key) is the last part. U(http://mattermost.example.com/hooks/API_KEY).
|
||||||
This will give you full URL. O(api_key) is the last part.
|
|
||||||
http://mattermost.example.com/hooks/C(API_KEY)
|
|
||||||
required: true
|
required: true
|
||||||
text:
|
text:
|
||||||
type: str
|
type: str
|
||||||
|
@ -73,17 +71,16 @@ options:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- Set a priority for the message.
|
- Set a priority for the message.
|
||||||
choices: [ important, urgent ]
|
choices: [important, urgent]
|
||||||
version_added: 10.0.0
|
version_added: 10.0.0
|
||||||
validate_certs:
|
validate_certs:
|
||||||
description:
|
description:
|
||||||
- If V(false), SSL certificates will not be validated. This should only be used
|
- If V(false), SSL certificates will not be validated. This should only be used on personally controlled sites using self-signed certificates.
|
||||||
on personally controlled sites using self-signed certificates.
|
|
||||||
default: true
|
default: true
|
||||||
type: bool
|
type: bool
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = """
|
EXAMPLES = r"""
|
||||||
- name: Send notification message via Mattermost
|
- name: Send notification message via Mattermost
|
||||||
community.general.mattermost:
|
community.general.mattermost:
|
||||||
url: http://mattermost.example.com
|
url: http://mattermost.example.com
|
||||||
|
@ -117,16 +114,16 @@ EXAMPLES = """
|
||||||
short: true
|
short: true
|
||||||
"""
|
"""
|
||||||
|
|
||||||
RETURN = '''
|
RETURN = r"""
|
||||||
payload:
|
payload:
|
||||||
description: Mattermost payload
|
description: Mattermost payload.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
webhook_url:
|
webhook_url:
|
||||||
description: URL the webhook is sent to
|
description: URL the webhook is sent to.
|
||||||
returned: success
|
returned: success
|
||||||
type: str
|
type: str
|
||||||
'''
|
"""
|
||||||
|
|
||||||
from ansible.module_utils.basic import AnsibleModule
|
from ansible.module_utils.basic import AnsibleModule
|
||||||
from ansible.module_utils.urls import fetch_url
|
from ansible.module_utils.urls import fetch_url
|
||||||
|
|
|
@ -11,171 +11,165 @@
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
__metaclass__ = type
|
__metaclass__ = type
|
||||||
|
|
||||||
DOCUMENTATION = r'''
|
DOCUMENTATION = r"""
|
||||||
---
|
|
||||||
module: maven_artifact
|
module: maven_artifact
|
||||||
short_description: Downloads an Artifact from a Maven Repository
|
short_description: Downloads an Artifact from a Maven Repository
|
||||||
description:
|
description:
|
||||||
- Downloads an artifact from a maven repository given the maven coordinates provided to the module.
|
- Downloads an artifact from a maven repository given the maven coordinates provided to the module.
|
||||||
- Can retrieve snapshots or release versions of the artifact and will resolve the latest available
|
- Can retrieve snapshots or release versions of the artifact and will resolve the latest available version if one is not available.
|
||||||
version if one is not available.
|
|
||||||
author: "Chris Schmidt (@chrisisbeef)"
|
author: "Chris Schmidt (@chrisisbeef)"
|
||||||
requirements:
|
requirements:
|
||||||
- lxml
|
- lxml
|
||||||
- boto if using a S3 repository (V(s3://...))
|
- boto if using a S3 repository (V(s3://...))
|
||||||
attributes:
|
attributes:
|
||||||
check_mode:
|
check_mode:
|
||||||
support: none
|
support: none
|
||||||
diff_mode:
|
diff_mode:
|
||||||
support: none
|
support: none
|
||||||
options:
|
options:
|
||||||
group_id:
|
group_id:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- The Maven groupId coordinate.
|
- The Maven groupId coordinate.
|
||||||
required: true
|
required: true
|
||||||
artifact_id:
|
artifact_id:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- The maven artifactId coordinate.
|
- The maven artifactId coordinate.
|
||||||
required: true
|
required: true
|
||||||
version:
|
version:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- The maven version coordinate.
|
- The maven version coordinate.
|
||||||
- Mutually exclusive with O(version_by_spec).
|
- Mutually exclusive with O(version_by_spec).
|
||||||
version_by_spec:
|
version_by_spec:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- The maven dependency version ranges.
|
- The maven dependency version ranges.
|
||||||
- See supported version ranges on U(https://cwiki.apache.org/confluence/display/MAVENOLD/Dependency+Mediation+and+Conflict+Resolution)
|
- See supported version ranges on U(https://cwiki.apache.org/confluence/display/MAVENOLD/Dependency+Mediation+and+Conflict+Resolution).
|
||||||
- The range type V((,1.0],[1.2,\)) and V((,1.1\),(1.1,\)) is not supported.
|
- The range type V((,1.0],[1.2,\)) and V((,1.1\),(1.1,\)) is not supported.
|
||||||
- Mutually exclusive with O(version).
|
- Mutually exclusive with O(version).
|
||||||
version_added: '0.2.0'
|
version_added: '0.2.0'
|
||||||
classifier:
|
classifier:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- The maven classifier coordinate.
|
- The maven classifier coordinate.
|
||||||
default: ''
|
default: ''
|
||||||
extension:
|
extension:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- The maven type/extension coordinate.
|
- The maven type/extension coordinate.
|
||||||
default: jar
|
default: jar
|
||||||
repository_url:
|
repository_url:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- The URL of the Maven Repository to download from.
|
- The URL of the Maven Repository to download from.
|
||||||
- Use V(s3://...) if the repository is hosted on Amazon S3.
|
- Use V(s3://...) if the repository is hosted on Amazon S3.
|
||||||
- Use V(file://...) if the repository is local.
|
- Use V(file://...) if the repository is local.
|
||||||
default: https://repo1.maven.org/maven2
|
default: https://repo1.maven.org/maven2
|
||||||
username:
|
username:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- The username to authenticate as to the Maven Repository. Use AWS secret key of the repository is hosted on S3.
|
- The username to authenticate as to the Maven Repository. Use AWS secret key of the repository is hosted on S3.
|
||||||
aliases: [ "aws_secret_key" ]
|
aliases: ["aws_secret_key"]
|
||||||
password:
|
password:
|
||||||
type: str
|
type: str
|
||||||
description:
|
description:
|
||||||
- The password to authenticate with to the Maven Repository. Use AWS secret access key of the repository is hosted on S3.
|
- The password to authenticate with to the Maven Repository. Use AWS secret access key of the repository is hosted on S3.
|
||||||
aliases: [ "aws_secret_access_key" ]
|
aliases: ["aws_secret_access_key"]
|
||||||
headers:
|
headers:
|
||||||
description:
|
description:
|
||||||
- Add custom HTTP headers to a request in hash/dict format.
|
- Add custom HTTP headers to a request in hash/dict format.
|
||||||
type: dict
|
type: dict
|
||||||
force_basic_auth:
|
force_basic_auth:
|
||||||
description:
|
description:
|
||||||
- httplib2, the library used by the uri module only sends authentication information when a webservice
|
- Httplib2, the library used by the uri module only sends authentication information when a webservice responds to an initial request with
|
||||||
responds to an initial request with a 401 status. Since some basic auth services do not properly
|
a 401 status. Since some basic auth services do not properly send a 401, logins will fail. This option forces the sending of the Basic
|
||||||
send a 401, logins will fail. This option forces the sending of the Basic authentication header
|
authentication header upon initial request.
|
||||||
upon initial request.
|
default: false
|
||||||
default: false
|
type: bool
|
||||||
type: bool
|
version_added: '0.2.0'
|
||||||
version_added: '0.2.0'
|
dest:
|
||||||
dest:
|
type: path
|
||||||
type: path
|
description:
|
||||||
description:
|
- The path where the artifact should be written to.
|
||||||
- The path where the artifact should be written to.
|
- If file mode or ownerships are specified and destination path already exists, they affect the downloaded file.
|
||||||
- If file mode or ownerships are specified and destination path already exists, they affect the downloaded file.
|
required: true
|
||||||
required: true
|
state:
|
||||||
state:
|
type: str
|
||||||
type: str
|
description:
|
||||||
description:
|
- The desired state of the artifact.
|
||||||
- The desired state of the artifact.
|
default: present
|
||||||
default: present
|
choices: [present, absent]
|
||||||
choices: [present,absent]
|
timeout:
|
||||||
timeout:
|
type: int
|
||||||
type: int
|
description:
|
||||||
description:
|
- Specifies a timeout in seconds for the connection attempt.
|
||||||
- Specifies a timeout in seconds for the connection attempt.
|
default: 10
|
||||||
default: 10
|
validate_certs:
|
||||||
validate_certs:
|
description:
|
||||||
description:
|
- If V(false), SSL certificates will not be validated. This should only be set to V(false) when no other option exists.
|
||||||
- If V(false), SSL certificates will not be validated. This should only be set to V(false) when no other option exists.
|
type: bool
|
||||||
type: bool
|
default: true
|
||||||
default: true
|
client_cert:
|
||||||
client_cert:
|
description:
|
||||||
description:
|
- PEM formatted certificate chain file to be used for SSL client authentication.
|
||||||
- PEM formatted certificate chain file to be used for SSL client authentication.
|
- This file can also include the key as well, and if the key is included, O(client_key) is not required.
|
||||||
- This file can also include the key as well, and if the key is included, O(client_key) is not required.
|
type: path
|
||||||
type: path
|
version_added: '1.3.0'
|
||||||
version_added: '1.3.0'
|
client_key:
|
||||||
client_key:
|
description:
|
||||||
description:
|
- PEM formatted file that contains your private key to be used for SSL client authentication.
|
||||||
- PEM formatted file that contains your private key to be used for SSL client authentication.
|
- If O(client_cert) contains both the certificate and key, this option is not required.
|
||||||
- If O(client_cert) contains both the certificate and key, this option is not required.
|
type: path
|
||||||
type: path
|
version_added: '1.3.0'
|
||||||
version_added: '1.3.0'
|
keep_name:
|
||||||
keep_name:
|
description:
|
||||||
description:
|
- If V(true), the downloaded artifact's name is preserved, in other words the version number remains part of it.
|
||||||
- If V(true), the downloaded artifact's name is preserved, i.e the version number remains part of it.
|
- This option only has effect when O(dest) is a directory and O(version) is set to V(latest) or O(version_by_spec) is defined.
|
||||||
- This option only has effect when O(dest) is a directory and O(version) is set to V(latest) or O(version_by_spec)
|
type: bool
|
||||||
is defined.
|
default: false
|
||||||
type: bool
|
verify_checksum:
|
||||||
default: false
|
type: str
|
||||||
verify_checksum:
|
description:
|
||||||
type: str
|
- If V(never), the MD5/SHA1 checksum will never be downloaded and verified.
|
||||||
description:
|
- If V(download), the MD5/SHA1 checksum will be downloaded and verified only after artifact download. This is the default.
|
||||||
- If V(never), the MD5/SHA1 checksum will never be downloaded and verified.
|
- If V(change), the MD5/SHA1 checksum will be downloaded and verified if the destination already exist, to verify if they are identical.
|
||||||
- If V(download), the MD5/SHA1 checksum will be downloaded and verified only after artifact download. This is the default.
|
This was the behaviour before 2.6. Since it downloads the checksum before (maybe) downloading the artifact, and since some repository
|
||||||
- If V(change), the MD5/SHA1 checksum will be downloaded and verified if the destination already exist,
|
software, when acting as a proxy/cache, return a 404 error if the artifact has not been cached yet, it may fail unexpectedly. If you still
|
||||||
to verify if they are identical. This was the behaviour before 2.6. Since it downloads the checksum before (maybe)
|
need it, you should consider using V(always) instead - if you deal with a checksum, it is better to use it to verify integrity after download.
|
||||||
downloading the artifact, and since some repository software, when acting as a proxy/cache, return a 404 error
|
- V(always) combines V(download) and V(change).
|
||||||
if the artifact has not been cached yet, it may fail unexpectedly.
|
required: false
|
||||||
If you still need it, you should consider using V(always) instead - if you deal with a checksum, it is better to
|
default: 'download'
|
||||||
use it to verify integrity after download.
|
choices: ['never', 'download', 'change', 'always']
|
||||||
- V(always) combines V(download) and V(change).
|
checksum_alg:
|
||||||
required: false
|
type: str
|
||||||
default: 'download'
|
description:
|
||||||
choices: ['never', 'download', 'change', 'always']
|
- If V(md5), checksums will use the MD5 algorithm. This is the default.
|
||||||
checksum_alg:
|
- If V(sha1), checksums will use the SHA1 algorithm. This can be used on systems configured to use FIPS-compliant algorithms, since MD5
|
||||||
type: str
|
will be blocked on such systems.
|
||||||
description:
|
default: 'md5'
|
||||||
- If V(md5), checksums will use the MD5 algorithm. This is the default.
|
choices: ['md5', 'sha1']
|
||||||
- If V(sha1), checksums will use the SHA1 algorithm. This can be used on systems configured to use
|
version_added: 3.2.0
|
||||||
FIPS-compliant algorithms, since MD5 will be blocked on such systems.
|
unredirected_headers:
|
||||||
default: 'md5'
|
type: list
|
||||||
choices: ['md5', 'sha1']
|
elements: str
|
||||||
version_added: 3.2.0
|
version_added: 5.2.0
|
||||||
unredirected_headers:
|
description:
|
||||||
type: list
|
- A list of headers that should not be included in the redirection. This headers are sent to the C(fetch_url) function.
|
||||||
elements: str
|
- On ansible-core version 2.12 or later, the default of this option is V([Authorization, Cookie]).
|
||||||
version_added: 5.2.0
|
- Useful if the redirection URL does not need to have sensitive headers in the request.
|
||||||
description:
|
- Requires ansible-core version 2.12 or later.
|
||||||
- A list of headers that should not be included in the redirection. This headers are sent to the C(fetch_url) function.
|
directory_mode:
|
||||||
- On ansible-core version 2.12 or later, the default of this option is V([Authorization, Cookie]).
|
type: str
|
||||||
- Useful if the redirection URL does not need to have sensitive headers in the request.
|
description:
|
||||||
- Requires ansible-core version 2.12 or later.
|
- Filesystem permission mode applied recursively to O(dest) when it is a directory.
|
||||||
directory_mode:
|
|
||||||
type: str
|
|
||||||
description:
|
|
||||||
- Filesystem permission mode applied recursively to O(dest) when it is a directory.
|
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- ansible.builtin.files
|
- ansible.builtin.files
|
||||||
- community.general.attributes
|
- community.general.attributes
|
||||||
'''
|
"""
|
||||||
|
|
||||||
EXAMPLES = '''
|
EXAMPLES = r"""
|
||||||
- name: Download the latest version of the JUnit framework artifact from Maven Central
|
- name: Download the latest version of the JUnit framework artifact from Maven Central
|
||||||
community.general.maven_artifact:
|
community.general.maven_artifact:
|
||||||
group_id: junit
|
group_id: junit
|
||||||
|
@ -236,7 +230,7 @@ EXAMPLES = '''
|
||||||
artifact_id: junit
|
artifact_id: junit
|
||||||
version_by_spec: "[3.8,4.0)"
|
version_by_spec: "[3.8,4.0)"
|
||||||
dest: /tmp/
|
dest: /tmp/
|
||||||
'''
|
"""
|
||||||
|
|
||||||
import hashlib
|
import hashlib
|
||||||
import os
|
import os
|
||||||
|
|
Loading…
Reference in New Issue