Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/azure/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何配置ansible主机以通过服务原则连接到azure_Azure_Ansible - Fatal编程技术网

如何配置ansible主机以通过服务原则连接到azure

如何配置ansible主机以通过服务原则连接到azure,azure,ansible,Azure,Ansible,我想通过我的Anble主机(RHEL 8.1 vm)通过服务原则连接到azure,以获取azure资源组中的vm列表。 如何自动配置此ansible主机 我已通过命令安装ansible[azure]: sudopip3安装ansible[azure] 我已经在主目录中的.azure中创建了一个凭据文件 $ vim ~/.azure/credential [default] subscription_id=xxxxxx-xxxxx-xxxxxx-xxxx client_id=xxxxxx-x

我想通过我的Anble主机(RHEL 8.1 vm)通过服务原则连接到azure,以获取azure资源组中的vm列表。 如何自动配置此ansible主机

我已通过命令安装ansible[azure]: sudopip3安装ansible[azure]

我已经在主目录中的.azure中创建了一个凭据文件

$ vim ~/.azure/credential 
[default] 
subscription_id=xxxxxx-xxxxx-xxxxxx-xxxx 
client_id=xxxxxx-xxxx-xxxx-xxxxx 
secret=xxxxxxxxxx 
tenant=xxxxx-xxxx-xxx-xxx-xxx 
我跟着 创建“myazure_rm.yml”

当我运行以下程序时,我没有收到任何反馈:

[azureuser@vmaepansible002 ~]$ ansible all -m ping -i ./myazure_rm.yml
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'
我是否需要在此主机上安装azure cli才能完成此操作?我希望不会——还是我错了

[azureuser@vmaepansible002 ~]$ ansible all -m ping -i ./myazure_rm.yml
[WARNING]: provided hosts list is empty, only localhost is available. Note that the implicit localhost does not match 'all'