Skip to content

Commit

Permalink
Merge tag 'v3.12.0' into rel3120
Browse files Browse the repository at this point in the history
Release 3.12.0
  • Loading branch information
evgeni committed Jul 10, 2023
2 parents 93ff713 + c073e5f commit 5c6dcb8
Show file tree
Hide file tree
Showing 149 changed files with 15,336 additions and 9,898 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.11"
- name: Install dependencies
run: make doc-setup
- name: Generate changelog
Expand Down
28 changes: 17 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ concurrency:
jobs:
build:
runs-on: ubuntu-20.04
container: ${{ matrix.container }}
strategy:
fail-fast: false
matrix:
python:
- "3.9"
- "3.10"
ansible:
- stable-2.11
- stable-2.12
- stable-2.13
- stable-2.14
Expand All @@ -33,14 +33,15 @@ jobs:
ansible: "stable-2.10"
- python: "2.7"
ansible: "stable-2.11"
container: "python:2.7"
- python: "3.5"
ansible: "stable-2.11"
- python: "3.6"
ansible: "stable-2.11"
- python: "3.7"
ansible: "stable-2.11"
- python: "3.10"
ansible: "devel"
- python: "3.9"
ansible: "stable-2.11"
- python: "3.11"
ansible: "devel"
steps:
Expand All @@ -51,8 +52,13 @@ jobs:
python-version: ${{ matrix.python }}
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install libyaml-dev for PyYAML
run: sudo apt-get install -y libyaml-dev
if: matrix.container == null
- name: Install sudo
run: apt-get update && apt-get install -y sudo
if: matrix.container != null
- name: Install system dependencies
# libyaml-dev for PyYAML, rpm for py-rpm-installer
run: sudo apt-get install -y libyaml-dev rpm
- name: Install Ansible
run: pip install --upgrade https://github.com/ansible/ansible/archive/${{ matrix.ansible }}.tar.gz
- name: Install dependencies
Expand All @@ -69,7 +75,7 @@ jobs:
- name: Run dist tests
run: make dist-test
- name: Run sanity tests
run: make SANITY_OPTS="--local" sanity
run: make SANITY_OPTS="--docker" sanity
if: matrix.ansible != 'stable-2.9' && matrix.ansible != 'stable-2.10' && matrix.ansible != 'stable-2.11'

checkmode:
Expand All @@ -79,7 +85,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.11"
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install Ansible
Expand All @@ -98,7 +104,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.11"
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install dependencies
Expand All @@ -120,7 +126,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.11"
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install dependencies
Expand All @@ -142,7 +148,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.11"
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
python-version: "3.11"
- name: Install Ansible
run: pip install --upgrade ansible py
- name: Build Ansible Collection
Expand Down
1 change: 1 addition & 0 deletions .mailmap
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,4 @@ Lucas Bickel <[email protected]>
Lucas Bickel <[email protected]> <[email protected]>
Kenny Tordeurs <[email protected]> <[email protected]>
Paul Armstrong <[email protected]> <[email protected]>
Lukas Magauer <[email protected]> <[email protected]>
15 changes: 15 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ redhat.satellite Release Notes

This changelog describes changes after version 0.8.1.

v3.12.0
=======

Minor Changes
-------------

- content_view_filter - add deb filter type
- content_view_filter_rule - add spec for deb filter rules
- locations role - New role to manage locations

Bugfixes
--------

- convert2rhel role - Sync repos before CV publish (https://bugzilla.redhat.com/show_bug.cgi?id=2216907)

v3.11.0
=======

Expand Down
12 changes: 12 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,18 @@ releases:
- job-invocation-parameters.yml
- organizations_role-parameters_ignore_types.yml
release_date: '2023-06-14'
3.12.0:
changes:
bugfixes:
- convert2rhel role - Sync repos before CV publish (https://bugzilla.redhat.com/show_bug.cgi?id=2216907)
minor_changes:
- content_view_filter - add deb filter type
- content_view_filter_rule - add spec for deb filter rules
- locations role - New role to manage locations
fragments:
- 2023-06-26-forgotten-changelogs.yml
- content_view_filter_deb_support.yml
release_date: '2023-07-10'
3.2.0:
changes:
bugfixes:
Expand Down
4 changes: 3 additions & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ description: Ansible Modules to manage Satellite installations
authors:
- "@lessfoobar <[email protected]>"
- "Adam Růžička <[email protected]>"
- "Alan.Wong <[email protected]>"
- "AlanCoding <[email protected]>"
- "Andrew Kofink <[email protected]>"
- "Anthony Green <[email protected]>"
Expand Down Expand Up @@ -44,6 +45,7 @@ authors:
- "Lester Cheung <[email protected]>"
- "Lester Claudio <[email protected]>"
- "Lucas Bickel <[email protected]>"
- "Lukas Magauer <[email protected]>"
- "Lukáš Zapletal <[email protected]>"
- "Manisha Singhal <[email protected]>"
- "Manuel Bonk <[email protected]>"
Expand Down Expand Up @@ -91,7 +93,7 @@ authors:
- "metalcated <[email protected]>"
- "russianguppie <[email protected]>"
- "willtome <[email protected]>"
version: "3.11.0"
version: "3.12.0"
license:
- "GPL-3.0-or-later"
tags:
Expand Down
5 changes: 3 additions & 2 deletions plugins/modules/content_view_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
- erratum
- docker
- modulemd
- deb
type: str
rule_name:
description:
Expand Down Expand Up @@ -249,7 +250,7 @@ def main():
inclusion=dict(type='bool', default=False),
original_packages=dict(type='bool'),
content_view=dict(type='entity', scope=['organization'], required=True),
filter_type=dict(required=True, choices=['rpm', 'package_group', 'erratum', 'docker', 'modulemd']),
filter_type=dict(required=True, choices=['rpm', 'package_group', 'erratum', 'docker', 'modulemd', 'deb']),
filter_state=dict(default='present', choices=['present', 'absent']),
rule_state=dict(default='present', choices=['present', 'absent']),
rule_name=dict(aliases=['package_name', 'package_group', 'tag']),
Expand Down Expand Up @@ -297,7 +298,7 @@ def main():
foreman_spec=content_filter_spec,
)

if content_view_filter is not None and module.foreman_params['filter_type'] not in ['modulemd']:
if content_view_filter is not None and module.foreman_params['filter_type'] not in ['modulemd', 'deb']:
cv_filter_scope = {'content_view_filter_id': content_view_filter['id']}
if 'errata_id' in module.foreman_params:
# should we try to find the errata the user is asking for? or just pass it blindly?
Expand Down
10 changes: 8 additions & 2 deletions plugins/modules/content_view_filter_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,12 @@
'rule_name': {'flat_name': 'name'},
}

content_filter_rule_deb_spec = {
'id': {},
'rule_name': {'flat_name': 'name'},
'architecture': {},
}


class KatelloContentViewFilterRuleModule(KatelloEntityAnsibleModule):
pass
Expand Down Expand Up @@ -269,7 +275,7 @@ def main():
content_view_filter_rule = None

if filter_type != 'erratum' and module.foreman_params['name'] is None:
module.fail_json(msg="The 'name' parameter is required when creating a filter rule for rpm, container, package_group or modulemd filters.")
module.fail_json(msg="The 'name' parameter is required when creating a filter rule for rpm, container, package_group, modulemd or deb filters.")

if filter_type == 'erratum':
# this filter type supports many rules
Expand All @@ -282,7 +288,7 @@ def main():
search_scope['errata_id'] = module.foreman_params['errata_id']
content_view_filter_rule = module.find_resource('content_view_filter_rules', None, params=search_scope, failsafe=True)

elif filter_type in ('rpm', 'docker', 'package_group'):
elif filter_type in ('rpm', 'docker', 'package_group', 'deb'):
# these filter types support many rules
# the name is the key to finding the proper one and is required for these types
content_view_filter_rule = module.find_resource_by_name('content_view_filter_rules', module.foreman_params['name'],
Expand Down
5 changes: 3 additions & 2 deletions plugins/modules/job_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@
- SKARO
organizations:
- DALEK INC
with_fileglob:
- "./arsenal_templates/*.erb"
with_fileglob:
- "./arsenal_templates/*.erb"
# If the templates are stored locally and the ansible module is executed on a remote host
- name: Ensure latest version of all your Job Templates
Expand All @@ -254,6 +254,7 @@
password: "changeme"
state: present
template: '{{ lookup("file", item.src) }}'
name: '{{ item.path }}'
with_filetree: '/path/to/job/templates'
when: item.state == 'file'
Expand Down
7 changes: 4 additions & 3 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ ruamel.yaml.clib<0.2.3; python_version < '3.6'
cryptography<3.1; python_version < '3.7'
-r requirements.txt
pylint==2.6.0; python_version > '3.0' and python_version <= '3.8' # py 3.8 is used for "stable" ansible, but only devel has pylint rules for newer pylints
pylint==2.15.5; python_version >= '3.9' # from https://raw.githubusercontent.com/ansible/ansible/devel/test/lib/ansible_test/_data/requirements/sanity.pylint.txt
pylint==2.17.3; python_version >= '3.9' # from https://raw.githubusercontent.com/ansible/ansible/devel/test/lib/ansible_test/_data/requirements/sanity.pylint.txt
voluptuous==0.13.1 # from https://github.com/ansible/ansible/raw/devel/test/lib/ansible_test/_data/requirements/sanity.validate-modules.txt
pycodestyle==2.8.0; python_version < '3.6' # from https://github.com/ansible/ansible/raw/devel/test/lib/ansible_test/_data/requirements/sanity.pep8.txt
pycodestyle==2.9.1; python_version >= '3.6' # from https://github.com/ansible/ansible/raw/devel/test/lib/ansible_test/_data/requirements/sanity.pep8.txt
pycodestyle==2.10.0; python_version >= '3.6' # from https://github.com/ansible/ansible/raw/devel/test/lib/ansible_test/_data/requirements/sanity.pep8.txt
yamllint==1.26.3; python_version == '3.5' # from https://github.com/ansible/ansible/raw/devel/test/lib/ansible_test/_data/requirements/sanity.yamllint.txt
yamllint==1.28.0; python_version >= '3.6' # from https://github.com/ansible/ansible/raw/devel/test/lib/ansible_test/_data/requirements/sanity.yamllint.txt
yamllint==1.28.0; python_version == '3.6' # from https://github.com/ansible/ansible/raw/devel/test/lib/ansible_test/_data/requirements/sanity.yamllint.txt
yamllint==1.30.0; python_version >= '3.7' # from https://github.com/ansible/ansible/raw/devel/test/lib/ansible_test/_data/requirements/sanity.yamllint.txt
4 changes: 2 additions & 2 deletions roles/convert2rhel/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
when: satellite_convert2rhel_manage_subscription
- name: "Create Producs and Repositories"
ansible.builtin.import_tasks: products_and_repos.yml
- name: "Sync convert2rhel repositories"
ansible.builtin.import_tasks: sync.yml
- name: "Create Content Views"
ansible.builtin.import_tasks: content_views.yml
- name: "Create Activation Keys"
ansible.builtin.import_tasks: activation_keys.yml
- name: "Create Hostgroups"
ansible.builtin.import_tasks: host_groups.yml
- name: "Sync Content"
ansible.builtin.import_tasks: sync.yml
4 changes: 0 additions & 4 deletions roles/convert2rhel/tasks/products_and_repos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
content_type: "yum"
product: "{{ satellite_convert2rhel_rhel7_product }}"
url: "https://cdn.redhat.com/content/public/convert2rhel/7/x86_64/os/"
mirror_on_sync: true
verify_ssl_on_sync: true
download_policy: immediate
ssl_ca_cert: "Convert2RHEL CA"
Expand All @@ -46,7 +45,6 @@
content_type: "yum"
product: "{{ satellite_convert2rhel_rhel8_product }}"
url: "https://cdn.redhat.com/content/public/convert2rhel/8/x86_64/os/"
mirror_on_sync: true
verify_ssl_on_sync: true
download_policy: immediate
ssl_ca_cert: "Convert2RHEL CA"
Expand All @@ -64,7 +62,6 @@
content_type: "yum"
product: "{{ satellite_convert2rhel_oracle7_product }}"
url: "https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi/server/7/7Server/x86_64/os"
mirror_on_sync: true
verify_ssl_on_sync: true
download_policy: immediate
state: present
Expand All @@ -81,7 +78,6 @@
content_type: "yum"
product: "{{ satellite_convert2rhel_oracle8_product }}"
url: "https://cdn-ubi.redhat.com/content/public/ubi/dist/ubi8/8/x86_64/baseos/os/"
mirror_on_sync: true
verify_ssl_on_sync: true
download_policy: immediate
state: present
Expand Down
38 changes: 38 additions & 0 deletions roles/locations/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
theforeman.foreman.locations
===================================

This role creates and manages Foreman locations.

Role Variables
--------------

This role supports the [Common Role Variables](https://github.com/theforeman/foreman-ansible-modules/blob/develop/README.md#common-role-variables).

The main data structure for this role is the list of `foreman_locations`. Each `location` requires the following fields:

- `name`: The name of the location.

For all other fields, see the `location` module.

Example Playbook
----------------

Create the 'UK' location and set its parent to EMEA.

```yaml
- hosts: localhost
roles:
- role: theforeman.foreman.locations
vars:
foreman_server_url: https://foreman.example.com
foreman_username: "admin"
foreman_password: "changeme"
foreman_locations:
- name: UK
organisations:
- RedHat
parent: EMEA
parameters:
- name: system_location
value: UK
```
13 changes: 13 additions & 0 deletions roles/locations/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
- name: Create locations # noqa: args[module]
theforeman.foreman.location:
username: "{{ foreman_username | default(omit) }}"
password: "{{ foreman_password | default(omit) }}"
server_url: "{{ foreman_server_url | default(omit) }}"
validate_certs: "{{ foreman_validate_certs | default(omit) }}"
name: "{{ item.name }}"
parent: "{{ item.parent | default(omit) }}"
organizations: "{{ item.organizations | default(omit) }}"
parameters: "{{ item.parameters | default(omit) }}"
ignore_types: "{{ item.ignore_types | default(omit) }}"
loop: "{{ foreman_locations }}"
2 changes: 1 addition & 1 deletion tests/fixtures/apidoc/katello.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tests/fixtures/apidoc/locations_role.json
2 changes: 2 additions & 0 deletions tests/test_crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ def test_check_mode(tmpdir, module):

@pytest.mark.parametrize('module', INVENTORY_PLAYBOOKS)
def test_inventory(tmpdir, module):
if sys.version_info[0] == 2 and 'GITHUB_ACTIONS' in os.environ.keys():
pytest.skip("Inventory tests currently don't work inside a container, but Python2 tests require a container on GHA.")
inventory = [os.path.join(os.getcwd(), 'tests', 'inventory', inv) for inv in ['hosts', "{}.foreman.yml".format(module)]]
run = run_playbook(module, inventory=inventory)
assert run.rc == 0
Expand Down
Loading

0 comments on commit 5c6dcb8

Please sign in to comment.