Following [1], the right way to disable the feature is to set the env
var value to an empty string.
Until now, whatever the value was (even False), it was enabled, because
the var was in the env.
[1] https://github.com/candlepin/subscription-manager/pull/3097
Change-Id: I54e1452dc4bb6e2e25fa9567335b62b730000e83
If564089fb1cb77366fa6d6f8e4086691a4dfcf37 introduced a new parameter,
allowing to disable container validation by setting the
SMDEV_CONTAINER_OFF environment variable.
A couple of places were overlooked, leading to issues, especially in a
satellite-6 enabled environment.
Resolves: rhbz#2102906
Change-Id: I04b6e8ed0c265021697ed574c55fc8b21eb66395
Apparently, pulp redirects /status to /status/. Adding the trailing
slash here allows to avoid a useless redirect, and may help avoiding
issues with Satellite not answering on due time, or other hard to debug
situations.
Change-Id: I32d4944d78e3fc2714243129906937e74be4465f
Retry polling the satellite endpoint when determining which
satellite version is running as it looks like, sometimes, in
given circumstances, those calls will fail and make deployment
fail later on with the following error:
```
The error was: 'dict object' has no attribute 'status'
```
Change-Id: I4bf68f89c15c0fc25e0ec615e2370292ddc7db64
Depends-on: https://review.opendev.org/c/openstack/ansible-role-redhat-subscription/+/839993
This change updates the satellite version check task file so that we're
able to perform version checks and set our required facts without
running into undefined values in certain circumstances.
Updates have also been made throughout the task file to ensure all jinja
strings are quoted, all data types are set correctly so there's no
assumed conversion, and all conditions follow a list format.
The Satellite 6.10 checks have been added to a conditional block, this was
done so we're not accidently setting facts incorrectly while also
reducing task execution.
> Updates have been made to our tox setup for ansible-lint. This is done
because our current lint test was broken; ansible lint will now test
with ansible-core.
rhbz: 2061393
Signed-off-by: Kevin Carter <kecarter@redhat.com>
Change-Id: Ibb17c000a7337c2c344b9ff08ce9fe75897838e9
Ansible lint is currently broken for this role. This change updates to
Ansible Core for the dependencies and then adjusts the role files to
ensure that the role can pass lint checks.
Change-Id: Id19209ca0a939bd669b25f9aad7dd5b011e34922
Signed-off-by: Kevin Carter <kecarter@redhat.com>
subscription-manager will fail if run from within a container. Since
some nodes are bindmounting /run, a .containerenv file is exposed
inside /run on the hosts and this breaks subscription-manager on
overcloud nodes.
We can bypass this validation from subscription-manager by enabling the
SMDEV_CONTAINER_OFF environment boolean as described here [1].
We need to give the hability to operators to bypass this check as well
on all subscription-manager calls.
Related: https://bugzilla.redhat.com/show_bug.cgi?id=2058540
[1] https://github.com/candlepin/subscription-manager/pull/2652/files
Change-Id: If564089fb1cb77366fa6d6f8e4086691a4dfcf37
This reverts commit 66a322b007.
Reason for revert: this needs more work from the author. We agreed on this.
Change-Id: I905598df2379ff2b810d4d9b4032e4eadb873db0
Pulp has been migrated from Pulp2 to Pulp3 in Satellite 6.10,
removing the /pulp/api/v2/status url, new URL is /pulp/api/v3/status
Resolves: RHBZ#2024440
Change-Id: I4fbb25634795b9d13a28c417f918da5e58ad2321
The tox option to skip source distribution building is skipsdist,
but this seems to be often misspelled skipdist instead, which gets
silently ignored and so does not take effect. Correct it
everywhere, in hopes that new projects will finally stop copying
this mistake around.
See https://tox.readthedocs.io/en/latest/config.html#conf-skipsdist
and https://github.com/tox-dev/tox/issues/1388 for details.
Change-Id: I1c5eaf99582fa0f09a42a1143d6ca8d0bb9e7289
Setuptools v54.1.0 introduces a warning that the use of dash-separated
options in 'setup.cfg' will not be supported in a future version [1].
Get ahead of the issue by replacing the dashes with underscores. Without
this, we see 'UserWarning' messages like the following on new enough
versions of setuptools:
UserWarning: Usage of dash-separated 'description-file' will not be
supported in future versions. Please use the underscore name
'description_file' instead
[1] https://github.com/pypa/setuptools/commit/a2e9ae4cb
Change-Id: Ib373c4b44b0ee5a80752081b1883433eb9045765
Cap ansible at <2.10 and fix hacking. Additionally convert ansible-lint
to not use the old shell script and use .ansible-lint for skips
Change-Id: I035ed9f3964ba904dc9ccfe048b69a68c6680253
We need a python 3.9 compatible version of pyflakes and exclude the role
name ansible-lint rule.
Related PyCQA/pyflakes #367
Change-Id: I44702be1aa668c381da2c54338c72f1d8e33562b
When Simplified Content Access is enabled for a subscription,
the portal can be used with an activation key AND repositories.
So this patch adds a new parameter, rhsm_simplified_content_access
(False by default for backward compatibility).
When set to True, we'll allow the "Configure repository subscriptions"
task to be run without any warning since both the rhsm_repos and
rhsm_activation_key usually mutually exclusive, now work together when
simplified content access is enabled.
Change-Id: I4ffa344956572ebcd5a432fe41b86eb682f8d2a3
1) Fail if we couldn't figure out what version of Satellite is running.
Otherwise we end up including a playbook that doesn't exist and the
error is misleading.
2) Change the Satellite 6 version check, to use /pulp/api/v2/status
instead of /katello/api/ping; which seems to work better when a
Capsule is used. This URL should work for both Satellite 6 and
Capsule.
3) Document that rhsm_rhsm_port needs to be changed to 8443 if a capsule
is used.
Change-Id: Ibc7c05260f01adf520f5d18f3ea8e23e266e4f6d
So we can configure a specific release when subscribing the node.
It has been reported on https://bugzilla.redhat.com/show_bug.cgi?id=1839063
that setting a release was required to get rpms from
rhel-8-for-x86_64-baseos-eus-rpms repository when installing OpenStack
on RHEL8.
Change-Id: I30d93806a7305e101c25507fb87bd02af62b61a5
if rhsm_rhsm_proxy_hostname is not defined, we don't need to run the
tasks used to configure proxy bits.
Change-Id: I15b70179ced343a1abbbb3ca8bd24fed50bfd758
- Configure the package manager (yum or dnf) to support the proxy
parameter.
- Pass the proxy parameters when using redhat_subscription module.
- Adding rhsm_rhsm_proxy_proto to not hardcode http in the proxy
url.
rhbz#1816255
Change-Id: I64b2dc97c512cecb7f4e6bcfa283733b3f2c1dc8
Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1715958
A regression in Satellite added a delay to the registration to happen.
To counter this problem we retry 5 times with a delay of 10 seconds between
retries.
Change-Id: Iaa578d608f64612b20deefe7b2ea1006b041654d
Closes-Bug: #1834242
The rhsm_repository is now part of the Ansible installation,
however, the version used inside the redhat_subscription role
contains changes the defaul module from Ansible doesn't contain.
As a consequence, if in the playbook execution, some task makes
use of the rhsm_repository module Ansible will locate it inside
its default module libraries and when we get to the point of invoking
the module from ansible-role-redhat-subscription/tasks/portal.yml
it will find out that the module is already loaded and make use
of the Ansible one, instead of the module stored under library/
rhsm_repository.py. This is a temporary solution until we'll update
into Ansible 2.8 for queens and rocky, then both modules will be
in sync and the one from ansible-role-redhat-subscription/library
could be removed.
Change-Id: Id53ebefff1f992781171a1e760fbf5306020cb56
Closes-Bug: #1833519
Context on https://bugzilla.redhat.com/show_bug.cgi?id=1717093 but with
Satellite 6.5, we now require this rpm to be deployed right after the
registration and repos setup otherwise the registration is in failure.
Change-Id: I14aa7eaec1c9abad6de83ddff092e2ad224075c2
The commands used by constraints need at least tox 2.0. Update to
reflect reality, which should help with local running of constraints
targets.
Change-Id: Iecc9b044469c970fa86bf3dab35a1d10c7c12429
The RHSM module is broken when unregistering:
https://github.com/ansible/ansible/pull/55468
The new command to unregister is 'remove':
$ subscription-manager -h
remove Remove all or specific subscriptions from this system
unsubscribe Deprecated, see remove
And also requires one of --serial, --pool or --all.
$ subscription-manager remove
Error: This command requires that you specify one of --serial, --pool or --all.
Change-Id: I439130e289bc039d718781c43f0fdfef1c31b8be
1) Simplify the unregister task, which doesn't require any parameter,
easier to maintain and less error prone.
2) Document with a playbook example in README how to unregister.
3) Remove useless register, never used later.
Change-Id: Ic1b6674c4608b555f51aa8c6716630c8d96b7fe2
When using activation key with portal registration method we need
to provide the repositories list to be enabled.
Change-Id: I7aea9173822647a4601167bb2f9e77394d0ed602
For a node to communicate correctly with Katello, it needs the right SSL
certificates in place, and facts configured in RHSM.
It is provided by katello-ca-consumer-latest.noarch.rpm with
katello-rhsm-consumer script.
This patch installs the rpm and runs the script.
Change-Id: I180eb65a01832da76d5c433d9b13f8e410e24d04
Closes-Bug: #1805249
If the operator is using an activation key, the repositories that are
associated to the subscription are configured in the Red Hat portal or in the
local instance of Satellite if any.
We can't specify rhsm_repos parameter if you are using rhsm_activation_key.
Otherwise, if you we rhsm_username and rhsm_password, we can use rhsm_repos
to select which parameters are deployed.
This patch:
- adds a debug message in the tasks/main when both options are defined.
- documents this situation in the README.
- adds 2 use cases in the README, one with Satellite and one with
Portal.
Change-Id: I6448d2f7258c2b00b8617f8e12fd06b53d28dc83
Since the big refactor we have lost the ability to unregister nodes
on scale down / delete.
This patch provides the framework for this, and will be followed
by a later patch which implements unregisteration as above.
Change-Id: I02c5c18f710172b2b988067c020551e3f58c392d