ℹ️
|
The list of images is identified on the OpenStack README file. |
Different OS images are available on Openstack. To select a specific image use the openstack.vm.image
variable override.
ℹ️
|
The list of flavors is identified on the OpenStack README file. |
Create an OpenStack instance (aka a VM) using passwordstore as tools to manage the credentials, information.
ℹ️
|
The playbook also uses the variables defined in the |
Field name | Description |
---|---|
string |
Generic key name |
map required |
Map with required attributes for RHOS. Check the |
string |
RHOSP Authentication type Check the
|
string required |
Name of the VM being created. This name will be used both as hostname as well as Ansible Inventory name. |
Field name | Description |
---|---|
string required |
RHOS Flavor specifying the CPU, RAM and DISK sizes. |
string required |
OS Image to be used (e.g. |
string required |
Network provider in RHOS |
To create the RHOSP launch the openstack_vm_create_passwordstore.yml
Ansible Playbook
using the following command.
ansible-playbook ansible/playbook/openstack/openstack_vm_create_passwordstore.yml -e '{"openstack": {"vm": {"network": "provider_net_shared","image": "Fedora-Cloud-Base-37", "flavor": "m1.medium"}}}' -e vm_name=snowdrop_sample_vm
ℹ️
|
Some error messages might show on the installation process and be ignored by the installation process. Nevertheless the playbook should finish with no failed tasks. |
This is a sample result of the playbook execution.
PLAY RECAP *******************************************************************************************************
localhost : ok=68 changed=20 unreachable=0 failed=0 skipped=13 rescued=0 ignored=1
vm20210221-t01 : ok=32 changed=20 unreachable=0 failed=0 skipped=1 rescued=0 ignored=0
After creating the VM this playbook also executes the VM secure host playbook. This is an independent playbook that can be executed against any host. More information here.
Besides creating the VM the playbook also performs the following operations:
-
Store the host SSH keys on the controller device.
-
Add entries to the
~/.ssh/known_hosts
file for this host. -
Add several entries to the passwordstore database in order to build the Ansible Inventory
To delete a VM, simply execute the openstack_vm_remove_aggregate
playbook. Besides
removing the VM from the RHOSP it will also remove the entries from the passwordstore
database as well as any VM local ssh keys and entries from known hosts.
ansible-playbook ansible/playbook/openstack/openstack_vm_remove_passwordstore.yml -e vm_name=snowdrop_sample_vm
Although some failures might occur some might be ignored which shouldn’t affect thhe process. This playbook should finish with no failed tasks.
PLAY RECAP **********************************************************************************************************************************************************************************************************************
localhost : ok=17 changed=5 unreachable=0 failed=0 skipped=1 rescued=0 ignored=2