This commit is contained in:
parent
5dd6bb8661
commit
ffa15a72a3
@ -9,17 +9,16 @@ from __future__ import (absolute_import, division, print_function)
|
||||
__metaclass__ = type
|
||||
|
||||
DOCUMENTATION = """
|
||||
---
|
||||
name: proxmox
|
||||
plugin_type: inventory
|
||||
short_description: Proxmox VE inventory source
|
||||
version_added: 1.1.0
|
||||
description:
|
||||
name: proxmox
|
||||
plugin_type: inventory
|
||||
short_description: Proxmox VE inventory source
|
||||
version_added: 1.1.0
|
||||
description:
|
||||
- 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: xoxys.general.proxmox) entry."
|
||||
extends_documentation_fragment:
|
||||
extends_documentation_fragment:
|
||||
- inventory_cache
|
||||
options:
|
||||
options:
|
||||
plugin:
|
||||
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
|
||||
@ -75,7 +74,8 @@ options:
|
||||
description: Toggle, if C(true) the plugin will retrieve host facts from the server
|
||||
type: boolean
|
||||
default: True
|
||||
|
||||
requirements:
|
||||
- "proxmoxer"
|
||||
""" # noqa
|
||||
|
||||
EXAMPLES = """
|
||||
@ -187,7 +187,7 @@ class InventoryModule(BaseInventoryPlugin):
|
||||
except Exception: # noqa
|
||||
pass
|
||||
|
||||
if networks and type(networks) is list:
|
||||
if networks and isinstance(networks, list):
|
||||
for network in networks:
|
||||
for ip_address in network["ip-addresses"]:
|
||||
address = validate(ip_address["ip-address"])
|
||||
|
@ -78,6 +78,7 @@ options:
|
||||
C(-P)/C(--policy) to specify rules."
|
||||
required: false
|
||||
type: str
|
||||
default: ""
|
||||
state:
|
||||
description:
|
||||
- The state this rules fragment should be in.
|
||||
|
@ -955,18 +955,18 @@ def create_vm(
|
||||
|
||||
# If update, ensure existing disks are not recreated.
|
||||
if update:
|
||||
for k, _v in disks.items():
|
||||
for k, v in disks.items():
|
||||
if results["disks"].get(k):
|
||||
storage_id = results["disks"][k]["storage_id"]
|
||||
storage_opts = results["disks"][k]["storage_opts"]
|
||||
opts = ",".join(disks[k]["opts"])
|
||||
opts = ",".join(v["opts"])
|
||||
kwargs[k.rstrip(string.digits)][k] = f"{storage_id}:{storage_opts},{opts}"
|
||||
|
||||
for k, _v in nets.items():
|
||||
for k, v in nets.items():
|
||||
if results["nets"].get(k):
|
||||
net_id = results["nets"][k]["net_id"]
|
||||
net_opts = results["nets"][k]["net_opts"]
|
||||
opts = ",".join(nets[k]["opts"])
|
||||
opts = ",".join(v["opts"])
|
||||
kwargs[k.rstrip(string.digits)][k] = f"{net_id}={net_opts},{opts}"
|
||||
|
||||
# Convert all dict in kwargs to elements.
|
||||
|
@ -31,6 +31,7 @@ options:
|
||||
- New value of the variable
|
||||
required: False
|
||||
type: str
|
||||
default: ""
|
||||
state:
|
||||
required: False
|
||||
default: "present"
|
||||
|
Loading…
Reference in New Issue
Block a user