0

This official document Quickstart: Configure Ansible using Azure Cloud Shell from MS Azure site, asks you to first save the following code as create_rg.yml, and then run the ansible-playbook command (shown in second code block below) in Azure Cloud shell.

Question: Where do you save the create_rg.yml before running the command (shown in second code block below)?

create_rg.yml file:

---
- hosts: localhost
  connection: local
  tasks:
    - name: Creating resource group - "{{ name }}"
      azure_rm_resourcegroup:
        name: "{{ name }}"
        location: "{{ location }}"
      register: rg
    - debug:
        var: rg

ansible-playbook command to run the Azure Cloud Shell:

ansible-playbook create_rg.yml --extra-vars "name=<resource_group_name> location=<resource_group_location>"

Remark: When I save create_rg.yml file in my local folder as C:\TestFolder\create_rg.yml the above command give the following error:

ERROR! the playbook: C:\TestFolder\create_rg.yml could not be found

nam
  • 21,967
  • 37
  • 158
  • 332

1 Answers1

0

You could save the .yml file into your directory /home/nancy in the PowerShell or Bash in Azure Cloud Shell instead of your local folder. There is a built-in ansible tool in Azure cloud Shell.

enter image description here

Nancy
  • 26,865
  • 3
  • 18
  • 34
  • I have another issue posted [here](https://stackoverflow.com/q/64564821/1232087) if you have time to comment/suggest a solution. – nam Oct 28 '20 at 01:54