Ansible development environment
Asked Answered
E

6

7

Currently I'm developing ansible orchestration system. The project structure is something like this:

site.yml webservers.yml fooservers.yml roles/ common/ files/ templates/ tasks/ handlers/ vars/ defaults/ meta/ webservers/ files/ templates/ tasks/ handlers/ vars/ defaults/ meta/

As a result I have to deal with dozens of play-books, roles, subdirectories, tasks, variable files, so on. For now, I use WinSCP as a kind of IDE (I work from Windows dev machine) This solution is far from being perfect but allow me easy navigation among files and folders. In fact I miss Visual Studio (intellisense!) very much. I tried Eclipse installed on my dev machine before but it was too slow. I found shell tools rather uncomfortable. Due to corporate constraints I can not add any more VM-s.

So, my question is: are there any Windows (or lightweight Ubuntu GUI) tools to deal with complicated structure of files and folders for Linux development?

Echidna answered 30/7, 2015 at 20:14 Comment(0)
W
6

JetBrains-based IDEs have a YAML/Ansible plugin to add some context and syntax highlighting to Ansible playbook structure.

Sublime has a plugin to add syntax highlighting to Ansible files https://github.com/clifford-github/sublime-ansible

Both tools can display folder structure and connect using sftp/ssh to remote servers.

Wormeaten answered 31/7, 2015 at 1:53 Comment(0)
B
3

Vim is not considered an IDE by all, but I (work on and) use Rocannon for Ansible every day for its auto-completion, syntax highlighting, built-in help and other IDE-like features.

Vim is not a very quick learn, but it is light. :)

There's a GIF demo on the Rocannon github page to give you a feel for what it offers.

Briseno answered 30/7, 2015 at 20:59 Comment(0)
G
3

Here is the official list of IDE's or editors: https://docs.ansible.com/ansible/latest/community/other_tools_and_programs.html#popular-editors

Currently it seems your best option is Visual Studio Code since it has auto-completion and syntax highlighting specifically for Ansible.

Glenglencoe answered 31/8, 2020 at 22:56 Comment(0)
R
2

I wrote a plugin for IntelliJ-based IDEs that help working with ansible files. it auto-complete all fields and can detect roles and suggest them.

https://plugins.jetbrains.com/plugin/14893-ansible

Rika answered 3/11, 2020 at 19:47 Comment(0)
M
1

Ansible SHOULD have an IDE that validates both the YAML lint and the syntactical errors of ansible itself (version dependent). It is such a waste of time to have to run and debug and run into things over and over, the latest example being this: "msg": "unsupported parameter for module: register"}

When all you do is:

- name: gather rds instance facts
  rds:
    command: facts
    instance_name: "{{ wp_db_instance }}"
    register: database_facts

vs:

- name: gather rds instance facts
  rds:
    command: facts
    instance_name: "{{ wp_db_instance }}"
  register: database_facts

Notice the indentation. Which is why YAML is a pain.

Margaretemargaretha answered 14/5, 2016 at 6:34 Comment(0)
U
0

Netbeans understands yaml but does not have support for Ansible Playbook or even generic projects. So I create a PHP project from exising sources and point that at my ansible playbook.

  • PLUS I do all my coding apart from python in Netbeans
  • PLUS yaml syntax highlighting helps a lot
  • PLUS git integration ('cos you do keep your playbook in a scm)

  • MINUS no ansible awareness at all eg help with finding variable declarations

Unquestionable answered 10/11, 2016 at 15:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.