We highly recommend making yourself familiar with Visual Studio Code and the Ansible extension. Even if you’re not planning to use it as your daily driver, it is good to know how it works to explain and show the benefit to customers.
Double check you have the latest version of the Ansible extension by Red Hat and remove older or other versions. You might see a “reload” button next to the extension which you need to click to complete the installation.
You can now test the extension by performing the following tasks.
.yml
extension.~/.local/share/code-server/User/settings.json
:"files.associations": {
"*.yml": "ansible",
"*.yaml": "ansible"
},
You’ll see ansible-lint complaining about some parts of the Playbook in the Problems pane. You can open the Problems pane by clicking on View -> Problems. Your job is to fix these issues using the VS Code Ansible extension features.
Ctrl+Click
on a module FQCN to open its documentationCtrl+Space
for module parameters, e.g. add a task calling ansible.builtin.yum
and use Ctrl+Space
to see all module attributes and attribute parametersCtrl+Shift+m
): you might have to make sure ansible-lint
is enabled and notice it is only checking when you save a fileGet familiar with the Ansible VS Code extension features.
Although VS Code of course runs on Linux, Mac and Windows, there are some extra tasks to be done to get Ansible working on Windows or Mac. It’s beyond the scope of this manual to provide detailed instructions on how to setup Podman and Ansible on Windows or Mac.