-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AzureRM Terraform Backend #2
Conversation
44daa54
to
be583dd
Compare
64cc7a6
to
9adcd56
Compare
5b7dc34
to
5028f6f
Compare
2b6bd05
to
75b7dcb
Compare
2338b7a
to
7ade137
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
other than few open review comments, lgtm!
7d09d34
to
cf8aa24
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not able to get the role assigned to the service principal as expected. It works if I change the azure.azcollection.azure_rm_roleassignment
module to add principal_type="ServicePrincipal"
here, but without that I was getting an error: Error creating role assignment: (PrincipalNotFound)
.
c60df41
to
a42d00a
Compare
@hakbailey I have made a minor update, it is working using the following playbook - hosts: localhost
gather_facts: false
tasks:
- name: List All
azure_rm_roleassignment_info:
register: az_role_assignments
- set_fact:
sp_list: "{{ az_role_assignments.roleassignments | selectattr('principal_type', 'equalto', 'ServicePrincipal') | list }}"
- include_role:
name: cloud.terraform_ops.azurerm_backend
vars:
azurerm_backend_operation: create
azurerm_backend_resource_group_name: "{{ resource_group }}"
azurerm_backend_location: "eastus"
azurerm_backend_container_name: "terraform"
azurerm_backend_service_principal_id: "{{ sp_list[0].principal_id }}"
when: sp_list | length > 0 |
@abikouo Can you please rebase? |
a42d00a
to
63436d3
Compare
azurerm_backend
A role to create/delete the necessary Azure infrastructure for an Azurerm remote backend for Terraform.