To get to it right away, we can start from the top with the role we created, called create-users-env
. The completed role and the file named main.yml
is located in the adjust-quotas/tasks
directory and it looks similar to the following code:
--- - name: Retrieve tenantID shell: keystone --os-username={{ OS_USERNAME }} --os-password={{ OS_PASSWORD }} --os-tenant-name={{ OS_TENANT_NAME }} --os-auth-url={{ OS_AUTH_URL }} tenant-list | awk '/ {{ item }} / { print $2 }' with_items: tenantname register: tenantid - name: Adjust tenant quotas command: nova --os-username={{ OS_USERNAME }} --os-password={{ OS_PASSWORD }} --os-tenant-name={{ OS_TENANT_NAME }} --os-auth-url={{ OS_AUTH_URL }} quota-update {{ item.0 }} {{ item.1.stdout }} with_together: - qoptions - tenantid.results
The corresponding variable file named main.yml
, located in the adjust-quota/vars
directory will look similar to this:
--- qoptions: [ '--cores 30', '--instances 20 --cores 20', '--instances...