MicahElliott / Rocannon

Vim for Ansible playbooks: omni-completion, abbreviations, syntax, folding, K-docs, and colorscheme
83 stars 14 forks source link

Support normal YAML syntax for tasks #4

Open ypid opened 7 years ago

ypid commented 7 years ago

First of all, thanks very much for the plugin, great stuff :+1:

The "inline" format advocated by Ansible in the paste is now basically deprecated (ref: https://www.ansible.com/blog/ansible-best-practices-essentials 3. Use Native YAML Syntax). Official docs should also be mostly up-to-date by now.

It seems that Rocannon does not support the regular YAML syntax for tasks omni-completion?

Example:

- name: configure telegraf
  template:
    src: telegraf.conf.j2
    dest: /etc/telegraf/telegraf.conf
  notify: restart telegraf
MicahElliott commented 7 years ago

Hey, thanks Robin.

I wasn't aware that they are discouraging the inline syntax. That's a shame. I'd be pretty surprised if they actually tried to deprecate it, though. In one of my ansible projects with ~300 tasks, the average one-line module-task length is ~60 chars. I actually really like to see source code files stay within 70-80 chars, but playbooks are exceptions. It would be awful to put every one of these onto 3 or more lines. So I won't personally be adopting the multi-line syntax unless forced.

With that rant out of the way, I did actually want to support multi-line, but didn't get to it. It'd be significantly harder than the single line syntax. I'd suggest the secondary indented keys to be colored different than the module.

I'm not going to work on adding support for this (syntax highlighting and completion), but it would be great if someone wants to give it a shot.

CedricLevasseur commented 5 months ago

Oh no. I realize this plugin is obsolete. Why did i installed it ?