https://github.com/danielaca18/ansible-cloud-vm
An Ansible Role to create an Ubuntu Cloud VM on Proxmox.
https://github.com/danielaca18/ansible-cloud-vm
ansible proxmox ubuntu vm
Last synced: 11 months ago
JSON representation
An Ansible Role to create an Ubuntu Cloud VM on Proxmox.
- Host: GitHub
- URL: https://github.com/danielaca18/ansible-cloud-vm
- Owner: Danielaca18
- Created: 2025-05-15T06:48:06.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-05-15T08:02:52.000Z (about 1 year ago)
- Last Synced: 2025-06-21T13:02:49.890Z (about 1 year ago)
- Topics: ansible, proxmox, ubuntu, vm
- Language: Jinja
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Ansible Cloud VM
=========
An Ansible Role to create an Ubuntu Cloud VM on Proxmox.
[](https://galaxy.ansible.com/)
Requirements
------------
This role requires community.general collection to be installed.
Required Variables
------------------
The ansible host, proxmox token id and token are required to connect to the proxmox server. The token id is the name of the token, and the token is the actual token string.
```yaml
ansible_host: ""
proxmox_user: ""
proxmox_token_id: ""
proxmox_token: ""
```
Role Variables
--------------
Available variables are listed below, along with default values (see defaults/main.yml):
```yaml
cloud_vm_pve_node: "pve"
cloud_vm_image_name: noble-server-clouding-amd64.img
cloud_vm_image_url: "https://cloud-images.ubuntu.com/jammy/current/{{ cloud_vm_image_name }}"
cloud_vm_storage_pool: pve1
cloud_vm_storage_size: 150G
```
The cloud vm image name and url are required to download the image. The storage pool is the name of the storage pool where the vm will be created. The storage size is the size of the disk for the vm.
```yaml
hostname: {{ inventory_hostname }}
timezone: America/Edmonton
locale: en-US
keyboard_layout: us
```
The hostname, timezone, locale and keyboard layout are used to set the hostname, timezone, locale and keyboard layout for the vm.
```yaml
cloud_vm_user: ubuntu
cloud_vm_pass: password
```
The cloud vm user and password are used to set the username and password for the vm.
```yaml
ssh_authorized_keys: []
```
The ssh authorized keys are used to set the ssh keys for the vm. In the form ssh-rsa key user@email
```yaml
cloud_vm_packages:
- qemu-guest-agent
- git
- htop
- curl
- unzip
- python3-pip
- emacs
cloud_vm_cmds:
- /usr/local/bin/start-qga.sh
```
The cloud vm packages are the packages that will be installed on the vm. The cloud vm cmds are the commands that will be run on the vm after it is created.
Dependencies
------------
None.
Example Playbook
----------------
Including an example of how to use your role (for instance, with variables passed in as parameters) is always nice for users too:
- hosts: servers
roles:
- { role: username.rolename, x: 42 }
License
-------
BSD
Author Information
------------------
This role was created in 2023 by Daniel Castro