GithubHelp home page GithubHelp logo

mirceanton / ansible_role-proxmox_cloudbuntu Goto Github PK

View Code? Open in Web Editor NEW
6.0 0.0 1.0 14 KB

An Ansible role that configures an Ubuntu VM template based on the cloud image with support for cloudinit on a Proxmox VE host.

License: MIT License

ansible ansible-role cloud-image cloudinit proxmox proxmox-ve ubuntu ubuntu-cloud-image

ansible_role-proxmox_cloudbuntu's Introduction

Proxmox: Cloudbuntu

An Ansible role that configures an Ubuntu VM template based on the cloud image with support for cloudinit on a Proxmox VE host.

Requirements

N/A

Role Variables

Required Variables:

These variables are required and the playbook will not run without them!

Variable Type Description
proxmox_cloudbuntu_vmid int the VMID of the VM
proxmox_cloudbuntu_disk_device string the storage device to hold the VM

Recommended Variables:

These variables are not required, but are most likely ones you will want to customize

Variable Default Description
proxmox_cloudbuntu_name cloudbuntu the name of the VM
proxmox_cloudbuntu_ci_ipconfig ip=dhcp the ip configuration in cloudinit format
proxmox_cloudbuntu_ci_nameserver UNDEFINED the dns server to set in the cloudinit configuration
proxmox_cloudbuntu_ci_searchdomain UNDEFINED the searchdomain to set in the cloudinit configuration
proxmox_cloudbuntu_ci_user UNDEFINED the username to configure for cloudinit
proxmox_cloudbuntu_ci_pass UNDEFINED the password to configure for cloudinit
proxmox_cloudbuntu_ci_keys UNDEFINED a list of ssh keys to pass to the VM via cloudinit

To check the default variables, take a look at the defaults file.

Dependencies

N/A

Example Playbook

---
- hosts: pve
  remote_user: root

  roles:
    - role: mirceanton.proxmox_cloudbuntu
      vars:
        proxmox_cloudbuntu_vmid: 9000
        proxmox_cloudbuntu_name: ubuntu-22.04-cloud
        proxmox_cloudbuntu_disk_device: local-vm

        proxmox_cloudbuntu_ci_nameserver: 192.168.35.1
        proxmox_cloudbuntu_ci_searchdomain: local
        proxmox_cloudbuntu_ci_ipconfig: "ip=192.168.35.47/24,gw=192.168.35.1"

        proxmox_cloudbuntu_ci_user: srvadmin
        proxmox_cloudbuntu_ci_pass: test123
        proxmox_cloudbuntu_ci_keys:
          - <ssh-key-here>
          - <ssh-key-here>

License

MIT

Author Information

A role developed by Mircea-Pavel ANTON.

ansible_role-proxmox_cloudbuntu's People

Contributors

mirceanton avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Forkers

kerzo

ansible_role-proxmox_cloudbuntu's Issues

Mismatched disk path when setting the boot disk.

I've been trying to use this script to create a cloudinit image using the following basic template:

- name: Ubuntu Provisioner
  hosts: proxmox
  become: true
  roles:
      - role: mirceanton.proxmox_cloudbuntu
        become: yes
        vars:
          proxmox_cloudbuntu_vmid: 9000
          proxmox_cloudbuntu_name: cloudbuntu-test
          proxmox_cloudbuntu_disk_device: loca
          proxmox_cloudbuntu_ci_user: srvadmin
          proxmox_cloudbuntu_ci_pass: test123

Unfortunately I kept running into an error on the Set the boot disk step in the configure-vm task.
| "unable to parse directory volume name 'vm-9000-disk-0'"

Running sudo pvesm list local as the disk was created allowed me to see that the disk was created under local:9000/base-9000-disk-0.raw

Therefore adding the vmid and extension to the step Set the boot disk line below allowed me to continue:

ansible.builtin.command: "qm set {{ proxmox_cloudbuntu_vmid }} --scsihw {{ proxmox_cloudbuntu_disk_scsihw }} --scsi0 {{ proxmox_cloudbuntu_disk_device }}:{{ proxmox_cloudbuntu_vmid }}/vm-{{ proxmox_cloudbuntu_vmid }}-disk-0.raw"

Unfortunately I don't know why qm create has decided to change the scheme of the disk it created. Perhaps it's a versioning or configuration issue?

For reference, I didn't use the Proxmox iso installer, instead I used the lae.proxmox ansible script to install with mostly default options:

        - role: lae.proxmox
          vars:
           - pve_group: all
           - pve_reboot_on_kernel_update: true
           - pve_repository_line: "deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription" 
           - pve_remove_subscription_warning: true

This has resulted in the following package versions:

proxmox-ve: 7.4-1 (running kernel: 6.1.15-1-pve)
pve-manager: 7.4-3 (running version: 7.4-3/9002ab8a)
pve-kernel-5.15: 7.4-3
pve-kernel-6.1: 7.3-6
pve-kernel-6.1.15-1-pve: 6.1.15-1
pve-kernel-6.1.6-1-pve: 6.1.6-1
pve-kernel-5.15.107-2-pve: 5.15.107-2
ceph-fuse: 14.2.21-1
corosync: 3.1.7-pve1
criu: 3.15-1+pve-1
glusterfs-client: 9.2-1
ifupdown: not correctly installed
ifupdown2: 3.1.0-1+pmx3
ksm-control-daemon: 1.4-1
libjs-extjs: 7.0.0-1
libknet1: 1.24-pve2
libproxmox-acme-perl: 1.4.4
libproxmox-backup-qemu0: 1.3.1-1
libproxmox-rs-perl: 0.2.1
libpve-access-control: 7.4-2
libpve-apiclient-perl: 3.2-1
libpve-common-perl: 7.4-1
libpve-guest-common-perl: 4.2-4
libpve-http-server-perl: 4.2-3
libpve-rs-perl: 0.7.6
libpve-storage-perl: 7.4-2
libspice-server1: 0.14.3-2.1
lvm2: 2.03.11-2.1
lxc-pve: 5.0.2-2
lxcfs: 5.0.3-pve1
novnc-pve: 1.4.0-1
proxmox-backup-client: 2.4.1-1
proxmox-backup-file-restore: 2.4.1-1
proxmox-kernel-helper: 7.4-1
proxmox-mail-forward: 0.1.1-1
proxmox-mini-journalreader: 1.3-1
proxmox-offline-mirror-helper: 0.5.1-1
proxmox-widget-toolkit: 3.6.5
pve-cluster: 7.3-3
pve-container: 4.4-3
pve-docs: 7.4-2
pve-edk2-firmware: 3.20230228-2
pve-firewall: 4.3-1
pve-firmware: 3.6-5
pve-ha-manager: 3.6.1
pve-i18n: 2.12-1
pve-qemu-kvm: 7.2.0-8
pve-xtermjs: 4.16.0-1
qemu-server: 7.4-3
smartmontools: 7.2-pve3
spiceterm: 3.2-2
swtpm: 0.8.0~bpo11+3
vncterm: 1.7-1
zfsutils-linux: 2.1.11-pve1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.