从 Azure CLI 应用 ansible 剧本时出现 Azure MSI 令牌问题

问题描述 投票:0回答:0

我曾经在 Azure CLI 云 shell 中执行 ansible 剧本。几年来一切都很好。 Lats 周我尝试执行 simpleansible-playbbok 并面临如下错误:

`fatal: \[localhost\]: FAILED! =\> {"changed": false, "msg": "Failed to get MSI token: 'MSIAuthentication' object has no attribute 'get_token'. Please check whether your machine enabled MSI or grant access to any subscription."}`

previously playbook 正确执行并创建了对象。

剧本:

---
- name: Create Log Analytics Azure
  hosts: localhost
  connection: local
  gather_facts: false

  vars:
    resource_group_name: sandbox
    location: eastus
    workspace_name: loganalyticsforwaf

  tasks:
    - name: create Log Analytics workspace
      azure_rm_loganalyticsworkspace:
        resource_group: "{{ resource_group_name }}"
        name: "{{ workspace_name }}"
        location: "{{ location }}"
        sku: per_gb2018

我使用带有默认 ansible 的 buildin azure Cloud Shell。过去几年我曾经使用过它,一切都很好。我检查了几个不同的帐户 - 都是一样的。事情变了…… 知道如何找到问题的根源吗?

谢谢!

我尝试使用 Ansibla 剧本创建 Azure 资源。

azure ansible cloud windows-installer token
© www.soinside.com 2019 - 2024. All rights reserved.