Is there something like content views for Puppet also available for Ansible roles

Latest response

We are running Satellite 6.9. Since Puppet gets more and more deprecated we would like to switch our configuration management to Ansible roles only.

The problem we are facing is that for Puppet there are repositories and content views. The content view allows to specify which version of a Puppet module is applied in a lifecycle stage. But there are not repositories and content views for Ansible roles.

We create host groups with composite content views, kickstart files and Ansible roles to bundle as much configuration already into one configuration without the need to customize much on deployment of a host.

What would be a mechanism to allow testing Ansible roles without already making the test version available to all environments? We would appreciate very much your help.

Responses

Same question, how do we manage to let ansible roles follow the lifecycles. In other words, how to devops ansible roles.

Seems there is no out of the box solution

I'm developing my own setup that i want to share:

  • clone "Ansible Roles - Ansible Default" => "Ansible Roles - Ansible Default with lifecycle"
  • create extra dirs in /etc/ansible/roles as you have Lifecycle Environment(Library, DTA, PRD)
  • change ansible script to
---
- hosts: all
  tasks:
    - name: Apply roles
      include_role:
        name: "<%= @host.lifecycle_environment %>/{{ role }}"
      loop: "{{ foreman_ansible_roles }}"
      loop_control:
        loop_var: role
  • copy the version of the roles to corresponding directories.
  • TODO develop some scripting to push from one life cycle to next lifecycle