Skip to content

testinfra with ansible : capacity to exclude groups ? #541

@mneveu-mx

Description

@mneveu-mx

Hello,

I use pytest/testinfra with ansible module for unitary tests on my linux nodes.
The command I use is like :
/usr/local/bin/pytest [... options ...] **--hosts=ansible://group1,ansible://group2**
For example, group2 can be a subelement of group1.

My problem : I want to execute some tests on group 1 hosts but without the hosts of group 2..
Is there a way to exclude group2 with a specific syntax ?

Note : with Ansible, there is a syntax to exclude a group from a playbook, for example :
hosts: group1 !group2
So maybe it can be the same with testinfra.

Thank you by advance,
Maxime

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementThis issue/PR relates to a feature request.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions