go-ansible icon indicating copy to clipboard operation
go-ansible copied to clipboard

tool like pytest infra

Open keith6014 opened this issue 1 year ago • 2 comments

I was wondering if its possible to have a tool similar to https://testinfra.readthedocs.io/en/latest/ with this library? At the moment I am using it with python but would love to rewrite with golang.

keith6014 avatar Sep 01 '24 14:09 keith6014

hi @keith6014! It sounds like a great initiative!

You can execute Ansible commands using the go-ansible library. Here are a couple of examples where I used the library to run Ansible commands from a Go application:

  • This example uses version v1.2 of the library: https://github.com/gostevedore/stevedore/tree/main/internal/infrastructure/driver/ansible
  • This second example uses version v2.0, and I encourage you to use this version rather than v1: https://github.com/apenella/ransidble/blob/main/internal/infrastructure/executor/ansible-playbook

I hope these examples inspire you and help you understand how to use the library.

apenella avatar Sep 06 '24 22:09 apenella

Hi @keith6014! Did these examples inspire you on how to implement the testing tool?

apenella avatar Oct 08 '24 05:10 apenella

@keith6014 I close this issue. If you need further help, please open a new issue or reopen this one.

apenella avatar Oct 28 '24 06:10 apenella