add timeout and ssl verfy parameters
This commit is contained in:
parent
7ecc723ead
commit
1a45903410
12
CHANGELOG.md
12
CHANGELOG.md
@ -1,6 +1,6 @@
|
|||||||
- FEATURE
|
- BUGFIX
|
||||||
- add custom modules for cornetworks dns
|
- fix typos
|
||||||
- add custom module iptables_raw
|
- add missing defaults for parameters
|
||||||
- add custom module openssl_pkcs12
|
- ENHANCEMENT
|
||||||
- add custom module proxmox_kvm
|
- add parameter `verify_ssl` (default: true)
|
||||||
- add custom module ucr
|
- add parameter `auth_timeout` (default: 5)
|
||||||
|
@ -16,42 +16,54 @@ DOCUMENTATION = """
|
|||||||
version_added: 1.0.0
|
version_added: 1.0.0
|
||||||
description:
|
description:
|
||||||
- Get inventory hosts from the proxmox service.
|
- Get inventory hosts from the proxmox service.
|
||||||
- "Uses a configuration file as an inventory source, it must end in C(.proxmox.yml) or C(.proxmox.yaml) and has a C(plugin: proxmox) entry."
|
- "Uses a configuration file as an inventory source, it must end in C(.proxmox.yml) or C(.proxmox.yaml) and has a C(plugin: xoxys.general.proxmox) entry."
|
||||||
extends_documentation_fragment:
|
extends_documentation_fragment:
|
||||||
- inventory_cache
|
- inventory_cache
|
||||||
options:
|
options:
|
||||||
plugin:
|
plugin:
|
||||||
description: The name of this plugin, it should always be set to C(proxmox) for this plugin to recognize it as it"s own.
|
description: The name of this plugin, it should always be set to C(xoxys.general.proxmox) for this plugin to recognize it as it's own.
|
||||||
required: yes
|
required: yes
|
||||||
choices: ["xoxys.general.proxmox"]
|
choices: ["xoxys.general.proxmox"]
|
||||||
server:
|
server:
|
||||||
description: Proxmox VE server url.
|
description: Proxmox VE server url.
|
||||||
default: "pve.example.com"
|
default: "pve.example.com"
|
||||||
|
type: string
|
||||||
required: yes
|
required: yes
|
||||||
env:
|
env:
|
||||||
- name: PROXMOX_SERVER
|
- name: PROXMOX_SERVER
|
||||||
user:
|
user:
|
||||||
description: Proxmox VE authentication user.
|
description: Proxmox VE authentication user.
|
||||||
|
type: string
|
||||||
required: yes
|
required: yes
|
||||||
env:
|
env:
|
||||||
- name: PROXMOX_USER
|
- name: PROXMOX_USER
|
||||||
password:
|
password:
|
||||||
description: Proxmox VE authentication password
|
description: Proxmox VE authentication password.
|
||||||
|
type: string
|
||||||
required: yes
|
required: yes
|
||||||
env:
|
env:
|
||||||
- name: PROXMOX_PASSWORD
|
- name: PROXMOX_PASSWORD
|
||||||
|
verify_ssl:
|
||||||
|
description: Skip SSL certificate verification.
|
||||||
|
type: boolean
|
||||||
|
default: yes
|
||||||
|
auth_timeout:
|
||||||
|
description: Proxmox VE authentication timeout.
|
||||||
|
type: int
|
||||||
|
default: 5
|
||||||
exclude_vmid:
|
exclude_vmid:
|
||||||
description: VMID"s to exclude from inventory
|
description: VMID's to exclude from inventory.
|
||||||
type: list
|
type: list
|
||||||
default: []
|
default: []
|
||||||
elements: str
|
elements: str
|
||||||
exclude_state:
|
exclude_state:
|
||||||
description: VM states to exclude from inventory
|
description: VM states to exclude from inventory.
|
||||||
type: list
|
type: list
|
||||||
default: []
|
default: []
|
||||||
elements: str
|
elements: str
|
||||||
group:
|
group:
|
||||||
description: Group to place all hosts into
|
description: Group to place all hosts into.
|
||||||
|
type: string
|
||||||
default: proxmox
|
default: proxmox
|
||||||
want_facts:
|
want_facts:
|
||||||
description: Toggle, if C(true) the plugin will retrieve host facts from the server
|
description: Toggle, if C(true) the plugin will retrieve host facts from the server
|
||||||
@ -73,6 +85,7 @@ import socket
|
|||||||
|
|
||||||
from ansible.errors import AnsibleError
|
from ansible.errors import AnsibleError
|
||||||
from ansible.module_utils._text import to_native
|
from ansible.module_utils._text import to_native
|
||||||
|
from ansible.module_utils.parsing.convert_bool import boolean
|
||||||
from ansible.module_utils.six import iteritems
|
from ansible.module_utils.six import iteritems
|
||||||
from ansible.plugins.inventory import BaseInventoryPlugin
|
from ansible.plugins.inventory import BaseInventoryPlugin
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
@ -93,7 +106,8 @@ class InventoryModule(BaseInventoryPlugin):
|
|||||||
self.get_option("server"),
|
self.get_option("server"),
|
||||||
user=self.get_option("user"),
|
user=self.get_option("user"),
|
||||||
password=self.get_option("password"),
|
password=self.get_option("password"),
|
||||||
verify_ssl=False
|
verify_ssl=boolean(self.get_option("password"), strict=False),
|
||||||
|
timeout=self.get_option("auth_timeout")
|
||||||
)
|
)
|
||||||
|
|
||||||
def _get_version(self):
|
def _get_version(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user