Description of problem: overcloud registration script check only if rhel_reg_auto_attach is present or not so rhel_reg_auto_attach: "False" count as true The registration script seems to check only if the variable is defined or not: ... if [ -n "${REG_ACTIVATION_KEY:-}" ]; then opts="$opts --activationkey=$REG_ACTIVATION_KEY" sat5_opts="$sat5_opts --activationkey=$REG_ACTIVATION_KEY" if [ -z "${REG_ORG:-}" ]; then echo "WARNING: REG_ACTIVATION_KEY set without REG_ORG." fi else echo "WARNING: Support for registering with a username and password is deprecated." echo "Please use activation keys instead. See the README for more information." if [ -n "${REG_PASSWORD:-}" ]; then opts="$opts --password $REG_PASSWORD" fi if [ -n "${REG_USER:-}" ]; then opts="$opts --username $REG_USER" fi fi ... So if you have rhel_reg_auto_attach: "False" you will get the error anyway: Error: Activation keys cannot be used with --auto-attach. overcloud.ContrailController.0.SshHostPubKey: resource_type: OS::TripleO::Ssh::HostPubKey physical_resource_id: 7e65bfce-cc61-47c3-ab1a-39a5102a0698 status: CREATE_FAILED Version-Release number of selected component (if applicable): How reproducible: always Steps to Reproduce: 1. Deploy overcloud with similar registration template parameter_defaults: rhel_reg_activation_key: "RH73" rhel_reg_auto_attach: "False" rhel_reg_base_url: "http://192.1.1.2" rhel_reg_environment: "" rhel_reg_force: "" rhel_reg_machine_name: "" rhel_reg_org: "XXXXX-8b4f-XXXX-XXXXX-XXXXXXXXXXXXXXXXXXX" rhel_reg_password: "ofuscated" rhel_reg_pool_id: "" rhel_reg_release: "" rhel_reg_repos: "rhel-7-server-rpms rhel-7-server-extras-rpms rhel-7-server-rh-common-rpms rhel-ha-for-rhel-7-server-rpms rhel-7-server-openstack-10-rpms rhel-7-server-openstack-10-devtools-rpms" rhel_reg_sat_url: "http://192.1.1.2" rhel_reg_server_url: "" rhel_reg_service_level: "" rhel_reg_user: "user" rhel_reg_type: "" rhel_reg_method: "satellite" rhel_reg_sat_repo: "rhel-7-server-satellite-tools-6.1-rpms" 2. 3. Actual results: Error: Activation keys cannot be used with --auto-attach. overcloud.ContrailController.0.SshHostPubKey: resource_type: OS::TripleO::Ssh::HostPubKey physical_resource_id: 7e65bfce-cc61-47c3-ab1a-39a5102a0698 status: CREATE_FAILED Expected results: rhel_reg_auto_attach: "False" honored Additional info:
In this particular case, "" would be used to disable it. The documentation around these parameters are lacking but the checks around these variables seem to to use "" as the disabled string.
i think the fix here ought to be to document these parameters using the environment generator so it's clear how to use them.
I can't find where it's said to set rhel_reg_auto_attach to True or False. While I agree this is not obvious, you might want to just ignore this parameter if you don't want to auto_attach. We can fix this bug in 2 ways: - Document the parameter - Sanitize the parameter and check content FWIW, I prefer our users to ignore the parameter if they don't want auto-attach, and use whatever string (true, True, whatever) to enable it. I'm happy to fix it in the code, in the way you like, just tell me what you prefer.
Alright, no reply from Eduard so we'll proceed with option 1, documentation. Dan, could we please document that "rhel_reg_auto_attach" parameter should only be used when set to True. When we don't need it, don't set it to False, just do nothing, the default is "" so the feature will be disabled anyway. Thanks
This bug affects all versions of OSP since we have RHEL scripts. To me it's a doc fix, we're moving to Ansible and won't have this code in the future.
Sorry for the confusion in https://bugzilla.redhat.com/show_bug.cgi?id=1459468#c14 but the comment was about documentation. Yes, we should backport the doc change into OSP10 and 11.
Hey Dan, can you please proceed to the backports for the older versions of OSP? OSP10 and 11 are enough IMHO. Thanks
Backported and published!
Thanks Dan! Closing the bug as we improved the documentation.