From 33059a807c925c7a1792e1617d00f7236a47d7d8 Mon Sep 17 00:00:00 2001 From: Shaul Shnaidman Date: Sat, 10 Sep 2022 11:53:08 +0300 Subject: [PATCH] changed the default proxmox container unprivileged flag (#5224) * changed the default proxmox container to unprivileged * Reverted the default value with a deprecation. * use true/false instead of yes/no * Update plugins/modules/cloud/misc/proxmox.py Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> * param -> parameter * Apply suggestions from code review Co-authored-by: Felix Fontein * fix * review * Update changelogs/fragments/5224-proxmox-unprivileged-default.yaml Co-authored-by: Felix Fontein Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com> Co-authored-by: Felix Fontein --- .../5224-proxmox-unprivileged-default.yaml | 2 ++ plugins/modules/cloud/misc/proxmox.py | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100644 changelogs/fragments/5224-proxmox-unprivileged-default.yaml diff --git a/changelogs/fragments/5224-proxmox-unprivileged-default.yaml b/changelogs/fragments/5224-proxmox-unprivileged-default.yaml new file mode 100644 index 0000000000..d716ff285f --- /dev/null +++ b/changelogs/fragments/5224-proxmox-unprivileged-default.yaml @@ -0,0 +1,2 @@ +deprecated_features: + - proxmox - deprecated the current ``unprivileged`` default value, will be changed to ``true`` in community.general 7.0.0 (https://github.com/pull/5224). diff --git a/plugins/modules/cloud/misc/proxmox.py b/plugins/modules/cloud/misc/proxmox.py index c6fbf24f9b..406666f57b 100644 --- a/plugins/modules/cloud/misc/proxmox.py +++ b/plugins/modules/cloud/misc/proxmox.py @@ -140,9 +140,11 @@ options: type: str unprivileged: description: - - Indicate if the container should be unprivileged + - Indicate if the container should be unprivileged. + - > + The default value for this parameter is C(false) but that is deprecated + and it will be replaced with C(true) in community.general 7.0.0. type: bool - default: false description: description: - Specify the description for the container. Only used on the configuration web interface. @@ -565,7 +567,7 @@ def main(): purge=dict(type='bool', default=False), state=dict(default='present', choices=['present', 'absent', 'stopped', 'started', 'restarted']), pubkey=dict(type='str'), - unprivileged=dict(type='bool', default=False), + unprivileged=dict(type='bool'), description=dict(type='str'), hookscript=dict(type='str'), proxmox_default_behavior=dict(type='str', default='no_defaults', choices=['compatibility', 'no_defaults']), @@ -607,6 +609,14 @@ def main(): timeout = module.params['timeout'] clone = module.params['clone'] + if module.params['unprivileged'] is None: + module.params['unprivileged'] = False + module.deprecate( + 'The default value `false` for the parameter "unprivileged" is deprecated and it will be replaced with `true`', + version='7.0.0', + collection_name='community.general' + ) + if module.params['proxmox_default_behavior'] == 'compatibility': old_default_values = dict( disk="3",