Hello Maciej,
On 2019-05-31 3:08 p.m., Maciej Delmanowski wrote:
How is the experience so far? Do you use the stable release, or stick
to the
master branch?
Fine. I use both. I'm testing DebOps with Vagrantfile from GitHub repo
and I use stable branch to run on production servers.
I know that there is still lots of documentation not related to
specific Ansible roles missing, and the current "skeleton" of it in the docs/
directory doesn't sound promising but I hope it will be expanded at some
point. Perhaps I need to devote a bit more time to it, but that takes me away
from fixing old roles and writing new ones...
I understand, I will try to give you my help.
Yes, I'd like to improve the role testing in the Gitlab CI
pipeline by adding
a testinfra checks to each tested role. I'm wondering if these tests could be
generalized so that thestinfra can be applied to an actual set of hosts
deployed somewhere, in which case I would probably make a new 'testinfra/'
directory in the root of the DebOps monorepo and work on tests there.
According to Testinfra's docs [0], it looks like it's possible to test
multiple hosts. Moreover, there is an Ansible backend [1] able to get
informations from inventory.
Buf if that's not feasible or useful, I suppose that a
'tests/' subdirectory in each
role directory could be used instead, but that could be complex if later on in
the pipeline multiple roles would have to be tested together. Something to
think about, I suppose.
Did you consider other tools for testing Ansible roles ? From my point
of view, InSpec is an interesting tool with an important set of
resources [3]. I saw that Robin is part of dev-sec.io organization on
GitHub, I'm sure he has an opinon on it :-)
[0]
https://testinfra.readthedocs.io/en/latest/invocation.html#test-multiples...
[1]
https://testinfra.readthedocs.io/en/latest/backends.html#ansible
[2]
https://github.com/inspec/inspec
[3]
https://www.inspec.io/docs/reference/resources/
--
Nicolas Quiniou-Briand
Jabber/XMPP : nqb(a)azyx.fr