ansible –version
.apt-get install ansible
.Descriptions of the configuration parameters
api_key
: The API key created in the Gcore Customer Portal in the profile settings.region_name
: A region in which your cloud resource is created.project_id
: An ID of the project that contains your cloud resources. You can check the ID in the Gcore Customer Portal on the Projects page./usr/bin/python3.11
variable only if your Python version is lower than the recommended 3.11
.ansible-playbook ./get_instance.yaml -v
.
3. If you correctly configured Ansible, you should see one of the following:
test.yaml
playbook that checks your quota limits creates a virtual instance if you have sufficient quotas.
To create and run the playbook:
1. Initialize a new “create_vm” role template.
touch ./create_vm/tasks/create_vm.yaml
.
5. Configure the task to create an instance.
create_vm/tasks/main.yml
file:
create_vm/vars/main.yml
file. For example:
test.yaml
to test the “create_vm” role.
ansible-playbook test.yaml
.
You should get one of the following outputs: