ansible.builtin.proxmox_template (v2.9.27) — module

management of OS templates in Proxmox VE cluster

| "added in version" 2.0 of ansible.builtin"

Authors: Sergei Antipov (@UnderGreen)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.27

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.
# Upload new openvz template with minimal options
- 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.
# Upload new openvz template with minimal options use environment PROXMOX_PASSWORD variable(you should export it before)
- 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.
# Upload new openvz template with all options and force overwrite
- 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.
# Delete template with minimal options
- 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

Inputs

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

node:
    description:
    - Proxmox VE node, when you will operate with template
    required: true

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

storage:
    default: local
    description:
    - target storage

timeout:
    default: 30
    description:
    - timeout for operations

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

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

template:
    description:
    - the template name
    - required only for states C(absent), C(info)

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

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

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