Coder Social home page Coder Social logo

Comments (19)

gardar avatar gardar commented on June 16, 2024 1

Thanks for clarifying!

I certainly understand both views, to depend on 3rd party roles and also to have it included.
Although in my opinion it doesn't make much sense to have stackstorm specific mongodb and rabbitmq roles, it would make more sense to have the bare minimum rabbitmq/mongodb/etc tasks included in the st2 roles where needed (st2repo, st2, st2web). Then you could have a variable where you can disable those tasks if you plan to use 3rd party roles for more fine grained control over rabbitmq/mongodb/etc.

I'm giving both your collection and the roles in this repo a spin and I'll contribute if I see some opportunities to improvise.

from ansible-st2.

cognifloyd avatar cognifloyd commented on June 16, 2024

How about we do both? One main repo for development and unified use with read-only subsplit repos for each of the roles? We could use something like:
https://github.com/dflydev/git-subsplit

from ansible-st2.

cognifloyd avatar cognifloyd commented on June 16, 2024

I learned about git-subsplit from the Neos community. They use Neos/slicer (which uses git-subsplit) to manage their split repos. I just asked, and they'd like to move to from git-subsplit to splitsh/lite, but the tools create different commit hashes, so they couldn't complete the transition. We should probably start with slitsh/lite to begin with as it is supposed to be much faster.

from ansible-st2.

cognifloyd avatar cognifloyd commented on June 16, 2024

Right now, I'm mixing the stackstorm roles in a custom playbook that intersperses some of my own roles. I installed StackStorm.stackstorm from galaxy. To use the stackstorm roles individually, however, I have to refer to them as StackStorm.stackstorm/roles/<role>, and if I want to replace one of the stackstorm provided roles, it might still run the stackstorm one, because of meta dependencies. ie: StackStorm.stackstorm/roles/mongodb is not mongodb. Publishing them as individual roles makes it easier to reuse, or override roles selectively.

Current meta dependencies:

Thus, if I override any of the above roles, it will still use the stackstorm one in addition to my role. Moving to galaxy installed roles solves that because roles can always be referenced individually by name instead of using non-standard paths.

from ansible-st2.

cognifloyd avatar cognifloyd commented on June 16, 2024

Here is how an initial split can be done with splitsh/lite (with newlines for legibility):

time (git clone [email protected]:cognifloydtest/ansible-st2.git ansible-st2.git);
cd ansible-st2.git;
time (
    for role in roles/*; do
        echo; echo $role;
        git checkout master;
        splitsh-lite --progress --prefix $role --target=refs/heads/ansible-role-${role##*/};
        git checkout ansible-role-${role##*/};
        hub create cognifloydtest/ansible-role-${role##*/};
        git remote add ansible-role-${role##*/} [email protected]:cognifloydtest/ansible-role-${role##*/}.git -t master;
        git push ansible-role-${role##*/} -u ansible-role-${role##*/}:master;
    done;
    git checkout master
)

Check out my example repos at https://github.com/cognifloydtest
Check out the output from this command in https://gist.github.com/cognifloyd/4f4fbd0251ddb7115c3d9475f7eab507

If a copy of the repository is kept (to keep the cached split info) in some CI or ST2 instance somewhere, the split and push could be repeated to quickly update the split repositories when new commits are made on the master branch. That way, the ansible-st2 repo is the main development repo that includes all the CI checking, PRs, etc. But, read-only split copies of the roles can also be published on galaxy.

This does not deal with updating tags on the read-only repositories.

Also: Note that I used hub to create the repos on the fly.

from ansible-st2.

arm4b avatar arm4b commented on June 16, 2024

@cognifloyd The solution you're suggesting with git split is definitely interesting and worth trying/considering. Thanks for showing 👍
We'll research this approach more when we'll reach the migration point.

As @ytjohn noted #12 (comment), it might be a good idea to rename the roles/paths to StackStorm.st2, StackStorm.st2web etc soon to make the further transition smoother.

from ansible-st2.

cognifloyd avatar cognifloyd commented on June 16, 2024

I would take a two step approach:

  1. rename the role folders: st2 => StackStorm.st2
  2. split the roles off into their own repos.

I think you want them to be named appropriately in this repo first so that the meta dependencies, the example playbook, and all of the CI infra uses roles named StackStorm.*.

from ansible-st2.

cognifloyd avatar cognifloyd commented on June 16, 2024

It's not supported in any released version of ansible yet, but ansible/mazer (like ansible-galaxy, used to install galaxy roles) will allow installing and addressing multi-role repos. (see also ansible/ansible#42867)

So, that would mean I could include the roles as

  • StackStorm.ansible-st2.st2
  • StackStorm.ansible-st2.mistral
  • StackStorm.ansible-st2.mongodb
  • etc

from ansible-st2.

peschmae avatar peschmae commented on June 16, 2024

Is there any work happening in this regard right now?

I'd be happy to help split up this repo into a role per service, to make it easier to use in an existing ansible environment.

from ansible-st2.

arm4b avatar arm4b commented on June 16, 2024

@peschmae Sorry, we're not working on this change and have no immediate plans about it.
There are some good points, but also significant disadvantages in a splitting approach which are stopping us to do this breaking change.


As a workaround , you can install the "main" StackStorm.stackstorm role from Galaxy (https://galaxy.ansible.com/StackStorm/stackstorm/) and use specific sub-roles in your plays. Here is how to help Ansible find it: https://github.com/StackStorm/ansible-st2/blob/master/ansible.cfg.galaxy via custom ansible.cfg.

from ansible-st2.

peschmae avatar peschmae commented on June 16, 2024

Sadly, this approach won't work for me, since we already use roles_path differently in our setup, and it can only be set once.
Additionally the nginx/mongodb/rabbitmq/postgres roles might interfere with the roles we already use.

What are the disadvantages, beside needing to set some variable more than once (or cross reference them) in group/host vars, that you are struggling with?
I'll happily help you approach and solves these.

In my experience, it should be enough to set a proper requirements.yml which installs the other roles.
In this case here, it might make sense to have dependencies between st2* and the st2 roles, and leverage the ansible-galaxy for dependency management.

from ansible-st2.

arm4b avatar arm4b commented on June 16, 2024

See #45 (comment) for the list of pros/cons. The major concern is support & maintenance & visibility while splitting it to 12 or so separated role-repos.

Yes, adding a namespace like StackStorm.mongodb, StackStorm.st2chatops would be a good next step as a transition which will also resolve name interference issues.

That we can do.
And if we decide to split in future it would be a good migration point.

from ansible-st2.

cognifloyd avatar cognifloyd commented on June 16, 2024

If namespacing is ok (desirable? helpful?), then I can resurrect this PR: #173
But I'll only do that if someone at StackStorm (@armab? @LindsayHill?) wants to take the time and review it soon before it gets out of sync with master again.

from ansible-st2.

arm4b avatar arm4b commented on June 16, 2024

@cognifloyd Let's do it 👍 I think it's a good timing.

from ansible-st2.

peschmae avatar peschmae commented on June 16, 2024

Prefixing the roles, would already be a good step, since it would allow to install them locally using mazer, but until ansible/ansible#42867 is merged, there still wont be a way to install the roles in Ansible Tower/AWX, which is our go to.

If you need help with testing the prefixed roles, I'm happy to help.

from ansible-st2.

arm4b avatar arm4b commented on June 16, 2024

@cognifloyd @peschmae Thanks everyone, just released v1.1.0 role version with StackStorm galaxy org namespace/prefix (#173).

from ansible-st2.

gardar avatar gardar commented on June 16, 2024

Now that Ansible supports collections (for a while), perhaps it would be a good idea to publish the roles as a ansible collection? Rather than a role with sub-roles.

from ansible-st2.

gardar avatar gardar commented on June 16, 2024

I just came across https://github.com/cognifloyd/st2_installer.ansible which is the approach I was suggesting in my previous comment.
@cognifloyd Do you at some point plan to replace this role with your collection, or is it going to stay as separate projects?

from ansible-st2.

cognifloyd avatar cognifloyd commented on June 16, 2024

My goals for that collection are somewhat incompatible with the views of other maintainers here, which is why I forked the ansible-based installer.

One of my goals was to use external collections for 3rd party deps like mongo and rabbitmq. To that end I was contributing to community.mongodb and community.rabbitmq. I'm now one of the maintainers for each of those collections, so I can more directly facilitate improvements we might need.

I have been spending time on several other things in the StackStorm community and I've had other priorities at work, so I haven't been able to do as much as I'd like on the ansible collection. I'd be happy for any help. If enough people use and prefer to use that collection over the roles in this repo, then maybe we can discuss making it official in some future TSC meeting. I'm happy to provide commit access if you'd like to contribute to that collection (I would move it from cognifloyd/ to st2sandbox/ in that case - st2sandbox is also not an official part of the StackStorm project).

from ansible-st2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.