-
Notifications
You must be signed in to change notification settings - Fork 46
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 aur
module from legacy role to collection
#58
Conversation
Since you said you weren't familiar with collections, here are some links to Ansible's collections documentation: |
545bd3e
to
3882e6a
Compare
Great job, seems like this could eventually be merged into |
For the role on Ansible Galaxy, we will have to delete the It's a different story for the AUR package because the AUR package does not actually contain the However, in the long run, I recommend we deprecate that package and replace it with an As you'll notice after reading my changes to the README, after we migrate to a collection it will be required to use the module's FQCN in playbooks (both my changes to the README and the documentation I linked above explain what an FQCN is). But, when the In the PR, I updated the README with instructions to install and use the collection and completely removed the old installation instructions. When we decide how to move forward, I will fix the README. diff --git a/PKGBUILD b/PKGBUILD
index 2baef95..ee188a7 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -24,6 +24,6 @@ pkgver() {
package() {
cd "${_pkgname}"
- install -Dm644 README.md "$pkgdir/usr/share/doc/${_pkgname}/README.md"
- install -Dm644 library/aur.py "$pkgdir/usr/share/ansible/plugins/modules/aur.py"
+ install -Dm644 README.md "$pkgdir/usr/share/doc/${_pkgname}/README.md"
+ install -Dm644 plguins/modules/aur.py "$pkgdir/usr/share/ansible/plugins/modules/aur.py"
} |
3882e6a
to
d6c0e66
Compare
Great job, @gotmax23! Just say the word, and I'll add you as a comaintainer of the AUR package. Happy hacking, |
This is a Github Actions workflow that pushes the collection to Ansible Galaxy when a Github release is created.
For certain use cases, the `aur_builder` requires a home directory. Fixes kewlfft#59
da4bb4e
to
ba04d0e
Compare
Fyi, I just rebased my branch and force pushed to fix an error in the |
Note: The module is installed in `/usr/share/ansible/plugins/modules` which is one of the default module library paths. | ||
|
||
### Manual installation | ||
Just clone the *ansible-aur* repository into your user custom-module directory: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is the manual installation in the user custom-module directory not supported any longer?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, it still works. However, when the aur
module is installed as a local custom module, its FQCN is ansible.legacy.aur
. It is not required to use this FQCN (you can use the short name aur
) in standalone roles and playbooks, but it is required in roles inside collections.
If you prefer to copy aur.py
into the user custom module directory for development instead of installing the collection itself (see this section of the new README), that works. For end users, I think it makes most sense to focus on one package (a collection) that is versioned and consistent. As I said, we could ship the same collection on both the AUR and on Ansible Galaxy. If you really want, I could add this back in along with the explanation above, but I worry that will confuse end users.
Please see my earlier comment where I also touch on this issue.
Thanks,
Maxwell
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The local development of modules as presented in ansible developing locally is not considered legacy from what I read and is a simple and popular solution. I see no reason not to present how it can still be simply installed without the galaxy's bells and whistles. Can you keep a description of a local installation in your commit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can add this local installation section if you are not available anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I apologize for not responding earlier; I've been busy. I should be able to work on this later today,
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added instructions to install the aur
module as a local custom module, as you asked. However, I don't recommend including this change. This change adds extra complexity and has the potential to confuse users, without any real benefit. Why can't we keep it simple and focus on one packaging method?
I also added a section about installing the collection through the ansible-collection-kewlfft-aur
package on the AUR. I already created a PKGBUILD for this new package. I will push it to the AUR as soon as you merge this PR and create a new release.
Please ignore the other reformatted table and other formatting changes. My markdown editor automatically formats markdown.
Hi @kewlfft is there any other blockers? I'm looking forward to use it with awx in my homelab 🙏🏼 |
Sure I’ll review within a few days |
@gotmax23 ready for release then. As is, it will release 1.0.0 as a collection and I will let GitHub operate. I have set my secret. Anything else? |
Yay!
Yes, you will have to delete the existing Also, we need to figure out what to do with the
2 is probably the best option. @panchoh and @kewlfft, what do you think? Thanks, |
I have deleted the previous |
Seems to me that upholding the full namespace thingy is the right way to go about this. You have my blessings if you decide to deprecate ye'ole |
I agree with @panchoh; I think it makes sense to focus on the collection. This is why I wanted to deprecate installing However, I found another problem after I thoguht about it more: the two different installation methods are not intercompatible. Here is an example scenario that explains this issue: Let's say user A installed the module in the local custom module directory and user B installed it through the Therefore, I recommend that you reconsider removing the instructions to install the module in the custom module directory from README. For the same reason, I now think we should go with option 3. I don't mean to be pushy; I just don't want my changes to cause problems! Thanks, |
Then we go with 3) and focus on the collection installation rather than 2 packages for such a small tool. Then Arch is about flexibility and simplicity, consistent with the wiki we present different ways and also simpler manual methods. |
See kewlfft/ansible-aur#58 for more info.
See kewlfft/ansible-aur#58 for more info. Signed-off-by: Maxwell G <[email protected]>
This pull request creates the necessary directory structure and metadata for an Ansible Galaxy collection. It provides necessary documentation for the new collection, as well.
I created a Github Actions workflow that will automatically push the collection to Ansible Galaxy when you create a Github Release. In order to use it, you will have to add your Galaxy API key in a Github secret named
GALAXY_API_KEY
. To release a new version of the collection, all you will need to do is update theversion:
tag ingalaxy.yml
(the collection metadata file) and create a Github release; Github Actions will handle the rest. Please note Ansible requires collections to use Semantic Versioning, which this repo does not currently use.Right now, the only thing that we need to address is maintaining compatibility for current users. I will follow up in a separate response about this.
Commits:
Fixes #57