Ansible工具概述

1。目的


目的是编译一个完整的工具列表,以使在三个流行的编辑器中轻松编写Ansible配置/代码变得容易:VS Code,Atom,JetBrains PyCharm(在这种情况下,更容易将此IDE视为编辑器)。我所说的工具是:lint,格式化程序(讲英语的人!),语法突出显示,自动完成。将考虑工具开发中的当前活动,并提出我的主观评估判断,即“理想”工具中应包含的内容。我只使用了其中一种审核工具,因此该审核不会是我对用户的主观评估,而只是我在公共领域可以找到的内容。


2.评估标准


有一个或多或少的标准清单:


  • 在市场上评级。每个编辑器都有自己的扩展程序/插件“市场”,可以在其中留下反馈。
  • 下载次数。信息来自市场。
  • Github上的星星数。
  • 代码行数。使用cloc实用程序程序的输出将部分显示,以免增加文章的大小。贡献少于5%的语言将被删除。
  • 上次提交的日期。
  • 已实现的功能取自README。

3.概述


3.1现有评论


3.1.1搜索


让我们看看俄语和英语已有哪些评论,以免重复两次相同的信息。搜索是在Google中进行的。根据我在俄语部分中搜索的单词:


  • Ansible Tools评论→0相关结果。
  • 查看ansible ide→0相关结果
  • 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