Ansible Tools Overview

1. Purpose


The goal is to compile a complete list of tools that make it easy to write Ansible configuration / code in three popular editors: VS Code, Atom, JetBrains PyCharm (in this case it is easier to consider this IDE as an editor). By tools I mean: linter, formatters (speaker English!), Syntax highlighting, auto-completion. The current activity in the development of tools will be considered and my subjective-evaluative judgment what should be in the "ideal" tool will be proposed. I used only one of the tools reviewed, so the review will not be my subjective assessment by the user, only what I could find in the public domain.


2. Evaluation Criteria


There is a more or less standard list:


  • Rating on the marketplace. Each of the editors has its own "marketplace" for extensions / plugins, where it is possible to leave feedback.
  • Number of downloads. Information is taken from the marketplace.
  • The number of stars on Github.
  • The number of lines of code. The cloc utility was used . The output of the program will be partially displayed, so as not to inflate the size of the article. Languages ​​whose contribution is less than 5% will be removed.
  • Date of the last commit.
  • Implemented functions taken from README.

3. Overview


3.1 Existing Reviews


3.1.1 Search


Let's see what reviews are already in Russian and English, so as not to repeat the same information twice. Search was conducted in Google. According to what words I searched in the Russian segment:


  • Ansible Tools Review → 0 relevant results.
  • review ansible ide → 0 relevant results.
  • ansible → 0 .

Ansible , - .


:


  • ansible tools → 1 .
  • review ansible ide → 1 .

.


3.1.1 Ansible other tools and programs


Ansible. 95% Ansible, YAML Jinja2.


3.1.2 The best IDE for Ansible


. , Ansible. , .


3.2 VS Code


3.2.1


VS Code, . "ansible", (13 ), .


3.2.2 Ansible


:


  • 3.4 5 (12 ).
  • 224 950.
  • Github — 54.
  • 21.08.2019. 2 .

README:


  • Auto completion. Auto completion Ansible directives, modules and plugins from Ansible doc, Auto completion for variables. Disable auto completion by setting ansible.autocompletion to false.
  • Code snippets. Press Ctrl + Space, Ansible playbook code snippets will show up.
  • Syntax highlighting. Enable syntax highlighting by setting files.associations to ansible in settings.json.
  • Yaml validation. Yaml validation by leverage Yaml language server.
  • Code navigation by Symbols, press Ctrl + Shift + O.
  • Hover over module names, to show module documentation. Disable hovering over by setting ansible.hover to false.
  • Run playbook from Docker.
  • Run playbook from local Ansible installation.
  • Run playbook from Cloud Shell.
  • Run playbook remotely via ssh.
  • Auto File Copy to remote host on saving.

cloc:


63 text files.
63 unique files.
 6 files ignored.
-------------------------------------------------------------------
Language         files          blank        comment           code
-------------------------------------------------------------------
JSON                14              0              0         451226
TypeScript          33            669             80           2943
Markdown             6             79              0            249
-------------------------------------------------------------------
SUM:                58            767             81         454543
-------------------------------------------------------------------

, PR issue , .


3.2.3 language-Ansible


:


  • 4.2 5 (6 ).
  • 92 212.
  • Github — 10.
  • 15.01.2018.

( , README:


  • Jinja language
  • Jinja expressions for ansible conditions (when, changed_when, failed_when, check_mode)
  • Some YAML block scalar

, 6 .


cloc:


10 text files.
10 unique files.
 4 files ignored.
-------------------------------------------------------------------
Language         files          blank        comment           code
-------------------------------------------------------------------
YAML                 1             16              6            132
JSON                 3              0              0             95
Markdown             3             13              0             60
-------------------------------------------------------------------
SUM:                 7             29              6            287
-------------------------------------------------------------------

3.2.4 ansible-autocomplete


:


  • 5 5 (2 ).
  • 62 185.
  • Github — 2.
  • 20.11.2017.

README . Atom, .


cloc:


17 text files.
17 unique files.
 5 files ignored.
-------------------------------------------------------------------
Language         files          blank        comment           code
-------------------------------------------------------------------
JSON                 7              7              0         148305
TypeScript           4             44              5            199
Python               2             28              2            132
Markdown             1              2              0              3
-------------------------------------------------------------------
SUM:                14             81              7         148639
-------------------------------------------------------------------

3.3 Atom


3.3.1


. "ansible" , . , 11 . , VS Code.


3.3.2 linter-ansible-linting


:


  • ( Github) — 51.
  • 60 823.
  • Github — 18.
  • 22.04.2020. .

README:


  • Linter-Ansible-Linting aims to provide functional and robust Ansible-Lint linting functionality within Atom.

cloc:


20 text files.
20 unique files.
 3 files ignored.
-------------------------------------------------------------------
Language         files          blank        comment           code
-------------------------------------------------------------------
JavaScript           3             46             28            565
Markdown             3             23              0             96
YAML                11             28             14             90
JSON                 1              0              0             49
-------------------------------------------------------------------
SUM:                18             97             42            800
-------------------------------------------------------------------

3.3.3 linter-ansible-syntax


:


  • ( Github) — 25.
  • 24 819.
  • Github — 4.
  • 22.04.2020. .

README:


  • Linter-Ansible-Syntax aims to provide functional and robust Ansible syntax check linting functionality within Atom.

cloc:


19 text files.
19 unique files.
5  files ignored.
-------------------------------------------------------------------
Language         files          blank        comment           code
-------------------------------------------------------------------
JavaScript           3             34             18            315
Markdown             3             17              0             64
YAML                 8             12             10             56
JSON                 1              0              0             48
-------------------------------------------------------------------
SUM:                15             63             28            483
-------------------------------------------------------------------

3.4 PyCharm



IDE JetBrains, . "ansible" 1 .


3.4.2 YAML/Ansible support


:


  • 3.7 5.0 (9 ).
  • 464 115.
  • Github — 191.
  • 01.06.2017.

README:


  • Goto role (Ctrl-N)
  • Goto task (Ctrl-N)
  • Goto var/property (Ctrl-Alt-Shift-N)
  • Role/Jinja var reference on Ctrl-Click
  • Module doc lookup
  • lexer, parser (internal)
  • syntax highlighting
  • comment/uncomment
  • bracket / parenthesis matching
  • role completion

cloc:


147 text files.
146 unique files.
 42 files ignored.
-------------------------------------------------------------------
Language         files          blank        comment           code
-------------------------------------------------------------------
YAML                28           1045            232           7276
Java                68            686            464           3344
Bourne Shell         1             21             22            129
-------------------------------------------------------------------
SUM:               107           1806            726          10970
-------------------------------------------------------------------

YAML , 1 fork Ansible , cloc. , Java.


4.


VS Code PyCharm . ansible-lint, ansible-playbook --syntax-check, yamllint. YAML, Ansible, . , ( Docker ), ( , YAML, ).


CI, . deprecation warnings . Atom Ansible.


, Ansible Atom. , , .


. 2-3 , Ansible 8 , . , , Ansible .


All Articles