Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support extra distros #3

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
.venv
.local
30 changes: 20 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ Role Variables

api_user, api_password, api_host: these are needed to log into the Proxmox server.

* File: defaults/main.yml
* File: defaults/main.yml
* `Defaults`: These variables are the standard configuration for a VM.
* `cpu`: Specify emulated CPU type. 'host' uses the same CPU type as the host system.
* Default: `host`
* `net`: A hash/dictionary of network interfaces for the VM. net='{"key":"value", "key":"value"}'.
* `net`: A hash/dictionary of network interfaces for the VM. net='{"key":"value", "key":"value"}'.
Keys allowed are - net[n] where 0 ≤ n ≤ N.
Virtio was chosen to be the main platform for IO virtualization in KVM.
The bridge parameter can be used to automatically add the interface to a bridge device.
Expand All @@ -51,16 +51,16 @@ api_user, api_password, api_host: these are needed to log into the Proxmox serve
* Default: `2`
* `memory_size`: Memory size in MB for instance.
* Default: `2048`
* `balloon`: Specify the amount of RAM for the VM in MB. Using zero disables the balloon driver.
* `balloon`: Specify the amount of RAM for the VM in MB. Using zero disables the balloon driver.
The virtio balloon device allows KVM guests to reduce their memory size (thus relinquishing memory to the host) and
to increase it back (thus taking memory from the host).
* Default: `1024`
* `scsihw`: Specifies the SCSI controller model.
* `scsihw`: Specifies the SCSI controller model.
Choices: lsi, lsi53c810, virtio-scsi-pci, virtio-scsi-single, megasas, pvscsi
virtio-scsi-pci: A virtio storage interface for efficient I/O that overcomes virtio-blk limitations and
supports advanced SCSI hardware.
* Default: `virtio-scsi-pci`
* `virtio`: A hash/dictionary of volume used as VIRTIO hard disk. virtio='{"key":"value", "key":"value"}'.
* `virtio`: A hash/dictionary of volume used as VIRTIO hard disk. virtio='{"key":"value", "key":"value"}'.
Keys allowed are - virto[n] where 0 ≤ n ≤ 15.
Values allowed are - "storage:size,format=value".
storage is the storage identifier where to create the disk.
Expand All @@ -80,10 +80,13 @@ api_user, api_password, api_host: these are needed to log into the Proxmox serve
This file is used when the VM definition does not contain a path for a custom file.
* `preseed_template`: Specifies the name of the template preseed file, which will be taken if the definition of the vm in the playbook
has no preseed path. This file is used when the VM definition does not contain a path for a custom file.
* `ubuntu_distribution`: Specifies the Ubuntu distribution which will be installed on the VM.

* File: Your playbook (see example playbook)
* `proxmox`: Contains login data for the Proxmox server which should be encrypted. You need a file which contains
* `distribution`: Specifies the Unix distribution which will be installed on the VM.
* `distribution_img`: Specifies the distribution image file to download and install.
* `distribution_kernel_path`: Specifies the unix distribution kernel path. This is found under extracted distribution_img archive.
* `distribution_initrd_path`: Specifies the unix distribution initrd path. This is found under extracted distribution_img archive.

* File: Your playbook (see example playbook)
* `proxmox`: Contains login data for the Proxmox server which should be encrypted. You need a file which contains
the password for the Ansible vault.
Encrypting is done by the following command on the terminal:
`ansible-vault encrypt_string --vault-id <path_to_the_password_file> '<password>' --name '<variable_name>'`
Expand All @@ -95,10 +98,17 @@ api_user, api_password, api_host: these are needed to log into the Proxmox serve
(see defaults in defaults/main.yml).
* `<vm_name>`: Specifies the name of the VM.
* `node`: Specifies the name of the node on the Proxmox server. Below the node the VM will be installed.
* `ubuntu_distribution`: Specifies the ubuntu distribution which will be installed on the VM. See deployments in defaults/main.yml.
* `id`: Specifies the id of the VM.
* `distribution`: Specifies the unix distribution which will be installed on the VM. See deployments in defaults/main.yml.
* `distribution_img`: Specifies the distribution image file to download and install.
* `distribution_kernel_path`: Specifies the unix distribution kernel path. This is found under extracted distribution_img archive.
* `distribution_initrd_path`: Specifies the unix distribution initrd path. This is found under extracted distribution_img archive.
* `locale`: Locale is a set of parameters that defines the user's language.
* `root_password`: Specifies the root password of the VM.
* `cores`: Specify number of cores per socket.
* `sockets`: Specify number of cpu sockets.
* `memory_size`: Specifies the size of memory in MB for the VM.
* `baloon`: Specifies the size of the balloon memory in MB for the VM. 0 means disabled.
* `virtio`: Specifies the the hard-disk and its size to be used by the VM. See default/main.yml.
* `network`:
* `ip`: Specifies the ip address of the VM.
Expand Down
21 changes: 18 additions & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,14 @@ proxmox_vms_defaults:
# The Proxmox VE standard bridge is called 'vmbr0'.
# Option rate is used to limit traffic bandwidth from and to this interface.
# It is specified as floating point number, unit is 'Megabytes per second'.
net: '{"net0":"virtio,bridge=vmbr0"}'
net: '{"net0":"virtio,bridge=vmbr99"}'

# Specify number of cores per socket.
cores: '2'

# Specify number of cores per socket.
sockets: '2'

# Memory size in MB for instance.
memory_size: '2048'

Expand Down Expand Up @@ -59,5 +62,17 @@ proxmox_vms_defaults:
# has no preseed path.
preseed_template: 'ubuntu-template.seed'

# Specifies the ubuntu distribution which will be installed on the vm.
ubuntu_distribution: 'bionic'
# Specifies the unix type which will be installed on the vm: debian, ubuntu, etc.
nix_type: 'ubuntu'

# Specifies the unix distribution which will be installed on the vm.
distribution: 'bionic'

# Specifies the distribution image file to download and install.
distribution_img: 'http://archive.ubuntu.com/ubuntu/dists/bionic/main/installer-amd64/current/images/netboot/netboot.tar.gz'

# Specifies the unix distribution kernel path. This is found under extracted distribution_img archive.
distribution_kernel_path: '/ubuntu-installer/amd64/linux'

# Specifies the unix distribution initrd path. This is found under extracted distribution_img archive.
distribution_initrd_path: '/ubuntu-installer/amd64/initrd.gz'
Loading