Skip to content
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

Make ansible role consumable from requirements.yml #4

Open
mweinelt opened this issue Apr 19, 2024 · 7 comments
Open

Make ansible role consumable from requirements.yml #4

mweinelt opened this issue Apr 19, 2024 · 7 comments

Comments

@mweinelt
Copy link

I'm wondering what the intended way to make use of the playbooks is. Generally we would reference the git repository in our requirements.yml, but the current directory structure seems unsuitable for that.

https://docs.ansible.com/ansible/latest/galaxy/user_guide.html#installing-multiple-roles-from-a-file

This is how I would expect to use it:

roles:
  - name: lxc.incus
    src: https://github.com/lxc/incus-deploy
    scm: git

And this is how it currently fails.

$ ansible-galaxy install -r requirements.yml
[...]
[WARNING]: - lxc.incus was NOT installed successfully: this role does not appear to have a meta/main.yml file.

For one, I think the ansible directory is not something that can be referenced from a requirements.yml, but also the role is missing a meta/main.yaml, likely with a galaxy_info dict.

https://docs.ansible.com/ansible/latest/galaxy/user_guide.html#using-meta-main-yml

WDYT?

@mweinelt mweinelt changed the title Ansible compatible directory structure for Ansible compatible directory structure Apr 19, 2024
@mweinelt mweinelt changed the title Ansible compatible directory structure Make ansible role consumable from requirements.yml Apr 19, 2024
@stgraber
Copy link
Member

Currently our repository isn't setup to expose actual Ansible roles, that's something that we'll want to work on but will require a bunch more restructuring and fixes on our side.

Hopefully we can find someone who's more familiar with creating properly consumable Ansible roles who can help put that together while also not regressing the simple case of just deploy Incus/OVN/Ceph in one shot through this.

@mttjohnson
Copy link

We can keep everything in the same repo and utilize roles without using ansible-galaxy and having roles maintained in a separate repo. We can just create a roles directory and just reference them. All ansible-galaxy does is operate as a package manager of sorts to go fetch roles from other places and bring them into the roles directory for us. This would help keep things simple for now until there is a need for wanting to package the ansible role into a separate distributable role for others to consume and bring into their own custom playbooks.

Based on how each playbooks is broken out into multiple plays, I expect most of the hard work or organizing things is already done, and the roles could probably be defined similarly.

  • ansible
    • roles
      • incus_repo
      • incus
      • ceph_prep
      • ceph_repo
      • ceph
      • ceph_config
      • ceph_deploy_mon
      • ceph_deploy_osd
      • ceph_deploy_mgr
      • ceph_deploy_mds
      • ceph_deploy_rgw
      • ceph_deploy_rdb_mirror
      • ovn_gen_certs
      • ovn_repo
      • ovn
      • ovn_config

I could re-organize things into roles as a pull request, but I'm hesitant to re-arrange things until I'm able to test it myself, and I'm waiting on some new equipment to come in next week which I'm expecting will allow me to test all this.

@stgraber
Copy link
Member

Yeah, we definitely want to avoid causing regressions at this stage :)

I'll be traveling next week so won't be able to easily test pull requests coming in, so no rush, we can make some progress on this stuff once you can run it for yourself!

@mkbrechtel
Copy link
Contributor

I am also willing to help with the refactoring. We can also provide some infrastructure to test.

@stgraber
Copy link
Member

I need to do some cleanup on my Github self-hosted test runners but once that's done I should be able to have this repo be able to grab some pretty sizable test runners (64GB of RAM and 8 vCPU or something like that) which would then allow for a normal Github Action workflow to run both the Terraform and Ansible parts of this.

@panfantastic
Copy link

I am interested in the refactor and can help contribute. I can also offer some decently sized VMs for running test runners.

@mkbrechtel
Copy link
Contributor

I started working on the refactoring, see #7

https://github.com/mkbrechtel/incus-deploy/tree/refactoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants