Skip to content

Commit

Permalink
fix role variable inconsistencies and doc edits
Browse files Browse the repository at this point in the history
  • Loading branch information
lae committed Jul 9, 2024
1 parent 9f1a10d commit 20c3be4
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 15 deletions.
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -422,9 +422,7 @@ pve_users: [] # List of user definitions to manage in PVE. See section on User M
pve_storages: [] # List of storages to manage in PVE. See section on Storage Management.
pve_datacenter_cfg: {} # Dictionary to configure the PVE datacenter.cfg config file.
pve_domains_cfg: [] # List of realms to use as authentication sources in the PVE domains.cfg config file.
pve_no_log: false # Set this to true in production to disable logging for strorage add to avoid having credentials leaked in log.
pve_addr0_priority: 255 # Type: integer Sets the Priority of the first Link for Corosync. Lower Number means higher Priority.
pve_addr1_priority: 0 # Type: integer See [pvecm-network-priority] for more Information.
pve_no_log: false # Set this to true in production to prevent leaking of storage credentials in run logs. (may be used in other tasks in the future)
```

To enable clustering with this role, configure the following variables appropriately:
Expand All @@ -437,12 +435,17 @@ pve_manage_hosts_enabled : yes # Set this to no to NOT configure hosts file (cas

The following variables are used to provide networking information to corosync.
These are known as ring0_addr/ring1_addr or link0_addr/link1_addr, depending on
PVE version. They should be IPv4 or IPv6 addresses. For more information, refer
to the [Cluster Manager][pvecm-network] chapter in the PVE Documentation.
PVE version. They should be IPv4 or IPv6 addresses. You can also configure the
[priority of these interfaces][pvecm-network-priority] to hint to corosync
which interface should handle cluster traffic (lower numbers indicate higher
priority). For more information, refer to the [Cluster Manager][pvecm-network]
chapter in the PVE Documentation.

```
# pve_cluster_addr0: "{{ defaults to the default interface ipv4 or ipv6 if detected }}"
# pve_cluster_addr1: "another interface's IP address or hostname"
# pve_cluster_addr0_priority: 255
# pve_cluster_addr1_priority: 0
```

You can set options in the datacenter.cfg configuration file:
Expand Down Expand Up @@ -595,9 +598,9 @@ Refer to `library/proxmox_role.py` [link][user-module] and

## Storage Management

You can use this role to manage storage within Proxmox VE (both in
single server deployments and cluster deployments). For now, the only supported
types are `dir`, `rbd`, `nfs`, `cephfs`, `lvm`,`lvmthin`, `zfspool`, `btrfs`, `cifs`
You can use this role to manage storage within Proxmox VE (both in single
server deployments and cluster deployments). For now, the only supported types
are `dir`, `rbd`, `nfs`, `cephfs`, `lvm`,`lvmthin`, `zfspool`, `btrfs`, `cifs`
and `pbs`. Here are some examples.

```
Expand Down
4 changes: 3 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ pve_cluster_clustername: "{{ pve_group }}"
pve_manage_hosts_enabled: yes
pve_cluster_addr0: "{{ ansible_default_ipv4.address if ansible_default_ipv4.address is defined else ansible_default_ipv6.address if ansible_default_ipv6.address is defined }}"
# pve_cluster_addr1: "{{ ansible_eth1.ipv4.address }}
# pve_cluster_addr0_priority: 0
# pve_cluster_addr1_priority: 1
pve_datacenter_cfg: {}
pve_domains_cfg: []
pve_cluster_ha_groups: []
Expand All @@ -57,4 +59,4 @@ pve_storages: []
pve_ssh_port: 22
pve_manage_ssh: true
pve_hooks: {}
pve_no_logging: false
pve_no_log: false
11 changes: 6 additions & 5 deletions library/proxmox_storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,13 @@
- Specifies the CIFS-Share to use
subdir:
required: false
- specifies the folder in the share dir to use for proxmox
- specifies the folder in the share dir to use for proxmox
(useful to seperate proxmox content from other content)
domain:
required: false
- Specifies Realm to use for NTLM/LDAPS Authentification if using
- Specifies Realm to use for NTLM/LDAPS Authentification if using
an AD-Enabled share
author:
- Fabien Brachere (@fbrachere)
'''
Expand Down Expand Up @@ -247,10 +248,10 @@ def __init__(self, module):
self.thinpool = module.params['thinpool']
self.sparse = module.params['sparse']
self.is_mountpoint = module.params['is_mountpoint']

# namespace for pbs
self.namespace = module.params['namespace']
# new params for cifs
# CIFS properties
self.domain = module.params['domain']
self.subdir = module.params['subdir']
self.share = module.params['share']
Expand Down Expand Up @@ -449,7 +450,7 @@ def main():
vgname=dict(default=None, type='str', required=False),
thinpool=dict(default=None, type='str', required=False),
sparse=dict(default=None, type='bool', required=False),
is_mountpoint=dict(default=None, type='bool', required=False),
is_mountpoint=dict(default=None, type='bool', required=False),
namespace=dict(default=None, type='str', required=False),
subdir=dict(default=None, type='str', required=False),
domain=dict(default=None, type='str', required=False),
Expand Down
2 changes: 1 addition & 1 deletion tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@
domain: "{{ item.domain | default(omit) }}"
subdir: "{{ item.subdir | default(omit) }}"
share: "{{ item.share | default(omit) }}"
no_log: "{{ pve_no_logging }}"
no_log: "{{ pve_no_log }}"
with_items: "{{ pve_storages }}"
when: "not pve_cluster_enabled | bool or (pve_cluster_enabled | bool and inventory_hostname == _init_node)"
tags: storage
Expand Down

0 comments on commit 20c3be4

Please sign in to comment.