1

I try to deploy a private endpoint for a storage account with Ansible. I am using azure.azcollection.azure_rm_privateendpoint. My playbook code is as below:

- name: Create PE
  hosts: localhost
  connection: local
  tasks:

    - name: create_pe
      azure.azcollection.azure_rm_privateendpoint:
        name: testprivateendpoint
        resource_group: MYRG
        private_link_service_connections:
          - name: pe-satest
            group_ids: blob
            private_link_service_id: /subscriptions/xxxxxxxxx/resourceGroups/MYRG/providers/Microsoft.Storage/storageAccounts/mysa
        subnet:
          id: /subscriptions/xxxxxxx/resourceGroups/MYRG-VNET/providers/Microsoft.Network/virtualNetworks/MYVNET/subnets/mySubnet

After launching the ansible-playbook command, i have the error below:

TASK [create_pe] ****************************************************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "Error creating or updating private endpoint testprivateendpoint - 'NetworkManagementClient' object has no attribute 'private_endpoints'"}

PLAY RECAP **********************************************************************************************************************************************************************************************************************************
localhost                  : ok=1    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
  • The private endpoint can be created manually from the Azure portal with the same properties.
  • The subnet's private endpoint network policies were already disabled.
  • My initial Ansible version was 2.9. After the error, I have updated it to Ansible 4.6 but i still get the same error.
  • My OS is RHEL 8.4.
  • Python 3.6

Any ideas about the source of this error?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.