Skip to content

Commit 0d15777

Browse files
camilloDaniel MarohnThulium-Drake
authored
Added parameter master_api_password (#140)
* Added parameter master_api_password module: proxmox_cluster When joining a cluster, this parameter allows to spcify an API password for authentication against the master node, that is different from the one used to authenticate against the joining node. If not specified, the old behavior is used. * Add changelog * Add example for parameter master_api_password * Update proxmox_cluster.py * Update proxmox_cluster.py --------- Co-authored-by: Daniel Marohn <[email protected]> Co-authored-by: Jeffrey van Pelt <[email protected]>
1 parent 2d3cfd1 commit 0d15777

File tree

2 files changed

+21
-1
lines changed

2 files changed

+21
-1
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
---
2+
minor_changes:
3+
- proxmox_cluster - Add master_api_password for authentication against master node (https://github.com/ansible-collections/community.proxmox/pull/140).

plugins/modules/proxmox_cluster.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@
3636
- The IP address of the cluster master when joining the cluster.
3737
type: str
3838
required: false
39+
master_api_password:
40+
description:
41+
- Specify the password to authenticate with the master node.
42+
- Uses the api_password parameter if not specified.
43+
type: str
44+
required: false
3945
fingerprint:
4046
description:
4147
- The fingerprint of the cluster master when joining the cluster.
@@ -78,6 +84,16 @@
7884
master_ip: "{{ primary_node }}"
7985
fingerprint: "{{ cluster_fingerprint }}"
8086
cluster_name: "devcluster"
87+
88+
- name: Join a Proxmox VE Cluster with different API password
89+
community.proxmox.proxmox_cluster:
90+
api_host: proxmoxhost
91+
api_user: root@pam
92+
api_password: "{{ joining_node_api_password }}"
93+
master_api_password: "{{ master_node_api_password }}"
94+
master_ip: "{{ primary_node }}"
95+
fingerprint: "{{ cluster_fingerprint }}"
96+
cluster_name: "devcluster"
8197
"""
8298

8399
RETURN = r"""
@@ -127,7 +143,7 @@ def cluster_create(self):
127143
def cluster_join(self):
128144
master_ip = self.module.params.get("master_ip")
129145
fingerprint = self.module.params.get("fingerprint")
130-
api_password = self.module.params.get("api_password")
146+
api_password = self.module.params.get("master_api_password") or self.module.params.get("api_password")
131147
cluster_name = self.module.params.get("cluster_name")
132148
is_in_cluster = True
133149

@@ -180,6 +196,7 @@ def main():
180196
link0=dict(type='str'),
181197
link1=dict(type='str'),
182198
master_ip=dict(type='str'),
199+
master_api_password=dict(type='str', no_log=True),
183200
fingerprint=dict(type='str'),
184201
)
185202
module_args.update(cluster_args)

0 commit comments

Comments
 (0)