community.general.proxmox_template (8.5.0) — module

Management of OS templates in Proxmox VE cluster

Authors: Sergei Antipov (@UnderGreen)

Install collection

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


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

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: true
  • 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 O(state=present).
    type: path

node:
    description:
    - Proxmox VE node on which to operate.
    type: str

force:
    default: false
    description:
    - It can only be used with O(state=present), existing 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:
    - Specify the target host of the Proxmox VE cluster.
    required: true
    type: str

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

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

api_password:
    description:
    - Specify the password to authenticate with.
    - You can use E(PROXMOX_PASSWORD) environment variable.
    type: str

api_token_id:
    description:
    - Specify the token ID.
    - Requires C(proxmoxer>=1.1.0) to work.
    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 O(state=present).
    type: str

validate_certs:
    default: false
    description:
    - If V(false), SSL certificates will not be validated.
    - This should only be used on personally controlled sites using self-signed certificates.
    type: bool

api_token_secret:
    description:
    - Specify the token secret.
    - Requires C(proxmoxer>=1.1.0) to work.
    type: str
    version_added: 1.3.0
    version_added_collection: community.general