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 O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.