azure

Ansible: Azure Resource Manager inventory plugin (part 2)

Continuing the ARM inventory plugin post. Follow below some useful settings to help you to generate a good dynamic inventory. Working with group conditionalconditional_groups: # since this will be true for every host, every host sourced from this inventory plugin config will be in the # group 'all' all: true # if the VM's "name" variable contains "test", it will be placed in the 'test' group. test: "'test' in name" # if the VM's "name" variable contains "dev", it will be placed in…

Keep reading

Ansible: How-to install Azure Resource Manager inventory plugin (part 1)

IntroductionThis plugin allows you to work with dynamic inventory on Azure.Features Support VMSSConditional groups based on the name of the instances.Key group tags creationMultiples authentication methods wayInstallation Install azure cli https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest Install azure inventory plugin pip install 'ansible[azure]' Setup Create a new file called azure_rm.yml --- plugin: azure_rm auth_source: auto # Include VMSS. include_vmss_resource_groups: - '*'Setup Azure subscription settingsAzure cli az login az account set --subscription <subscription_name>…

Keep reading