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>
This commit is contained in:
Kevin Carter 2022-04-29 13:59:38 -05:00
parent 0f7ac2a553
commit da50e0e267
No known key found for this signature in database
GPG Key ID: 5045BC941175BDF5
15 changed files with 35 additions and 37 deletions

View File

@ -5,4 +5,4 @@ skip_list: # or 'skip_list' to silence them completely
- no-handler # Tasks that run when changed should likely be handlers
- package-latest # Package installs should not use latest
- role-name # Role name {0} does not match ``^[a-z][a-z0-9_]+$`` pattern
- fqcn-builtins # Use FQCN for builtin actions.

View File

@ -102,7 +102,7 @@ Example Playbook with Satellite 6
rhsm_server_hostname: "mysatserver.com"
rhsm_baseurl: "https://mysatserver.com/pulp/repos"
rhsm_method: satellite
rhsm_insecure: yes
rhsm_insecure: true
roles:
- openstack.redhat-subscription

View File

@ -2,5 +2,5 @@
# to licensing conflicts. But we sill need to be able to pull them in for
# lint checks and want to document these as ansible specific things that may
# be required for this repository.
ansible<2.10
ansible-core<2.12
ansible-lint

View File

@ -4,11 +4,11 @@
# rhsm_activation_key: AAA-BBB-CCC-DDD
# rhsm_release: 8.1
# rhsm_ord_id: 1234
# rhsm_autosubscribe: yes # or no (note it's mutually exclusive to rhsm_activation_key)
# rhsm_autosubscribe: true # or no (note it's mutually exclusive to rhsm_activation_key)
rhsm_state: present # present or absent
rhsm_method: portal # portal or satellite
rhsm_force_register: False
rhsm_force_register: false
rhsm_repos: []
@ -17,8 +17,8 @@ rhsm_repos: []
rhsm_rhsm_port: 443
rhsm_server_hostname: subscription.rhn.redhat.com
rhsm_server_prefix: "{{ '/rhsm' if rhsm_method == 'satellite' else '/subscription' }}"
rhsm_insecure: False
rhsm_simplified_content_access: False
rhsm_insecure: false
rhsm_simplified_content_access: false
rhsm_ssl_verify_depth: 3
# rhsm_rhsm_proxy_proto: ""
# rhsm_rhsm_proxy_hostname: ""
@ -31,9 +31,9 @@ rhsm_ca_cert_dir: /etc/rhsm/ca/
rhsm_product_cert_dir: /etc/pki/product
rhsm_entitlement_cert_dir: /etc/pki/entitlement
rhsm_consumer_cert_dir: /etc/pki/consumer
rhsm_manage_repos: True
rhsm_full_refresh_on_yum: False
rhsm_report_package_profile: True
rhsm_manage_repos: true
rhsm_full_refresh_on_yum: false
rhsm_report_package_profile: true
rhsm_plugin_dir: /usr/share/rhsm-plugins
rhsm_plugin_conf_dir: /etc/rhsm/pluginconf.d
rhsm_cert_check_interval: 240

View File

@ -55,19 +55,19 @@ options:
- If state is equal to present or disabled, indicates the desired
repository state.
choices: [present, enabled, absent, disabled]
required: True
required: true
default: "present"
name:
description:
- The ID of repositories to enable.
- To operate on several repositories this can accept a comma separated
list or a YAML list.
required: True
required: true
purge:
description:
- Disable any repositories not listed in the task.
type: bool
default: False
default: false
'''
EXAMPLES = '''
@ -88,7 +88,7 @@ EXAMPLES = '''
- name: Disable all repositories except rhel-7-server-rpms
rhsm_repository_conf:
name: rhel-7-server-rpms
purge: True
purge: true
'''
RETURN = '''

View File

@ -5,17 +5,14 @@ galaxy_info:
company:
license: Apache 2.0
min_ansible_version: 2.5
platforms:
- name: EL
versions:
- 6
- 7
- 8
- name: EL
versions:
- 6
- 7
- 8
galaxy_tags:
- system
- redhat
- subscription
dependencies: []

View File

@ -17,4 +17,5 @@ import setuptools
setuptools.setup(
setup_requires=['pbr'],
pbr=True,
py_modules=[],
long_description_content_type='text/markdown')

View File

@ -14,7 +14,7 @@
state: "{{ rhsm_state | default(omit) }}"
autosubscribe: "{{ rhsm_autosubscribe | default(omit) }}"
consumer_name: "{{ rhsm_consumer_hostname | default(omit) }}"
force_register: True
force_register: true
rhsm_baseurl: "{{ rhsm_baseurl | default(omit) }}"
server_proxy_hostname: "{{ rhsm_rhsm_proxy_hostname | default(omit) }}"
server_proxy_port: "{{ rhsm_rhsm_proxy_port | default(omit) }}"

View File

@ -27,7 +27,7 @@
# retries.
retries: 5
delay: 10
until: not subscrition_result.failed
until: falset subscrition_result.failed
failed_when:
- "subscrition_result.stdout is defined"
- "'The system has been registered' not in subscrition_result.stdout"

View File

@ -2,7 +2,7 @@
uri:
url: "{{ rhsm_satellite_url }}/pub/rhsm_ORG_TRUSTED_SSL_CERT"
dest: /usr/share/rhn
validate_certs: no
validate_certs: false
- name: SATELLITE 5 | Register to Satellite 5
command: rhreg_ks --serverURL='{{ rhsm_satellite_url }}/XMLRPC'

View File

@ -32,8 +32,8 @@
yum:
name: "{{ rhsm_satellite_url }}/pub/katello-ca-consumer-latest.noarch.rpm"
state: present
validate_certs: no
disable_gpg_check: yes
validate_certs: false
disable_gpg_check: true
register: katello_rpm
# This script is provided by katello-ca-consumer and takes care of deploying

View File

@ -1,20 +1,20 @@
- name: SATELLITE | Check for Satellite 5
uri:
url: "{{ rhsm_satellite_url }}/rhn/Login.do"
validate_certs: no
validate_certs: false
status_code: 200, 404
register: _sat5_check
run_once: yes
run_once: true
tags:
- rhsm_satellite
- name: SATELLITE | Check for Satellite 6
uri:
url: "{{ rhsm_satellite_url }}/pulp/api/v2/status"
validate_certs: no
validate_certs: false
status_code: 200
register: _sat6_check_v6
run_once: yes
run_once: true
ignore_errors: true
tags:
- rhsm_satellite
@ -22,10 +22,10 @@
- name: SATELLITE | Check for Satellite 6.10
uri:
url: "{{ rhsm_satellite_url }}/pulp/api/v3/status"
validate_certs: no
validate_certs: false
status_code: 200, 404
register: _sat6_check_v610
run_once: yes
run_once: true
tags:
- rhsm_satellite
when:
@ -55,7 +55,7 @@
service:
name: rhsmcertd
state: started
enabled: yes
enabled: true
when: "'rhsmcertd' in service_list"
- name: SATELLITE | Set Satellite version

View File

@ -1,6 +1,6 @@
- hosts: all
remote_user: vagrant
become: yes
become: true
roles:
- ansible-role-redhat-subscription

View File

@ -3,7 +3,7 @@ rhsm_password: "{{ lookup('env', 'RHSM_PASSWORD') }}"
rhsm_pool_ids: "{{ lookup('env', 'RHSM_POOL_ID') }}"
rhsm_repos: "{{ repos[ansible_distribution ~ '-' ~ ansible_distribution_major_version] }}"
# rhsm_state: present
# rhsm_repos_purge: True
# rhsm_repos_purge: true
repos:
RedHat-6:

View File

@ -40,7 +40,7 @@ commands =
[testenv:ansible-lint]
basepython = python3
commands = ansible-lint
commands = bash -c "ansible-lint"
[testenv:linters]
basepython = python3