added code
This commit is contained in:
parent
9edd602376
commit
894687da0f
7 changed files with 1489 additions and 0 deletions
32
README.md
Normal file
32
README.md
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# Swagspace Cloud Init
|
||||
|
||||
This script builds VMs for the Swagspace infrastructure.
|
||||
|
||||
It takes gets the name of a VM, collect further data (CPUs, memory, IP addresses) from NetBox via GraphQL and creates a VM using [virt-install](https://virt-manager.org/index.html) and [cloud-init](https://cloudinit.readthedocs.io/en/latest/index.html).
|
||||
|
||||
It asks for a password for the user.
|
||||
|
||||
```
|
||||
usage: build-vm [-h] [--instance INSTANCE] [--config CONFIG] [--url URL] [--token TOKEN] [--graphql-url GRAPHQL_URL] [--base_image BASE_IMAGE] [--image_dir IMAGE_DIR] [--network-bridge NETWORK_BRIDGE] [--dry-run] [--overwrite] [--username USERNAME] vm_name
|
||||
|
||||
positional arguments:
|
||||
vm_name The name of the VM to build
|
||||
|
||||
options:
|
||||
-h, --help show this help message and exit
|
||||
--instance INSTANCE the name of the instance to use
|
||||
--config CONFIG the config file to use
|
||||
--url URL the URL of the NetBox API endpoint
|
||||
--token TOKEN the token for the NetBox REST API
|
||||
--graphql-url GRAPHQL_URL
|
||||
The URL for the GraphQL endpoint
|
||||
--base_image BASE_IMAGE
|
||||
The path to the cloud-init image to use. Default: 'debian13-cloud-init.qcow2'
|
||||
--image_dir IMAGE_DIR
|
||||
The location where the image should be stored.
|
||||
--network-bridge NETWORK_BRIDGE
|
||||
Name of the bridge the VM should be attached to
|
||||
--dry-run Query NetBox, build the cloud-init files but don't actually build the image
|
||||
--overwrite overwrite the image, if it exists
|
||||
--username USERNAME name of the user, Default: jo
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue