Highlighted
Mission Specialist
Mission Specialist
  • 2,967 Views

Ansible proxmox_kvm module

Jump to solution

Hi Everyone,

Can someone help me in how to use proxmox_kvm module ? I want to create VM's using this module but was unable to understant how to use it. I have gone through the ansible-doc but unable to create a correct playbook for that. If some can share me the working it will be a great help.

Labels (3)
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Starfighter Starfighter
Starfighter
  • 2,893 Views

Re: Ansible proxmox_kvm module

Jump to solution

Having looked at the error message closely, it might actually be an issue with SSL and not the firewall. Do you use a self-signed Proxmox certificate? If so, then you may need to tell urllib3 to ignore "invalid" SSL certificates.

I had a similar issue when using a dynamic Proxmox inventory, it refused to work with a self-signed certificate. Adding an option to ignore an invalid SSL certificate solved it for me.

View solution in original post

Reply
Loading...
6 Replies
Highlighted
Starfighter Starfighter
Starfighter
  • 2,953 Views

Re: Ansible proxmox_kvm module

Jump to solution

When you say that you are unable to create a playbook, how far did you get and what exactly does not work? If you explain the problem, then it's more likely that somebody will be able to help you. Also, there are examples available that show how to create new VMs with minimal options. Have you tried these, and if so, which part did not work?

0 Kudos
Reply
Loading...
Highlighted
Mission Specialist
Mission Specialist
  • 2,946 Views

Re: Ansible proxmox_kvm module

Jump to solution

Hi @Lisenet,  thanks for replying.

I have tried by using the example provided in the ansible-doc, can you please guide me where I am doing wrong. Below is my play.

name: create new vm with minimal packages
proxmox_kvm:
   api_user : root@pam
   api_password: redhat
   api_host : 192.168.0.11       #(ip of my local host)
   name : test1
   node : control-node          #(local host)

And I am getting this error:

"msg": "authorization on proxmox cluster failed with exception: HTTPSConnectionPool(host='192.168.0.11', port=8006): Max retries exceeded with url: /api2/json/access/ticket (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x7f0847f2f650>: Failed to establish a new connection: [Errno 111] Connection refused'

0 Kudos
Reply
Loading...
Highlighted
Starfighter Starfighter
Starfighter
  • 2,922 Views

Re: Ansible proxmox_kvm module

Jump to solution

Is communication on a TCP port 8006 allowed between your ansible host and Proxmox? The error message says that the connection was refused. Check the firewall.

0 Kudos
Reply
Loading...
Highlighted
Mission Specialist
Mission Specialist
  • 2,897 Views

Re: Ansible proxmox_kvm module

Jump to solution

Yup I have added port 8006 in firewalld, but still it showing same error.

0 Kudos
Reply
Loading...
Highlighted
Starfighter Starfighter
Starfighter
  • 2,894 Views

Re: Ansible proxmox_kvm module

Jump to solution

Having looked at the error message closely, it might actually be an issue with SSL and not the firewall. Do you use a self-signed Proxmox certificate? If so, then you may need to tell urllib3 to ignore "invalid" SSL certificates.

I had a similar issue when using a dynamic Proxmox inventory, it refused to work with a self-signed certificate. Adding an option to ignore an invalid SSL certificate solved it for me.

View solution in original post

Reply
Loading...
Highlighted
Mission Specialist
Mission Specialist
  • 2,867 Views

Re: Ansible proxmox_kvm module

Jump to solution

Hi @Lisenet, Thanks a lot for the solution. After ignoring "invalid" in urllib3 it worked.

0 Kudos
Reply
Loading...
Join the discussion
You must log in to join this conversation.