mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
* added api_port * added changelog fragments for #8440 * api_port minor changes - Added documentation on api_port - Fixed multiple spaces after operator - Switched from str to int * Update changelogs/fragments/8440-allow-api-port-specification.yaml Co-authored-by: Felix Fontein <felix@fontein.de> * Update changelogs/fragments/8440-allow-api-port-specification.yaml Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/doc_fragments/proxmox.py Co-authored-by: Felix Fontein <felix@fontein.de> * Update plugins/doc_fragments/proxmox.py Co-authored-by: Felix Fontein <felix@fontein.de> --------- Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
06f13e79b1
commit
d2d7deb4ec
3 changed files with 17 additions and 0 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
minor_changes:
|
||||||
|
- proxmox - allow specification of the API port when using proxmox_* (https://github.com/ansible-collections/community.general/issues/8440, https://github.com/ansible-collections/community.general/pull/8441).
|
|
@ -16,6 +16,13 @@ options:
|
||||||
- Specify the target host of the Proxmox VE cluster.
|
- Specify the target host of the Proxmox VE cluster.
|
||||||
type: str
|
type: str
|
||||||
required: true
|
required: true
|
||||||
|
api_port:
|
||||||
|
description:
|
||||||
|
- Specify the target port of the Proxmox VE cluster.
|
||||||
|
- Uses the E(PROXMOX_PORT) environment variable if not specified.
|
||||||
|
type: int
|
||||||
|
required: false
|
||||||
|
version_added: 9.1.0
|
||||||
api_user:
|
api_user:
|
||||||
description:
|
description:
|
||||||
- Specify the user to authenticate with.
|
- Specify the user to authenticate with.
|
||||||
|
|
|
@ -29,6 +29,9 @@ def proxmox_auth_argument_spec():
|
||||||
required=True,
|
required=True,
|
||||||
fallback=(env_fallback, ['PROXMOX_HOST'])
|
fallback=(env_fallback, ['PROXMOX_HOST'])
|
||||||
),
|
),
|
||||||
|
api_port=dict(type='int',
|
||||||
|
fallback=(env_fallback, ['PROXMOX_PORT'])
|
||||||
|
),
|
||||||
api_user=dict(type='str',
|
api_user=dict(type='str',
|
||||||
required=True,
|
required=True,
|
||||||
fallback=(env_fallback, ['PROXMOX_USER'])
|
fallback=(env_fallback, ['PROXMOX_USER'])
|
||||||
|
@ -82,6 +85,7 @@ class ProxmoxAnsible(object):
|
||||||
|
|
||||||
def _connect(self):
|
def _connect(self):
|
||||||
api_host = self.module.params['api_host']
|
api_host = self.module.params['api_host']
|
||||||
|
api_port = self.module.params['api_port']
|
||||||
api_user = self.module.params['api_user']
|
api_user = self.module.params['api_user']
|
||||||
api_password = self.module.params['api_password']
|
api_password = self.module.params['api_password']
|
||||||
api_token_id = self.module.params['api_token_id']
|
api_token_id = self.module.params['api_token_id']
|
||||||
|
@ -89,6 +93,10 @@ class ProxmoxAnsible(object):
|
||||||
validate_certs = self.module.params['validate_certs']
|
validate_certs = self.module.params['validate_certs']
|
||||||
|
|
||||||
auth_args = {'user': api_user}
|
auth_args = {'user': api_user}
|
||||||
|
|
||||||
|
if api_port:
|
||||||
|
auth_args['port'] = api_port
|
||||||
|
|
||||||
if api_password:
|
if api_password:
|
||||||
auth_args['password'] = api_password
|
auth_args['password'] = api_password
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue