[SOLVED] Trying to automate the creation of virtual machines using ansible; "authorization on proxmox cluster failed with exception"

Jan 19, 2021
34
5
13
124
This is my ansible playbook:

YAML:
---

- hosts: gluster-test
  become: true
  tasks:

  - name: Create new VM with minimal options
    community.general.proxmox_kvm:
      proxmox_default_behavior: 'no_defaults'
      api_user: 'root@pam'
      api_password: 'blahblahblah'
      api_host: 'gluster-test'
      name: 'test-vm'
      node: 'gluster-test'

Which I then run using ansible-playbook --ask-become-pass setup-test-vm.yml which gives me this output:

Code:
BECOME password:

PLAY [gluster-test] *******************************************************************************************************************************************

TASK [Gathering Facts] ****************************************************************************************************************************************
ok: [gluster-test]

TASK [Create new VM with minimal options] *********************************************************************************************************************
fatal: [gluster-test]: FAILED! => {"changed": false, "msg": "authorization on proxmox cluster failed with exception: HTTPSConnectionPool(host='gluster-test.jordanbradley.site', port=8006): Max retries exceeded with url: /api2/json/access/ticket (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f2efe49b6a0>: Failed to establish a new connection: [Errno 110] Connection timed out'))"}

PLAY RECAP ****************************************************************************************************************************************************
gluster-test               : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0

Which is strange because if I run this playbook against my production proxmox server I get a different error.
 
Last edited:

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!