【发布时间】:2020-10-25 15:12:31
【问题描述】:
This 官方文档 Quickstart: Configure Ansible using Azure Cloud Shell 来自 MS Azure 站点,要求您先将以下代码保存为 create_rg.yml,然后在 Azure Cloud shell 中运行 ansible-playbook 命令(如下面的第二个代码块所示)。
问题:在运行命令之前,您将create_rg.yml 保存在哪里(如下面的第二个代码块所示)?
创建_rg.yml 文件:
---
- hosts: localhost
connection: local
tasks:
- name: Creating resource group - "{{ name }}"
azure_rm_resourcegroup:
name: "{{ name }}"
location: "{{ location }}"
register: rg
- debug:
var: rg
ansible-playbook 命令运行 Azure Cloud Shell:
ansible-playbook create_rg.yml --extra-vars "name=<resource_group_name> location=<resource_group_location>"
备注:当我将本地文件夹中的 create_rg.yml 文件保存为C:\TestFolder\create_rg.yml 时,上述命令给出以下错误:
错误!剧本:找不到 C:\TestFolder\create_rg.yml
【问题讨论】:
-
检查文件权限。
标签: azure xaml ansible azure-cloud-shell