Bug 1430545

Summary: [RFE] Define how to use advanced subscription/pool assignments per role (pre-/post-deployment hooks)
Product: Red Hat OpenStack Reporter: Jaromir Coufal <jcoufal>
Component: openstack-tripleo-heat-templatesAssignee: Emilien Macchi <emacchi>
Status: CLOSED ERRATA QA Contact: Gurenko Alex <agurenko>
Severity: medium Docs Contact:
Priority: high    
Version: 12.0 (Pike)CC: achernet, adhingra, agurenko, aschultz, asimonel, cylopez, dbecker, emacchi, jcoufal, jelle.hoylaerts, jliberma, jmelvin, kamil.rogon, mburns, mfuruta, morazi, ohochman, rhel-osp-director-maint, sclewis, srevivo, vcojot, ykawada
Target Milestone: Upstream M2Keywords: FutureFeature, Triaged
Target Release: 14.0 (Rocky)   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: openstack-tripleo-heat-templates-9.0.0-0.20180710202746.d2994ca.el7ost Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-01-11 11:47:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1373538, 1400606, 1435500, 1442136, 1462958, 1469582, 1615694    

Description Jaromir Coufal 2017-03-08 21:58:57 UTC
We have several requests on attaching specific subscriptions to specific roles, defining multiple pools, etc.

Instead of re-implementing subscription manager, keep our default way and provide a way on how to achieve advanced use cases (subscription per role, multiple pools, etc). This should be already doable via pre-/post-deployment hooks. If not, please comment and we will need to re-evaluate the scope.

Related BZs will be linked as dependent on this specific RFE.

Procedure will need to be defined by Eng, tested by QE and documented by Docs team.

Comment 2 Jaromir Coufal 2017-03-13 06:09:06 UTC
*** Bug 1396351 has been marked as a duplicate of this bug. ***

Comment 3 Jaromir Coufal 2017-03-13 06:14:27 UTC
*** Bug 1368037 has been marked as a duplicate of this bug. ***

Comment 4 Jaromir Coufal 2017-03-13 06:16:32 UTC
*** Bug 1408571 has been marked as a duplicate of this bug. ***

Comment 6 Jaromir Coufal 2017-06-13 14:08:29 UTC
Keeping in OSP12 since this is best practices / documentation only (of course supported by QE) but no code is involved - no risk on disrupting product delivery.

Comment 8 Emilien Macchi 2017-06-16 12:31:57 UTC
*** Bug 1462084 has been marked as a duplicate of this bug. ***

Comment 20 Emilien Macchi 2017-10-31 16:08:53 UTC
See https://blueprints.launchpad.net/tripleo/+spec/rhsm-integ-ansible where I think this blueprint would help to achieve this RFE.

Comment 21 Gurenko Alex 2017-10-31 17:36:22 UTC
There is an ansible module already existing for these needs: http://docs.ansible.com/ansible/latest/redhat_subscription_module.html we can just document the proceedure and publish some examples for now and build something around it in future releases

Comment 25 Vincent S. Cojot 2017-12-20 16:07:30 UTC
I think I just got this working on OSP10 and without needing to hack into rhel-registration.
rhel-registration is just a pre-config hook. It means it is usually called from your env file in this manner:
​
resource_registry:
 ​[...]
  OS::TripleO::NodeExtraConfig:                 all-pre-config.yaml
​
..which, in turn, points to something like this:
​​
resources:
  RhelRegistrationPreConfig:
    type: all-pre-config/rhel-registration.yaml
    properties:
        server: {get_param: server}

So, in order to override -some- parameters for some node Roles, I split the pre-config hooks this way:
​
resource_registry:
​[...]​
  OS::TripleO::ControllerExtraConfigPre:        controller-pre-config.yaml
  OS::TripleO::ComputeExtraConfigPre:           compute-pre-config.yaml
  OS::TripleO::CephStorageExtraConfigPre:       ​​ceph-pre-config.yaml
  OS::TripleO::NodeExtraConfig:                 all-pre-config.yaml
​

Each of these sub-files looks like this (here, the ceph pre-config file, ​ceph-pre-config.yaml ):
​
$ cat ceph-pre-config.yaml
heat_template_version: 2014-10-16
description: 'Extra Pre-Deployment Config, Ceph'
parameters:
  server:
    type: string
  rhel_reg_repos:
    type: string

resources:
  RhelRegistrationPreConfig:
    type: ​​all-pre-config/​​rhel-registration.yaml
    properties:
        server: {get_param: server}
        ​​rhel_reg_repos: "rhel-7-server-rpms,rhel-7-server-supplementary-rpms,rhel-7-server-optional-rpms,rhel-7-server-extras-rpms,rhel-7-server-openstack-10-rpms,rhel-7-server-openstack-10-tools-rpms,rhel-7-server-openstack-10-optools-rpms,rhel-7-server-openstack-10-devtools-rpms,rhel-7-server-rhceph-2-osd-rpms,rhel-7-server-rhceph-2-mon-rpms,rhel-7-server-rhceph-2-tools-rpms,rhel-7-server-satellite-tools-6.2-rpms"

outputs:
  deploy_stdout:
    value:
      list_join:
      - ''
      - - {get_attr: [RhelRegistrationPreConfig, deploy_stdout]}
​

Here, the '​rhel_reg_repos' parameter is role-dependent and the deployment will re-use the rest of the global parameters found in ​all-pre-config/rhel-registration.yaml before calling the actual script (rhel-registration).
Note, that I used '​rhel_reg_repos' in this example but really any parameter found in ​rhel-registration.yaml [1] can be overridden in this fashion.
Works for me (tm), tested on OSP10z6:

Comment 26 Emilien Macchi 2018-01-08 21:00:51 UTC
*** Bug 1456957 has been marked as a duplicate of this bug. ***

Comment 35 Gurenko Alex 2018-11-29 13:29:45 UTC
Feature test consistently passing downstream CI since puddle 2018-10-17.2

Comment 37 errata-xmlrpc 2019-01-11 11:47:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2019:0045