community.general.proxmox_template (1.3.11) — module

management of OS templates in Proxmox VE cluster

Authors: Sergei Antipov (@UnderGreen)

Install collection

Install with ansible-galaxy collection install community.general:==1.3.11


Add to requirements.yml

  collections:
    - name: community.general
      version: 1.3.11

Description

allows you to upload/delete templates in Proxmox VE cluster


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Upload new openvz template with minimal options
  community.general.proxmox_template:
    node: uk-mc02
    api_user: root@pam
    api_password: 1q2w3e
    api_host: node1
    src: ~/ubuntu-14.04-x86_64.tar.gz
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: >
    Upload new openvz template with minimal options use environment
    PROXMOX_PASSWORD variable(you should export it before)
  community.general.proxmox_template:
    node: uk-mc02
    api_user: root@pam
    api_host: node1
    src: ~/ubuntu-14.04-x86_64.tar.gz
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Upload new openvz template with all options and force overwrite
  community.general.proxmox_template:
    node: uk-mc02
    api_user: root@pam
    api_password: 1q2w3e
    api_host: node1
    storage: local
    content_type: vztmpl
    src: ~/ubuntu-14.04-x86_64.tar.gz
    force: yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Delete template with minimal options
  community.general.proxmox_template:
    node: uk-mc02
    api_user: root@pam
    api_password: 1q2w3e
    api_host: node1
    template: ubuntu-14.04-x86_64.tar.gz
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Download proxmox appliance container template
  community.general.proxmox_template:
    node: uk-mc02
    api_user: root@pam
    api_password: 1q2w3e
    api_host: node1
    storage: local
    content_type: vztmpl
    template: ubuntu-20.04-standard_20.04-1_amd64.tar.gz

Inputs

    
src:
    description:
    - path to uploaded file
    - required only for C(state=present)
    type: path

node:
    description:
    - Proxmox VE node, when you will operate with template
    type: str

force:
    default: 'no'
    description:
    - can be used only with C(state=present), exists template will be overwritten
    type: bool

state:
    choices:
    - present
    - absent
    default: present
    description:
    - Indicate desired state of the template
    type: str

storage:
    default: local
    description:
    - target storage
    type: str

timeout:
    default: 30
    description:
    - timeout for operations
    type: int

api_host:
    description:
    - the host of the Proxmox VE cluster
    required: true
    type: str

api_user:
    description:
    - the user to authenticate with
    required: true
    type: str

template:
    description:
    - the template name
    - Required for state C(absent) to delete a template.
    - Required for state C(present) to download an appliance container template (pveam).
    type: str

api_password:
    description:
    - the password to authenticate with
    - you can use PROXMOX_PASSWORD environment variable
    type: str

api_token_id:
    description:
    - Specify the token ID.
    type: str
    version_added: 1.3.0
    version_added_collection: community.general

content_type:
    choices:
    - vztmpl
    - iso
    default: vztmpl
    description:
    - content type
    - required only for C(state=present)
    type: str

validate_certs:
    default: 'no'
    description:
    - enable / disable https certificate verification
    type: bool

api_token_secret:
    description:
    - Specify the token secret.
    type: str
    version_added: 1.3.0
    version_added_collection: community.general