You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Implement shared and prune_backups options for proxmox_storage module
- add `prune_backups` option and all associated consistency checks, mark `maxfiles` as deprecated
- add `shared` option
- mark `encryption_key` and `password` options as `no_log` to prevent logging secret values to console
- fixes for typos
Copy file name to clipboardExpand all lines: library/proxmox_storage.py
+115-9Lines changed: 115 additions & 9 deletions
Original file line number
Diff line number
Diff line change
@@ -47,6 +47,12 @@
47
47
type: list
48
48
description:
49
49
- List of cluster node names where this storage is usable.
50
+
shared:
51
+
required: false
52
+
type: bool
53
+
description:
54
+
- Indicate that this is a single storage with the same contents on all nodes (or all listed in the O(nodes) option).
55
+
- It will not make the contents of a local storage automatically accessible to other nodes, it just marks an already shared storage as such!
50
56
path:
51
57
required: false
52
58
description:
@@ -74,6 +80,39 @@
74
80
default: 0
75
81
description:
76
82
- Maximal number of backup files per VM. 0 for unlimited.
83
+
- Deprecated, use O(prune_backups) instead. Replace either by C(keep-last) or, in case C(maxfiles) was C(0) for unlimited retention, by C(keep-all).
84
+
prune_backups:
85
+
required: false
86
+
type: list
87
+
elements: dict
88
+
description:
89
+
- Specifies how to prune backups.
90
+
- The retention options are processed in the order given. Each option only covers backups within its time period. The next option does not take care of already covered backups. It will only consider older backups.
91
+
suboptions:
92
+
option:
93
+
required: true
94
+
choices:
95
+
- keep-all
96
+
- keep-last
97
+
- keep-hourly
98
+
- keep-daily
99
+
- keep-weekly
100
+
- keep-monthly
101
+
- keep-yearly
102
+
description:
103
+
- The retention option to use.
104
+
- C(keep-all): Keep all backups. This option is mutually exclusive with the other options.
105
+
- C(keep-last): Keep the last n backups.
106
+
- C(keep-hourly): Keep backups for the last n hours. If there is more than one backup for a single hour, only the latest is kept.
107
+
- C(keep-daily): Keep backups for the last n days. If there is more than one backup for a single day, only the latest is kept.
108
+
- C(keep-weekly): Keep backups for the last n weeks. If there is more than one backup for a single week, only the latest is kept. Weeks start on Monday and end on Sunday. The software uses the ISO week date-system and handles weeks at the end of the year correctly.
109
+
- C(keep-monthly): Keep backups for the last n months. If there is more than one backup for a single month, only the latest is kept.
110
+
- C(keep-yearly): Keep backups for the last n years. If there is more than one backup for a single year, only the latest is kept.
111
+
value:
112
+
required: true
113
+
description:
114
+
- The number of backups to keep.
115
+
- For C(keep-all) option, this value must be a C(bool). For all other options, this value must be an C(int).
77
116
export:
78
117
required: false
79
118
description:
@@ -114,7 +153,7 @@
114
153
subdir:
115
154
required: false
116
155
- specifies the folder in the share dir to use for proxmox
117
-
(useful to seperate proxmox content from other content)
156
+
(useful to separate proxmox content from other content)
118
157
domain:
119
158
required: false
120
159
- Specifies Realm to use for NTLM/LDAPS Authentification if using
@@ -131,7 +170,9 @@
131
170
type: dir
132
171
path: /mydir
133
172
content: [ "images", "iso", "backup" ]
134
-
maxfiles: 3
173
+
prune_backups:
174
+
- option: keep-all
175
+
value: 1
135
176
- name: Create an RBD storage type
136
177
proxmox_storage:
137
178
name: ceph1
@@ -170,7 +211,7 @@
170
211
name: cephfs1
171
212
type: cephfs
172
213
content: [ "snippets", "vztmpl", "iso" ]
173
-
nodes: [ "proxmox1", "proxmox2"]
214
+
nodes: [ "proxmox1", "proxmox2"]
174
215
monhost:
175
216
- 10.0.0.1
176
217
- 10.0.0.2
@@ -228,6 +269,7 @@ def __init__(self, module):
228
269
self.disable=module.params['disable']
229
270
self.content=module.params['content']
230
271
self.nodes=module.params['nodes']
272
+
self.shared=module.params['shared']
231
273
self.type=module.params['type']
232
274
# Remaining PVE API arguments (depending on type) past this point
0 commit comments