apenella / go-ansible

Go-ansible is a Go package that enables the execution of ansible-playbook or ansible commands directly from Golang applications. It supports a wide range of options for each command, enabling smooth integration of Ansible functionality into your projects.
MIT License
905 stars 143 forks source link

[Question] Can we use alias for inventory? #129

Closed jasonlaw closed 1 year ago

jasonlaw commented 1 year ago

If yes, any example reference?

apenella commented 1 year ago

Hi @jasonlaw! Thanks for your question.

If Ansible supports the alias, you can use them through go-ansible.

Behind the scenes, the library uses the ansible or ansible-playbook commands you have installed on your machine. therefore, any Ansible project you run through go-ansible should work as it was executed directly using the Ansible commands.

In case the aliases do not work, please provide me with some examples to reproduce the error and I will work on it.

Thanks!

jasonlaw commented 1 year ago

Hi @apenella, Looks like the Ansible does not support for alias without the inventory file. Anyway, I have tried different approach and it works work for my case. Thank you for this great package! :)

apenella commented 1 year ago

Hi @jasonlaw! It is good to know that you already have found a way to solve your case :smile: If you need anything else feel free to let me know. Thanks!