Staging of Ansible Roles

Using Ansible roles to configure new provisioned hosts and to rollout changes.
However, before new features in those roles are run on production-servers I would like to run them on an test environment.
I can have those roles in different branches in git, but in the end they have to be placed somehow in /etc/ansible/roles/ and then imported in foreman.

What I miss here is something similar like the environments in puppet or saltstack, to have the ability to have one role with different versions - one with new changes and one stable for production.

One workaround may be to rename the roles and include their branch/environment and have them all duplicated.

Expected outcome:

It would be nice to have the possibility to reference to roles in git and different branches - but more essential would be a way how to have roles per lifecycle.
I haven’t played around much with pulp3 and the ansible-collection-repositories and if they can be used similar to the old puppet-module-repositories from pulp2, but it looks like they cannot be imported to the ansible roles and so there is no connection.

Maybe the support is not the correct category for this issue/feature, but then it could be moved somewhere more appropriate.

I remember we discussed this as a nice feature for the ansible plugin on a strategy meeting in 2019 or so as it would add additional value to the integration. So it was before collections in Ansible and with nothing use not expecting something like environments in Ansible still in the future. But it looks noone created an issue over at Issues - Ansible - Foreman, so can you please create one?

We also talked about how pulp3 could perhaps be used in such a workflow and also for syncing roles if needed. So perhaps if you create the issue someone can find the notes from the past. :wink:

Created a issue: Bug #33731: Support environments / branches for ansible roles - Ansible - Foreman

I think this is a major drawback of foreman_ansible right now… sorry.

1 Like