format of the /etc/ansible/hosts file

24 views
Skip to first unread message

eric.b....@nasa.gov

unread,
Apr 17, 2019, 8:07:10 AM4/17/19
to Ansible Project
This is probably an FAQ, and I apologize, but I can't find this explicitly written anywhere.

In my /etc/ansible/hosts file, I have a few hosts that are not in any group, followed by a bunch of groups with hosts

hostA
hostB

hostC

hostD

[group1]
host1
host2
host3

I want to verify that these three statements are correct:

All "ungrouped" hosts must appear in the file before the first group label.

Once I have defined a group label, all following hosts are in that group, until EOF or the next group label.

Blank lines in between hosts do not end a group section.

Thanks.

--EbH

lander.herna...@gmail.com

unread,
Apr 17, 2019, 8:10:35 AM4/17/19
to Ansible Project
the suppository is placed on the flat part

Kai Stian Olstad

unread,
Apr 17, 2019, 9:47:48 AM4/17/19
to ansible...@googlegroups.com
On 17.04.2019 14:07, eric.b.hymowitz via Ansible Project wrote:
> I want to verify that these three statements are correct:
>
> All "ungrouped" hosts must appear in the file before the first group label.
>
> Once I have defined a group label, all following hosts are in that group,
> until EOF or the next group label.
>
> Blank lines in between hosts do not end a group section.

All three of them are correct.

--
Kai Stian Olstad

eric.b....@nasa.gov

unread,
Apr 17, 2019, 3:07:40 PM4/17/19
to Ansible Project
Thanks.

--EbH

Brian Coca

unread,
Apr 18, 2019, 11:53:43 AM4/18/19
to Ansible Project
'hosts file format' is not a single thing, we have several ones to
choose from, by default 'ini-ish', yaml and toml, it is plugin based
so you can basically use any format you want as long as there is a
plugin for it.

--
----------
Brian Coca
Reply all
Reply to author
Forward
0 new messages