Commit Graph

27 Commits

Author SHA1 Message Date
Ghanshyam Mann 340d059ee5 Retire Tripleo: remove repo content
TripleO project is retiring
- https://review.opendev.org/c/openstack/governance/+/905145

this commit remove the content of this project repo

Change-Id: I6b367027aff77f4bf9810903e62ccb59bca0ff38
2024-02-24 11:41:15 -08:00
Kevin Carter da50e0e267
Fix Ansible Lint
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>
2022-04-29 14:12:31 -05:00
Emilien Macchi 6d26afa9c7 Add support for "Simplified Content Access"
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
2020-07-15 22:52:11 -04:00
Emilien Macchi bcda84e1c4 Adjustments to detect Satellite version/mode
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
2020-07-03 15:39:36 +00:00
Emilien Macchi 5f65ba4a3a Introduce rhsm_release parameter
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
2020-05-22 19:02:40 +00:00
Emilien Macchi 7987a09f6e Improve support for HTTP proxy
- 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
2020-03-23 22:01:01 -04:00
Emilien Macchi 0949f34ffb Simplify & document unregister
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
2019-04-13 02:34:18 +00:00
Marius Cornea 1b3e473520 Set up repos when using portal with activation key
When using activation key with portal registration method we need
to provide the repositories list to be enabled.

Change-Id: I7aea9173822647a4601167bb2f9e77394d0ed602
2018-11-29 11:42:19 -05:00
Zuul 1d4724b637 Merge "Make it more explicit that rhsm_activation_key and rhsm_repos are exclusive" 2018-11-28 17:03:45 +00:00
Emilien Macchi 6eae85cba8 Make it more explicit that rhsm_activation_key and rhsm_repos are exclusive
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
2018-11-27 13:15:24 -05:00
Sam Doran 9db2533cd2 Fix table in README
Change-Id: I92aa05fba316119120ef95dbaec35533ab927013
2018-11-27 10:53:25 -05:00
Jose Luis Franco Arza 3346d387eb Fix README.md rst check warnings.
When creating a new version for the package, it was discovered
some rst syntax warnings.

Change-Id: I4d8199d88ec20611dcb586ce30d194c51c2d24dd
2018-11-12 11:38:51 +01:00
Sam Doran b6cc4a511d Add resiliency to subscription management role
* When registration, fails automatically run recovery tasks to ensure a
  successful registration
* Add rhsm_repository module to role to allow using the role with Anisble < 2.5
* Add feature to rhsm_repository module to purge repos not listed in the task
* Change how the role handles multiple repositories for much faster
  execution time
* Update README with information on new repo behavior and purge option

Change-Id: I8a0b20bf72fb56426b51b94e9936f6174d43c248
2018-11-06 10:51:30 -05:00
Sam Doran f2385c2aa2 Configure Satellite using Ansible instead of a script
- remove rhsm_repository module since it is included with Ansible 2.5
- improve test environment
- convert katello-rhsm-consumer script to Ansible tasks
- gather service and package facts
- use ansible_facts dictionary for facts rather than ansible_[fact]
- set rhsm_server_prefix, rhsm_repo_ca_cert, and rhsm_full_refresh_on_yum
  based on portal or satellite registration

Change-Id: Ifdbcc3b23d5f6ea68dcf904e40a7f44c4b61622e
2018-10-22 17:27:21 -04:00
Emilien Macchi a0c7cfffcc Fix defaults when activation key is used, add options
When the activation key is used, we don't want to deploy repositories,
and also it's not compatible with autosubscribe option, they are both
mutually exclusive.

This patch:
- change the default of rhsm_autosubscribe to be undefined.
- configure repositories when activationkey isn't defined.
- use include_tasks since a variable is in the task file name
- add option to force registration
- pass the rhsm_baseurl to the registration task, which is needed when
  unregistering
- derive the rhsm_satellite_url from rhsm_baseurl by default, but allow it to
  be overridden
- sets validate_certs for yum tasks
- uses dynamic task inclusion rather than static import with a default filter for selecting the registration method

Change-Id: Ibf8c3c573a78acc6815cf3793a208028c43f3ba1
Closes-Bug: #1798382
2018-10-17 17:29:06 -04:00
Emilien Macchi 8797a909ea Add support for RHSM Pools
Support rhsm_pool_ids parameter (it was documented but not used).
This parameter helps to specify the subscription pool IDs to consume.

A pool ID may be specified as a string - just the pool ID
(ex. 0123456789abcdef0123456789abcdef), or as a dict with the pool ID as the
key, and a quantity as the value (ex. 0123456789abcdef0123456789abcdef: 2).
If the quantity is provided, it is used to consume multiple entitlements from
a pool (the pool must support this).

Change-Id: I5658fa97e32193045c9da29126e824a884054e60
2018-09-25 21:44:25 -04:00
Sam Doran 569f43f79d Update README, variables, and rhsm.conf.j2
- Update README to point to role's new home on Ansible Galaxy
- update rhsm.conf.j2 template so all options are variables
- cleanup rhsm.conf.j2 template by removing comments and compressing lines
- update README with new variables availble in rhsm.conf.j2 template
- increase memory in RHEL6 test machine to prevent kernel panic
- use different repos for RHEL6 and RHEL7 test VMs

Change-Id: Iebd4a992ea1bf9c393f12d2d73c04011f4fe0603
2018-02-20 16:52:33 -05:00
Sam Doran 00defe7fc2 Update RHSM role to allow Satellite or Portal registration
- Fix line widths in rhsm_repository.py
- Unify variable names: they all have rhsm_ prefix now

Change-Id: I64e8d7ee201ec9b21ef7c513cf2231994b31c6a6
2018-02-07 16:53:01 -05:00
Sam Doran d4e81a1af9 Lay groundwork for selection input methods
Change-Id: I9adf771ce5fe72efeb3225b6c2329ada479ca4d3
2017-12-28 09:39:58 -08:00
Emilien Macchi a4d2420e60 Support Red Hat Portal Activation Keys
Enable users of the role to not use username/password but activation
key and org_id.

Change-Id: I51941b851c55451377060993f951fcd68cacde0b
2017-12-15 12:48:06 -08:00
Emilien Macchi 4c77ba509d Make redhat_subscription parameters optional
Using default(omit), parameters not part of environment won't be sent to
the module, so fully ignored.
Indeed, username/password/state/autosubscribe are all optional.

Change-Id: I3a81cdaccd2d90a43dec95d21b26d9ea503ed313
2017-12-15 12:28:51 -08:00
Sam Doran cb72219341 Change license to Apache 2.0 2017-12-12 10:38:32 -05:00
Sam Doran d1417155c6 Use redhat_repos module for mananging repos.
The module needs some work in order to operate efficiently. Currently
it always runs and reports a change. Additionally, calling it using a loop
results in multiple runs of the subscription-manager tool, which is quite
slow.
2016-11-11 13:38:41 -05:00
Sam Doran 4680d058e8 Correct type-o in README 2016-06-15 10:41:43 -04:00
Sam Doran e6ac39334a Do not make repos and autosubscribing mutually exclusive
Only add repos if rhsub_repos is defined instead of based on rhsub_autosubscribe.
2016-06-15 10:36:19 -04:00
Sam Doran 23d1037181 Update README 2016-06-09 17:33:14 -04:00
Sam Doran 5fbd676974 Initial commit 2016-06-09 17:31:41 -04:00