Page
Execute Ansible playbooks and integrated version control
Now that we have seen key features of Ansible VS Code extension, let's look at how to execute Ansible playbooks from the extension.
In this lesson, you will:
- Learn how to execute Ansible Playbooks from VS Code.
- Learn how to integrate version control in VS Code.
Execute Ansible playbooks from VS Code
The VS Code extension provides an option to run an Ansible playbook from within the extension either using ansible-navigator run or ansible-playbook command (Figure 1).
You can include an ansible-navigator.yml
or an ansible.cfg
file in your project root directory. The configured values will be automatically picked up in the runs using ansible-navigator
or ansible-playbook
respectively. The playbook run will open a terminal window in VS Code where you can see all the run details as well as any debugging information.
Integrate version control
VS Code provides Git support out of the box. While this is not a feature of Ansible VS Code extension, it is important to understand how to integrate and use the features provided by VS Code.
Please refer to these instructions for a deep dive on integrating version control within VS Code.
Additional resources and where to go next
- Start a free trial to Ansible Automation Platform
- Documentation: Ansible navigator
- Documentation: Configuring Ansible
- Documentation: Ansible Lint
- Documentation: Developing Ansible Collections
Have feedback on this learning path? Share it with us.