How to do it...

OpenStack lets us create our own flavors, as follows:

- name: Create a custom flavor  os_nova_flavor:    name: custom1    ram: 1024    vcpus: 1    disk: 10    ephemeral: 10    state: present

The os_nova_flavor module takes a name and parameters for the desired resources to create a custom flavor. Once the flavor is created, we can use the dashboard or os_server Ansible module to create a compute instance in the usual way, but with the new flavor.

Get Ansible 2 Cloud Automation Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.