-
Notifications
You must be signed in to change notification settings - Fork 144
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implementing support for go-embed-python
#133
Comments
fyi, I assume go-ansible might also be interested in https://github.com/kluctl/go-jinja2, which uses the mentioned library to embed Jinja2 as well. The API is far from perfect, but I'm happy to accepts PRs in that regard. |
Hi, @mnaser! It seems your idea is to develop an application that embeds both Python and the Ansible playbook, inventory file, etc., needed for execution in a single binary, isn't it? As I delved into understanding go-embed-python, I also explored go-jinja2. While I don't see the need to include this as a feature in the go-ansible library, I aim to keep the library focused on executing Ansible commands. If feasible, I'd be keen to develop an example showcasing both libraries working together. It could be interesting for many and open up numerous possibilities. Thank you both! |
@apenella That sounds like something that should work. I also just realised that I misunderstood this project...my understanding was that it tries to re-implement Ansible in Go and thus needs Jinja2 support. Now I understand that go-ansible is a wrapper library around the original Ansible, in which case what you describe is the way to go. |
@codablock, thank you very much for your confirmation! @mnaser Knowing that, do you feel your doubt has been resolved? |
Hello there, this issue prompted me to create a CLI side project that leverages the "embed ansible" idea. TL;DR: I attempted to replicate the folder structure exactly as in https://github.com/kluctl/go-jinja2, and it worked. However, I encountered a problem with the binary size. For the ansible package, the generated Python modules resulted in a substantial 1.7GB of files (all platform) and yield a 351MB binary file (seems that it only embed modules for the current build platform). To address this size issue, I opted for I haven't delved too deeply into this yet, as it's my first Golang project, and I only started it an hour ago. Please note that my testing has been limited to I hope this clarifies the "what if" scenario for other people seeing this issue. I'll provide more information if any issues arise. While I'm unsure if this falls within the scope of this golang library and issue, perhaps the information above can be useful. |
Hi @ditwrd! Have you published that project publicly? |
Yes @apenella, it's public and you can check it here The project is practically still a barebone (weekend only fun little project you might say), I just merge my PR for the embed Ansible POC (kudos @codablock for the go-jinja2 project), just run the
I guess the next thing I should do is to see if it is possible to trigger the embed ansible via go-ansible, I've never used go-ansible before, maybe I'll learn something along the way |
@mnaser @ditwrd @codablock |
An example is available in https://github.com/apenella/go-ansible/releases/tag/v2.0.0 |
Do you think there's an easy way to be able to use this project in combination with https://github.com/kluctl/go-embed-python which would help us make a fully independent golang binary? :)
The text was updated successfully, but these errors were encountered: