mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-24 11:21:25 -07:00
* fixing onboot parameter when not supplied
* adding changelog fragment
(cherry picked from commit 00a1152bb1
)
Co-authored-by: Andrew Pantuso <ajpantuso@gmail.com>
This commit is contained in:
parent
4e14c429c7
commit
86a5b4f28c
3 changed files with 22 additions and 3 deletions
|
@ -54,6 +54,17 @@ def proxmox_to_ansible_bool(value):
|
|||
return True if value == 1 else False
|
||||
|
||||
|
||||
def ansible_to_proxmox_bool(value):
|
||||
'''Convert Ansible representation of a boolean to be proxmox-friendly'''
|
||||
if value is None:
|
||||
return None
|
||||
|
||||
if not isinstance(value, bool):
|
||||
raise ValueError("%s must be of type bool not %s" % (value, type(value)))
|
||||
|
||||
return 1 if value else 0
|
||||
|
||||
|
||||
class ProxmoxAnsible(object):
|
||||
"""Base class for Proxmox modules"""
|
||||
def __init__(self, module):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue