Commit Graph

86 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
Cédric Jeanneret eefe501923 Update rhsm_disable_container_check default value
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
2022-08-11 13:14:55 +02:00
Cédric Jeanneret f703e5c494 Add missing environment for a couple of tasks
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
2022-07-01 09:51:22 +02:00
Cédric Jeanneret 9d1a91821a Add trailing slash to status URI
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
2022-06-21 16:47:05 +02:00
Zuul ef52a27bb3 Merge "fix typo" 2022-05-25 12:25:02 +00:00
Kevin Carter 2c4cd367f1
fix typo
Signed-off-by: Kevin Carter <kecarter@redhat.com>
Change-Id: I156d638680b061032e0b95c55d21e029a6fa144f
2022-05-25 07:12:35 -05:00
David Hill 4646e4e3d2 Retry polling the satellite endpoint on failure
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
2022-05-11 16:39:19 -04:00
Kevin Carter 41b5d0b7be Update the satellite task file for version checks
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
2022-05-04 19:52:39 +00: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
David Vallee Delisle 0f7ac2a553 Adding option to disable container validation
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
2022-03-03 11:20:39 -05:00
Igor Gramic 7369c0ba97 Fixing https://github.com/ansible-collections/community.general/issues/715
Change-Id: I3e8390e68f95621ae6728dd705c554adc6d65866
2022-02-21 10:07:44 +01:00
Emilien Macchi ae0a36118a Revert "addressing https://github.com/ansible-collections/community.general/issues/715"
This reverts commit 66a322b007.

Reason for revert: this needs more work from the author. We agreed on this.

Change-Id: I905598df2379ff2b810d4d9b4032e4eadb873db0
2022-02-15 20:50:16 +00:00
Igor Gramic 66a322b007 addressing https://github.com/ansible-collections/community.general/issues/715
Change-Id: Idb58eb143b812c16d8cf348f045e0505dea1ce86
2022-02-15 21:05:20 +01:00
Sagi Shnaidman 31b0c74d1e Fix URL version for Satellite 6.10
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
2021-11-18 14:27:12 +00:00
Jeremy Stanley effac4c9d8 Correct the tox option for skipping sdist generation
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
2021-06-17 17:00:00 +00:00
Zuul 17a8bd5a8d Merge "setup.cfg: Replace dashes with underscores" 2021-05-10 18:00:37 +00:00
Alex Schultz d70c205af8 Fix packages fact
Update packages fact variable to use ansible_facts.

Change-Id: I0039bf7c2dd11da212ad1f74bb227562af6c13cb
Related-Bug: #1915761
2021-05-04 07:18:11 -06:00
jiangzhilin 75cc7f61c4 setup.cfg: Replace dashes with underscores
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
2021-05-04 08:24:03 +00:00
Alex Schultz 4178cf561b Fix service fact reference
Update the reference to use ansible_facts.

Change-Id: I5477f4e85f5bf7f84b9c9dc7a9d043972615a019
Related-Bug: #1915761
2021-04-26 07:49:53 -06:00
Alex Schultz 7400e5a9d9 Use ansible_facts
ansible_pkg_mgr requires that the facts be injected as vars. We should
use ansible_facts instead.

Change-Id: I84ae549b549363d32207dff324657dd7df1f5ac0
2021-02-22 09:42:17 -07:00
Alex Schultz c6f9a7bdd7 Fix CI
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
2021-02-22 09:41:39 -07:00
Hervé Beraud ca1fcceeb3 Replace deprecated UPPER_CONSTRAINTS_FILE variable
UPPER_CONSTRAINTS_FILE is deprecated and TOX_CONSTRAINTS_FILE is
the new environment variable name that replaces it [1].

This allows to use upper-constraints file as more
readable way instead of UPPER_CONSTRAINTS_FILE=<lower-constraints file>.

[1] https://zuul-ci.org/docs/zuul-jobs/python-roles.html#rolevar-tox.tox_constraints_file
[2] https://review.opendev.org/#/c/722814/

