# Playbook Editor

**URL:** <https://forum.ansible.com/t/playbook-editor/5902>\
**Category:** Get Help\
**Tags:** playbook, netbox\
**Created:** [May 21, 2024, 8:12am UTC](https://forum.ansible.com/t/playbook-editor/5902 "2024-05-21T08:12:51Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![czql5v](https://avatars.discourse-cdn.com/v4/letter/c/e56c9b/32.png) [@czql5v](https://forum.ansible.com/u/czql5v)\
**Post date:** [May 21, 2024, 8:12am UTC](https://forum.ansible.com/t/playbook-editor/5902/1 "2024-05-21T08:12:51Z")

</div>

Hi Guys,

New to Ansible, Linux & GIT. Never used any before and have been put on a course through work.

I am currently using vim as my playbook editor but find it very uncomfortable to use. I have been told that I could use Notepad ++ but in all honesty I wouldn’t know how to execute and don’t see much information online regarding its use with ansible.

Can anyone advise a good editor that I might be able to use with creating playbooks in ansible.

Any further information or help would be greatly appreciated as I am a wintel engineer attempting to get to grips with Linux & Ansible.

Regards All.

---

<div class="post-metadata">

**Author:** ![chris](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chris/32/293_2.png) [@chris](https://forum.ansible.com/u/chris)\
**Post date:** [May 21, 2024, 9:36am UTC](https://forum.ansible.com/t/playbook-editor/5902/2 "2024-05-21T09:36:22Z")

</div>

Any plain text editor will work, having syntax highlighting for YAML and Jinja2 makes life more pleasant and some of us are so used to it that we can’t live without it.

Assuming you are using `git` for your code then IDE that comes with the SCM system you are using (eg GitLab or GitHub etc) might work for you also.

---

<div class="post-metadata">

**Author:** ![czql5v](https://avatars.discourse-cdn.com/v4/letter/c/e56c9b/32.png) [@czql5v](https://forum.ansible.com/u/czql5v)\
**Post date:** [May 21, 2024, 10:42am UTC](https://forum.ansible.com/t/playbook-editor/5902/3 "2024-05-21T10:42:30Z")

</div>

Hi Chris,

Thanks very much for replying to my very first post.

As explained I am a complete and utter novice with all this (Linux, Ansible, Git etc, etc). Not even sure if I am using GIT. All I have a the minute is one Linux control node and an additional 2 Linux boxes. Also, 4 vm Azure servers which I would like to use as test servers.

You kindly responded saying that i could utilise any plain text editor but how would I use that if I am logged into the Linux control node?

Sorry if this is a stupid question I really have no idea what / how to use txt editor with ansible.

Hope you are able to offer some advice.

With Regards.

---

<div class="post-metadata">

**Author:** ![chris](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chris/32/293_2.png) [@chris](https://forum.ansible.com/u/chris)\
**Post date:** [May 21, 2024, 10:45am UTC](https://forum.ansible.com/t/playbook-editor/5902/4 "2024-05-21T10:45:28Z")

</div>

If you need to use a console text editor that is easy to start with then [nano](https://www.nano-editor.org/) should be quicker to get going with than `vim`, it should be available from your distro if not already installed.

---

<div class="post-metadata">

**Author:** ![jrglynn2](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@jrglynn2](https://forum.ansible.com/u/jrglynn2)\
**Post date:** [May 21, 2024, 12:55pm UTC](https://forum.ansible.com/t/playbook-editor/5902/5 "2024-05-21T12:55:34Z")

</div>

If you are using an editor on the Linux node itself, `vim` or `nano` - both are widely used, both have pros and cons, you can google to find easy instructions on how to use either.

I personally use [VS Code](https://code.visualstudio.com/) on my machine, and use the `Remote-SSH` setup to connect to the Linux server and files. I personally can’t stand to use `vim` or `nano` for extended coding, but that’s me…

---

<div class="post-metadata">

**Author:** ![czql5v](https://avatars.discourse-cdn.com/v4/letter/c/e56c9b/32.png) [@czql5v](https://forum.ansible.com/u/czql5v)\
**Post date:** [May 21, 2024, 1:17pm UTC](https://forum.ansible.com/t/playbook-editor/5902/6 "2024-05-21T13:17:00Z")

</div>

VSCode, that looks interesting. I assume I can install that on my workstation or windows server and create a playbook, which is located on my workstation \ Server. However, what i fail to understand is when I have created a playbook where \ how do I run that on a Linux \ Ansible machine so that it carries out the instructions. Or am i missing something.

Regards jrglynn2 for taking the time out to reply.

---

<div class="post-metadata">

**Author:** ![chris](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chris/32/293_2.png) [@chris](https://forum.ansible.com/u/chris)\
**Post date:** [May 21, 2024, 1:24pm UTC](https://forum.ansible.com/t/playbook-editor/5902/7 "2024-05-21T13:24:01Z")

</div>

Try [starting here](https://docs.ansible.com/ansible/latest/network/getting_started/first_playbook.html).

---

<div class="post-metadata">

**Author:** ![jrglynn2](https://avatars.discourse-cdn.com/v4/letter/j/94ad74/32.png) [@jrglynn2](https://forum.ansible.com/u/jrglynn2)\
**Post date:** [May 21, 2024, 2:57pm UTC](https://forum.ansible.com/t/playbook-editor/5902/8 "2024-05-21T14:57:05Z")

</div>

VS Code has the Remote:SSH setup that allows you to edit directly on Linux Hosts through SSH.

Or, if you edit on local files, you can then migrate to the Linux Host via standard CI/CD/GIT processes.

---

<div class="post-metadata">

**Author:** ![Denney-tech](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/denney-tech/32/1556_2.png) [@Denney-tech](https://forum.ansible.com/u/Denney-tech)\
**Post date:** [May 21, 2024, 3:15pm UTC](https://forum.ansible.com/t/playbook-editor/5902/9 "2024-05-21T15:15:02Z")

</div>

VSCode also works natively on Linux, so if you have a DE or X11 + an X-Server setup, you can open VSCode directly on your Ansible node and work there instead.

[Running Visual Studio Code on Linux](https://code.visualstudio.com/docs/setup/linux)

---

<div class="post-metadata">

**Author:** ![czql5v](https://avatars.discourse-cdn.com/v4/letter/c/e56c9b/32.png) [@czql5v](https://forum.ansible.com/u/czql5v)\
**Post date:** [May 22, 2024, 7:37am UTC](https://forum.ansible.com/t/playbook-editor/5902/10 "2024-05-22T07:37:43Z")

</div>

Hi jrglynn2,

Thanks Glynn.

I am beginning to understand a little more now that you have explained how its possible to use VSCode.

I will explore that. I also need to google CI/CD/GIT as I know nothing about those particular applications.

Thanks and regards for posting.

---

<div class="post-metadata">

**Author:** ![czql5v](https://avatars.discourse-cdn.com/v4/letter/c/e56c9b/32.png) [@czql5v](https://forum.ansible.com/u/czql5v)\
**Post date:** [May 22, 2024, 11:09am UTC](https://forum.ansible.com/t/playbook-editor/5902/11 "2024-05-22T11:09:38Z")

</div>

Hi Denney-tech thanks for the update its appreciated. I think I am going to try the vscode first see how I can get on with that.

I will explore DE or X11 if I don’t get on with vscode.

Regards and thanks for posting.

---

<div class="post-metadata">

**Author:** ![czql5v](https://avatars.discourse-cdn.com/v4/letter/c/e56c9b/32.png) [@czql5v](https://forum.ansible.com/u/czql5v)\
**Post date:** [May 22, 2024, 11:12am UTC](https://forum.ansible.com/t/playbook-editor/5902/12 "2024-05-22T11:12:48Z")

</div>

Hi Glynn2

I am attempting to connect to my sandbox azure server via ssh using vscode. It does not want to connect for some reason. I have installed the vscode app on my desktop started the Linux vm in azure and attempted to connect using ssh xxxxx from my desktop.

Any ideas what might be happening or how I could connect to this linux host?

Regards.

---

<div class="post-metadata">

**Author:** ![chris](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chris/32/293_2.png) [@chris](https://forum.ansible.com/u/chris)\
**Post date:** [May 22, 2024, 11:16am UTC](https://forum.ansible.com/t/playbook-editor/5902/13 "2024-05-22T11:16:37Z")

</div>

Can you SSH to the server using a terminal client?

If not I’d suggest getting that working to start with, using SSH keys to make easier.

---

<div class="post-metadata">

**Author:** ![czql5v](https://avatars.discourse-cdn.com/v4/letter/c/e56c9b/32.png) [@czql5v](https://forum.ansible.com/u/czql5v)\
**Post date:** [May 22, 2024, 11:42am UTC](https://forum.ansible.com/t/playbook-editor/5902/14 "2024-05-22T11:42:54Z")

</div>

Hi Chris,

There are numerous restrictions on our local pc’s I think its better to create a new vm in azure sandbox install vscode from there and then attempt the ssh connection to the linux host which is also part of the sandbox infra.

I will report back with an update.

Regards.

---

<div class="post-metadata">

**Author:** ![czql5v](https://avatars.discourse-cdn.com/v4/letter/c/e56c9b/32.png) [@czql5v](https://forum.ansible.com/u/czql5v)\
**Post date:** [May 22, 2024, 3:10pm UTC](https://forum.ansible.com/t/playbook-editor/5902/15 "2024-05-22T15:10:30Z")

</div>

Hi Glynn,

Installed and setup connection to host. Have setup the config and ssh login information for the linux server but getting the below.

Any ideas?

 ![image](https://us1.discourse-cdn.com/ansible/original/2X/9/9a8601999272b22cd274e3743ae5e5da6d2f7489.png)

---

<div class="post-metadata">

**Author:** ![chris](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chris/32/293_2.png) [@chris](https://forum.ansible.com/u/chris)\
**Post date:** [May 22, 2024, 5:50pm UTC](https://forum.ansible.com/t/playbook-editor/5902/16 "2024-05-22T17:50:37Z")

</div>

> TCP port forwading may be disabled.

Have you checked if [`AllowTcpForwarding`](https://man.openbsd.org/sshd_config#AllowTcpForwarding) is enabled?

---

<div class="post-metadata">

**Author:** ![czql5v](https://avatars.discourse-cdn.com/v4/letter/c/e56c9b/32.png) [@czql5v](https://forum.ansible.com/u/czql5v)\
**Post date:** [May 23, 2024, 7:23am UTC](https://forum.ansible.com/t/playbook-editor/5902/17 "2024-05-23T07:23:10Z")

</div>

Hi Chris,

Thanks for taking the time out to post.

Not entirely sure where I need to configure or check this. My client machine (Firewall) or somewhere in the vscode application? Sorry I am confused.

I have created a port forwarding on the firewall from where I have installed the vscode application but I am still hitting the same exact problem when I attempt to connect to the Ansible Control Host Linus server.

Any advice or help would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![chris](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/chris/32/293_2.png) [@chris](https://forum.ansible.com/u/chris)\
**Post date:** [May 23, 2024, 8:52am UTC](https://forum.ansible.com/t/playbook-editor/5902/18 "2024-05-23T08:52:00Z")

</div>

The screenshot you posted above was the results of trying to connect to `10.102.80.211` so that is the machine that I’d suggest checking for `AllowTcpForwarding` in `/etc/ssh/sshd_config`.

---

<div class="post-metadata">

**Author:** ![czql5v](https://avatars.discourse-cdn.com/v4/letter/c/e56c9b/32.png) [@czql5v](https://forum.ansible.com/u/czql5v)\
**Post date:** [May 23, 2024, 9:26am UTC](https://forum.ansible.com/t/playbook-editor/5902/19 "2024-05-23T09:26:34Z")

</div>

Thanks Chris,

I will ask the owners of the server as I am not the owner. Hopefully they might be able to open the necessary port forwarding.

---

<div class="post-metadata">

**Author:** ![czql5v](https://avatars.discourse-cdn.com/v4/letter/c/e56c9b/32.png) [@czql5v](https://forum.ansible.com/u/czql5v)\
**Post date:** [May 24, 2024, 1:37pm UTC](https://forum.ansible.com/t/playbook-editor/5902/20 "2024-05-24T13:37:10Z")

</div>

Hi Chris, Glynn,

Thanks both for helping me out this far.

I have managed to install vsscode onto my W2022 windows server, and I am able to ping the Linux - Ansible server, and also I can confirm that AllowTcpForwarding is available, however, when I attempt to SSH to the Linux - Ansible server I am getting the below error - I am able to ping the Linux - Ansible server from a cmd line on the W2022 windows server.

[13:27:41.628] Log Level: 2  
[13:27:41.700] SSH Resolver called for “ssh-remote+10.108.0.8”, attempt 1  
[13:27:41.703] “remote.SSH.useLocalServer”: false  
[13:27:41.703] “remote.SSH.useExecServer”: true  
[13:27:41.716] “remote.SSH.showLoginTerminal”: false  
[13:27:41.716] “remote.SSH.remotePlatform”: {}  
[13:27:41.716] “remote.SSH.path”: undefined  
[13:27:41.716] “remote.SSH.configFile”: undefined  
[13:27:41.716] “remote.SSH.useFlock”: true  
[13:27:41.716] “remote.SSH.lockfilesInTmp”: false  
[13:27:41.717] “remote.SSH.localServerDownload”: auto  
[13:27:41.717] “remote.SSH.remoteServerListenOnSocket”: false  
[13:27:41.717] “remote.SSH.showLoginTerminal”: false  
[13:27:41.717] “remote.SSH.defaultExtensions”:   
[13:27:41.717] “remote.SSH.loglevel”: 2  
[13:27:41.718] “remote.SSH.enableDynamicForwarding”: true  
[13:27:41.718] “remote.SSH.enableRemoteCommand”: false  
[13:27:41.718] “remote.SSH.serverPickPortsFromRange”: {}  
[13:27:41.718] “remote.SSH.serverInstallPath”: {}  
[13:27:42.060] VS Code version: 1.89.1  
[13:27:42.060] Remote-SSH version: remote-ssh@0.110.1  
[13:27:42.060] win32 x64  
[13:27:42.164] SSH Resolver called for host: 10.108.0.8  
[13:27:42.165] Setting up SSH remote “10.108.0.8”  
[13:27:42.186] Using commit id “dc96b837cf6bb4af9cd736aa3af08cf8279f7685” and quality “stable” for server  
[13:27:42.195] Install and start server if needed  
[13:27:48.285] Checking ssh with “C:\Windows\system32\ssh.exe -V”  
[13:27:48.290] Got error from ssh: spawn C:\Windows\system32\ssh.exe ENOENT  
[13:27:48.290] Checking ssh with “C:\Windows\ssh.exe -V”  
[13:27:48.291] Got error from ssh: spawn C:\Windows\ssh.exe ENOENT  
[13:27:48.292] Checking ssh with “C:\Windows\System32\Wbem\ssh.exe -V”  
[13:27:48.293] Got error from ssh: spawn C:\Windows\System32\Wbem\ssh.exe ENOENT  
[13:27:48.293] Checking ssh with “C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe -V”  
[13:27:48.295] Got error from ssh: spawn C:\Windows\System32\WindowsPowerShell\v1.0\ssh.exe ENOENT  
[13:27:48.295] Checking ssh with “C:\Windows\System32\OpenSSH\ssh.exe -V”  
[13:27:48.390] \> OpenSSH\_for\_Windows\_8.1p1, LibreSSL 3.0.2

[13:27:48.398] Running script with connection command: “C:\Windows\System32\OpenSSH\ssh.exe” -T -D 49856 “10.108.0.8” bash  
[13:27:48.403] Terminal shell path: C:\Windows\System32\cmd.exe  
[13:28:05.405] Resolver error: Error: Connecting with SSH timed out  
at g.Timeout (c:\Users\prfadmin.vscode\extensions\ms-vscode-remote.remote-ssh-0.110.1\out\extension.js:2:499307)  
at Timeout.\_onTimeout (c:\Users\prfadmin.vscode\extensions\ms-vscode-remote.remote-ssh-0.110.1\out\extension.js:2:618713)  
at listOnTimeout (node:internal/timers:569:17)  
at process.processTimers (node:internal/timers:512:7)  
[13:28:05.495] ------

[13:28:06.307] Opening exec server for ssh-remote+10.108.0.8  
[13:28:06.653] Initizing new exec server for ssh-remote+10.108.0.8  
[13:28:06.660] Using commit id “dc96b837cf6bb4af9cd736aa3af08cf8279f7685” and quality “stable” for server  
[13:28:06.667] Install and start server if needed  
[13:28:09.858] \> ssh: connect to host 10.108.0.8 port 22: Connection timed out

> e]0;C:\Windows\System32\cmd.exeaThe process tried to write to a nonexistent pipe.  
> [13:28:09.859] Got some output, clearing connection timeout  
> [13:28:11.127] “install” terminal command done  
> [13:28:11.128] Install terminal quit with output: ssh: connect to host 10.108.0.8 port 22: Connection timed out  
> [13:30:59.174] getPlatformForHost was canceled  
> [13:30:59.177] Exec server for ssh-remote+10.108.0.8 failed: Error: Connecting was canceled  
> [13:30:59.179] Error opening exec server for ssh-remote+10.108.0.8: Error: Connecting was canceled

I wondered if you both might have some clue of what is wrong.

Regards.

[Next page](https://forum.ansible.com/t/playbook-editor/5902.md?page=2)
