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.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] Can we use alias for inventory?

jasonlaw opened this issue · comments

If yes, any example reference?

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!

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! :)

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