Skip to content

Storage Roles Usage Guide

Tip

All storage roles have the ability to generate host_vars templates when the generate_host_vars tag is used. This allows you to run the playbooks to generate the necessary variables before actually provisioning storage. For example, you can run the following command to generate host variables for all Azure Windows hosts provisioned with managed disks:

ansible-playbook --limit='has_attached_disks:&azure_rm_windows' playbooks/storage/provision-azure-windows.yml --tags generate_host_vars

  1. Create a file in host_vars for each host storage will be provisioned on. The file should be named after the host's inventory name (e.g. host_vars/prdodb.yml).

  2. Define the variables for the storage role in the host file created in step 1. The variable structure is different for Windows and Linux. See examples in Templates.

  3. Finally, run the playbook for the storage role to provision storage on the host(s). For example, to provision storage on all Azure Windows hosts provisioned with managed disks, run the following command:

    ansible-playbook --limit='msql01.sapphire.dev' playbooks/storage/provision-azure-windows.yml
    

    Note

    Be sure to run the appropriate playbook for the host's operating system and cloud provider.