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
This commit is contained in:
Jose Luis Franco Arza 2019-06-20 11:33:56 +02:00
parent a8b5d8124d
commit 93dbc5167d
2 changed files with 10 additions and 6 deletions

View File

@ -31,9 +31,11 @@ ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
# TODO(jfrancoa): Rename back into rhsm_repository once
# Ansible 2.8 is used.
DOCUMENTATION = '''
---
module: rhsm_repository
module: rhsm_repository_conf
short_description:
- Manage RHSM repositories using the subscription-manager command
description:
@ -70,21 +72,21 @@ options:
EXAMPLES = '''
- name: Enable a RHSM repository
rhsm_repository:
rhsm_repository_conf:
name: rhel-7-server-rpms
- name: Disable all RHSM repositories
rhsm_repository:
rhsm_repository_conf:
name: '*'
state: disabled
- name: Enable all repositories starting with rhel-6-server
rhsm_repository:
rhsm_repository_conf:
name: rhel-6-server*
state: enabled
- name: Disable all repositories except rhel-7-server-rpms
rhsm_repository:
rhsm_repository_conf:
name: rhel-7-server-rpms
purge: True
'''

View File

@ -27,7 +27,9 @@
- import_tasks: register.yml
- name: Configure repository subscriptions
rhsm_repository:
# TODO(jfrancoa): Change back into rhsm_repository once
# we start using Ansible 2.8.
rhsm_repository_conf:
name: "{{ rhsm_repos }}"
purge: "{{ rhsm_repos_purge | default(omit) }}"
state: "{{ rhsm_repos_state | default(omit) }}"