ansible / ansible-container

DEPRECATED -- Ansible Container was a tool to build Docker images and orchestrate containers using only Ansible playbooks.
GNU Lesser General Public License v3.0
2.19k stars 394 forks source link

Adding container project to Galaxy when I already have a same-named role on Galaxy? #629

Open geerlingguy opened 7 years ago

geerlingguy commented 7 years ago
ISSUE TYPE
SUMMARY

So... I already maintain geerlingguy.solr as an Ansible Galaxy role (https://galaxy.ansible.com/geerlingguy/solr/).

And I have an Ansible Container project I'd like to submit so users can run ansible-container init geerlingguy.solr, and it's on GitHub at geerlingguy/ac-solr.

So I went into 'My Roles' (I think that's where I go to do container projects, right?) and enabled ac-solr with the name solr.

But I think I broke something... because the import just says 'Running' perpetually...

STEPS TO REPRODUCE
  1. Have an Ansible Galaxy role in your namespace named user.example
  2. Try to add an Ansible Galaxy container project in your namespace named user.example
EXPECTED RESULTS

I can have users use Galaxy for the role or container project, e.g.

ansible-galaxy install geerlingguy.solr # this goes to my ansible-role-solr repo
ansible-container init geerlingguy.solr # this goes to my ac-solr repo
ACTUAL RESULTS

I blow Ansible Galaxy's mind, and Galaxy sits and ponders the impossible puzzle I have set before it:

screen shot 2017-06-29 at 11 35 52 pm
geerlingguy commented 7 years ago

Well, after a while I refreshed and it wasn't 'Running' anymore. I can get it to work at https://galaxy.ansible.com/geerlingguy/ac-solr/, but is there any way I could use the same namespace for Container as my Role so people could build either with the same username.project? Or will I have to prefix all my roles that I want to turn into AC projects? (There probably won't be too many—most of the roles will be composed into separate AC projects like geerlingguy.lamp being an amalgamation of geerlingguy.apache + geerlingguy.mysql + geerlingguy.php.

chouseknecht commented 7 years ago

The unique key is namespace, 'geerlingguy', plus the role name, 'solr'. The role type is not part of the equation.

If we were to change that, we would also have to change the way the install command works. Plus, what if I wanted to install both types of the geerlingguy.solr role, how would I keep them separate on the local filesystem? We would need to figure that out.

Not opposed to changing the way Galaxy works, but it's not currently on the drawing board.

geerlingguy commented 7 years ago

@chouseknecht - In that case, for the near-term (or permanently, if container/role galaxy is always going to be using the same namespace), I think it would be nice to have both of the following:

  1. If you try adding another project to your own galaxy account with the same name (e.g. solr) as an existing project, then it should error out instead of spinning forever.
  2. It would be nice to have some sort of convention for the naming... e.g. should my container project be [rolename]-container? Currently for testing I named it ac-solr, but I'm really not married to that, as it doesn't give any real context ('air conditioning?', 'ansible connection?', 'antelope conservation?').
geerlingguy commented 7 years ago

For the first point, I opened an issue in Galaxy: https://github.com/ansible/galaxy-issues/issues/270

geerlingguy commented 6 years ago

I'm okay with closing this out, on second thought—I figure a role and a container project have different ends and aims, and it's good to have a distinction.

I'm going to carry forward my naming convention of:

namespace.rolename - The role / primative namespace.rolename-container - Ansible Container project that uses the role to build/deploy container.

And there isn't necessarily a 1:1 match for all these things—some of the container builds will be pulling in multiple roles.