Change-Id: I419f5d78981ac9c67617202fb9c31e6ddc4ed9d7
2020-11-09 16:35:55 +00:00
Alex Schultz 405b6b14b3 Bump pyflakes, exclude ansible-lint 106
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
2020-11-09 09:35:40 -07: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 fbfb0909cd Skip proxy tasks when not needed
if rhsm_rhsm_proxy_hostname is not defined, we don't need to run the
tasks used to configure proxy bits.

Change-Id: I15b70179ced343a1abbbb3ca8bd24fed50bfd758
2020-03-26 09:10:06 -04:00
Emilien Macchi a529e8c4f5 Fix ansible_pkg_mgr
ansible_pkg_mgr isn't in facts apparently, it's available from ansible
vars directly.

Change-Id: I21462446aeb01bbd280ee9c0cf9ef2bb222425b0
2020-03-25 17:53:13 -04: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
pengyuesheng 6c67a4085a Update the constraints url
For more detail, see http://lists.openstack.org/pipermail/openstack-discuss/2019-May/006478.html

Change-Id: I34f60c002a147b8b0b287a4f64798455868ddf03
2019-09-25 15:01:17 +08:00
Hervé Beraud fceb51c66e Fix issue with long description by using markdown format
Tell to pypi to convert long_description to markdown format.

https://github.com/pypa/warehouse/issues/5890#issuecomment-494868157

Change-Id: Id74d08c36b421f1b11f7cfeece1a77306ec138c0
2019-07-01 15:16:51 +02:00
Emilien Macchi 655075c552 register: add retry mechanism
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
2019-06-26 14:53:29 -04:00
Jose Luis Franco Arza 93dbc5167d Rename rhsm_repository module to avoid conflict.
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
2019-06-20 12:21:43 +02:00
Emilien Macchi a8b5d8124d sat6: install katello-host-tools after registration
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
2019-06-05 09:23:47 -04:00
huang.zhiping 86358c2203 Update min tox version to 2.0
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
2019-05-30 09:52:39 +00:00
Le Hou 50120adf09 Update to opendev
Change-Id: I486a98640122837aeb7048db8a7e5024eff72654
2019-04-23 12:55:41 +08:00
OpenDev Sysadmins 36b36396cf OpenDev Migration Patch
This commit was bulk generated and pushed by the OpenDev sysadmins
as a part of the Git hosting and code review systems migration
detailed in these mailing list posts:

http://lists.openstack.org/pipermail/openstack-discuss/2019-March/003603.html
http://lists.openstack.org/pipermail/openstack-discuss/2019-April/004920.html

Attempts have been made to correct repository namespaces and
hostnames based on simple pattern matching, but it's possible some
were updated incorrectly or missed entirely. Please reach out to us
via the contact information listed at https://opendev.org/ with any
questions you may have.
2019-04-19 19:27:48 +00:00
Emilien Macchi fd6e0e3a13 unregister: run with become
The command needs to be run as root, I missed it in the last patch.

Change-Id: I2f5160beda1dfa5bf1fa3d82d18095bf03de8d86
2019-04-18 10:13:05 -04:00
Emilien Macchi 429bc833aa unregister: use command to remove the subscription
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
2019-04-17 18:40:29 -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
Zuul 13bf86da1f Merge "Fix lint and zuul: add publish-to-pypi" 2019-02-15 17:41:43 +00:00
Emilien Macchi d3091fd972 Fix lint and zuul: add publish-to-pypi
so we can release it.

Change-Id: Ia85c152c50f0330fa8ad4e3cb1acf5eeb1cdb6b1
2019-02-15 12:27:32 -05: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
Zuul dfaee5f025 Merge "sat6: pull & deploy katello certs" 2018-11-28 16:30:28 +00:00
Emilien Macchi dba48a0531 sat6: pull & deploy katello certs
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
2018-11-27 13:44:38 -05: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
Zuul 5f8dd387a9 Merge "add support for unregistration" 2018-11-26 16:59:04 +00:00
David J Peacock 5c5f7e2908 add support for unregistration
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
2018-11-21 12:10:24 -05:00