community.general.one_template module – Manages OpenNebula templates
Note
This module is part of the community.general collection (version 10.1.0).
You might already have this collection installed if you are using the ansible
package.
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: community.general.one_template
.
New in community.general 2.4.0
Synopsis
Manages OpenNebula templates.
Requirements
The below requirements are needed on the host that executes this module.
pyone
Parameters
Parameter |
Comments |
---|---|
The password or token for XMLRPC authentication. If not specified then the value of the |
|
The ENDPOINT URL of the XMLRPC server. If not specified then the value of the |
|
The name of the user for XMLRPC authentication. If not specified then the value of the |
|
A the given name does not exist it will be created, otherwise it will be managed by this module. |
|
Choices:
|
|
A string containing the template contents. |
|
Whether to validate the TLS/SSL certificates or not. This parameter is ignored if Choices:
|
|
Time to wait for the desired state to be reached before timeout, in seconds. Default: |
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: partial Note that check mode always returns |
Can run in |
|
Support: none |
Will return details on what has changed (or possibly needs changing in |
Examples
- name: Fetch the TEMPLATE by id
community.general.one_template:
id: 6459
register: result
- name: Print the TEMPLATE properties
ansible.builtin.debug:
var: result
- name: Fetch the TEMPLATE by name
community.general.one_template:
name: tf-prd-users-workerredis-p6379a
register: result
- name: Create a new or update an existing TEMPLATE
community.general.one_template:
name: generic-opensuse
template: |
CONTEXT = [
HOSTNAME = "generic-opensuse"
]
CPU = "1"
CUSTOM_ATTRIBUTE = ""
DISK = [
CACHE = "writeback",
DEV_PREFIX = "sd",
DISCARD = "unmap",
IMAGE = "opensuse-leap-15.2",
IMAGE_UNAME = "oneadmin",
IO = "threads",
SIZE = "" ]
MEMORY = "2048"
NIC = [
MODEL = "virtio",
NETWORK = "testnet",
NETWORK_UNAME = "oneadmin" ]
OS = [
ARCH = "x86_64",
BOOT = "disk0" ]
SCHED_REQUIREMENTS = "CLUSTER_ID=\"100\""
VCPU = "2"
- name: Delete the TEMPLATE by id
community.general.one_template:
id: 6459
state: absent
Return Values
Common return values are documented here, the following are the fields unique to this module:
Key |
Description |
---|---|
the parsed template Returned: when |