-
-
Notifications
You must be signed in to change notification settings - Fork 45
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
Migrate to dokku
collection
#148
Comments
See the migration guide. I currently don't have time to work in this - help welcome! |
Hey @ltalirz, |
Hi @tbho , thanks a lot for this contribution, this is very welcome. One open question is which name the new collection should have. Perhaps instead of It also appears that there is currently no practical way of alerting current users of the role about the existence of the collection. For that reason, geerlingguy is still holding off with the transition to collections. ansible/galaxy#2253 (comment) I personally suspect that most users of our role have visited the Github page before, and would eventually come back here to check. @josegonzalez Do you have any thoughts on this topic? And @tbho: Just to make sure we're solving your problem, I'd be interested to understand what prohibits you from going down route [1]. In my personal daily use, I always had the [1] Although, in practice, you can easily achieve this with tags already with today's role. |
I am not that deep into ansible, so didn't know about the double name problem yet. But
Is there some sort of deprecation notice we can add to the role? Then we could set up the collection in parallel and disable the role after some time to give time for migration of the users playbooks.
Did not know about tags. How did you tag the playbooks so only the app provisioning parts are run? How we use dokku and the ansible-dokku package @ finstreet right now:
We can define multiple apps for a server, which are provisioned to that specific host then. We then define one server as a group and can limit the provisioning to that server. We are even thinking of a provisioning limitation of multiple apps which belong to a customer. It's a pretty crazy setup to be honest. Right now we manage about 60-80 dokku apps on about 10-15 servers (can get the exact numbers if you want to know 😉). We adapted this to not have to copy the dokku_app definitions for every app and so on. I think there are ways to do it more pretty, but that's what go us going in the first place. It's some sort of work in progress, as we are constantly updating our roles and stuff. I hope you can understand what I am saying and what I mean. 😂
|
See e.g. https://github.com/ltalirz/ansible-playbook-dokku/blob/master/playbook.yml This reminds me that we have a blog post "almost ready" that goes through the steps of how to use the role to set up you dokku instance dokku/dokku.github.io#7 Perhaps I'll manage to get it done one of these days. |
Ah, see the solution. |
@ltalirz I have no preference either way. |
I'm not quite sure how we should proceed. Tried to get the collection to work, including the dokku installation role. As of now, I tried to separate the two parts. The collection for the configuration of dokku and the role to install dokku onto a host. In my mind, a clean solution would be the separation. What do you think about the topic @josegonzalez @ltalirz? |
Thanks for this work @tbho ! |
@ltalirz Yes of course I can provide some explanation. But in my mind we need to open a new repository where the collection can reside as the old tasks and the new collections have a different repository structure. The created PR does reflect the collection repository as it should look like. If you like we can have a short meeting where I can give you some further information. |
@tbho if possible, keeping the history of the repository alive makes sense to me. Looking at the proposed directory layout, I seem to be missing the If you prefer a chat over Github comments, we can arrange a short meeting late this evening. Feel free to contact me via any of the methods on https://ltalirz.github.io/ |
It's possible to integrate the roles "back" into the collection. But somehow the molecule throws some weird errors. I will prepare the commit and give some explanation so you can review the PR. |
Thanks! |
Okay, remembered why I thought it might be an idea to split up installation and configuration parts. If I'm understanding the ansible documentation the right way, collections should only be dependent on other collections (https://docs.ansible.com/ansible/latest/dev_guide/developing_collections_shared.html#listing-collection-dependencies and https://docs.ansible.com/ansible/latest/dev_guide/collections_galaxy_meta.html#collections-galaxy-meta). Including the role into the collection works though (tested this on my own server), but I'm not quite sure how to specify |
Oh, I see. Thanks for alerting me to this, unfortunately I was not aware. This is indeed quite worrying. Both the recommendation not to have dependencies at all (seriously?), and the decision to support only collection-collection dependencies seem quite unfriendly to existing developers. If we want to proceed along the recommended path, we would need to drop the dependency on the I understand your confusion as to how to proceed, at this point it is not clear to me either - my apologies. I'd still be happy to have a chat some time concerning your particular use case, and why the current role cannot support it in a practical way. [1] Both roles have permissive licenses ( |
Yeah, I see the same problems. I was perplexed as I found the documentation.
With this, I came up with the idea to isolate the plugins into an own collection and develop them separately from the installation role (which can further exist as a role and therefore can profit from the dependency). Users then could use something like this:
If I'm correct, the users only would need to prepend the correct collection name in front of the configuration tasks. Bonus points: There could be a time horizon with both the role and the collection coexisting to give users the chance to migrate to the collection. Duplication of the roles is a no-go in my eyes.
I'm also fine with putting the PR to a break. The -tags option can be a suitable solution, but we would need to change a lot of our playbooks and structures, I think. The collection solution would be more suitable to my company. |
Thanks for your understanding! I think your suggestion can be a path forward if no better solution is found in the coming months. Currently, your proposal would still be a degradation of the user experience, since (correct me if I'm wrong) there is no way to specify that It is true that the fix for users is rather simple (just install the collection alongside the role), but it still feels wrong to put extra burden on the user for a role that should work out of the box. Let's wait a little bit for some positive signals from the ansible universe |
Ok, no problem. |
Can we use tags to disable running the role and only have access to the modules? |
In order to get access to the modules without running the role, you can use this trick: ansible-dokku/molecule/default/verify.yml Lines 6 to 9 in b376657
|
The
ansible-dokku
role bundles a number of ansible modules in thelibraries
folder - e.g. thedokku_app
module.Sometimes, it is useful to run these modules in isolation, without running the entire role. While this can currently be achieved via a hack, it would seem better to migrate
ansible-dokku
to adokku
ansible collection, which would, once installed, make the modules available viaThe text was updated successfully, but these errors were encountered: