On 27.08.2019 20:17, Gilson Soares [GM] wrote:
> I'm new using Ansible but I'd like to start using best practices.
IMHO it's no best practice to fit all, it all comes down to what's best for you.
> I know that Ansible uses YAML syntax files, not "Ansible format".
Well, that's not entirely correct, Ansible has two type of syntax YAML and key
value.
Recommendation is to use YAML, but I use them both because key value is faster
to write for short debug tasks.
This key value is faster to write
- debug: var=myvar
than this YAML
- debug:
var: myvar
> Looking thru the docs, there are several documents using interchangeably
> YML and YAML.
>
> For example: using ansible_playbook , *must* include the
> extension.
Most if not all Linux/Unix programs and that includes Ansible don't care about
the file extension.
So you can call them whatever you like, officially I think the YAML people
recommend .yaml as the extension.
> What about some editors which colorizing the syntax.
> Which extension it expects to have to properly identify the file ?
It depends on you editor I guess.
I'm using vim with this plugin[1] and configure it for .yml files that I use
for Ansible, and for clean YAML files, aka not Ansible files, get the default
vim YAML syntax setting.
[1] https://github.com/pearofducks/ansible-vim
--
Kai Stian Olstad
--
You received this message because you are subscribed to the Google Groups
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/ansible-project/cdeb12c6-5b2d-a67a-0596-3b821a63f4a2%40olstad.com.