Skip to content

Commit

Permalink
Merge pull request #66 from RedHatSatellite/rel3130
Browse files Browse the repository at this point in the history
Release 3.13.0
  • Loading branch information
evgeni authored Aug 23, 2023
2 parents cd64176 + 9002706 commit 028afaf
Show file tree
Hide file tree
Showing 109 changed files with 5,326 additions and 3,234 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,21 @@ jobs:
name: docs-html
path: docs/_build/html/

galaxy-importer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.11"
cache: 'pip'
cache-dependency-path: '**/requirements*.txt'
- name: Install dependencies
run: pip install --upgrade py galaxy-importer
- name: Run galaxy-importer
run: make galaxy-importer

lint:
runs-on: ubuntu-latest
steps:
Expand Down
20 changes: 20 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,26 @@ redhat.satellite Release Notes

This changelog describes changes after version 0.8.1.

v3.13.0
=======

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

- compute_resource - add support for OpenStack
- repositories role - allow disabling/removing of repositories by setting the ``state`` parameter

Bugfixes
--------

- repository - don't fail when removing a content credential from a repository (https://bugzilla.redhat.com/show_bug.cgi?id=2224122)
- smart_class_parameter - correctly allow setting ``override`` to ``false`` (https://github.com/theforeman/foreman-ansible-modules/issues/1644)

New Modules
-----------

- redhat.satellite.wait_for_task - Wait for a task

v3.12.0
=======

Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@ lint: $(MANIFEST) $(RUNTIME_YML) | tests/test_playbooks/vars/server.yml
ansible-lint -v --offline roles/*
ansible-playbook --syntax-check tests/test_playbooks/*.yml | grep -v '^$$'
flake8 --ignore=E402,W503 --max-line-length=160 plugins/ tests/
GALAXY_IMPORTER_CONFIG=tests/galaxy-importer.cfg python -m galaxy_importer.main $(NAMESPACE)-$(NAME)-$(VERSION).tar.gz
@echo "Check that there are no changes to $(RUNTIME_YML)"
git diff --exit-code $(RUNTIME_YML)

galaxy-importer: $(MANIFEST)
GALAXY_IMPORTER_CONFIG=tests/galaxy-importer.cfg python -m galaxy_importer.main $(NAMESPACE)-$(NAME)-$(VERSION).tar.gz

sanity: $(MANIFEST)
# Fake a fresh git repo for ansible-test
cd $(<D) ; git init ; echo tests > .gitignore ; ansible-test sanity $(SANITY_OPTS) --python $(PYTHON_VERSION)
Expand Down
21 changes: 21 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,27 @@ releases:
- 2023-06-26-forgotten-changelogs.yml
- content_view_filter_deb_support.yml
release_date: '2023-07-10'
3.13.0:
changes:
bugfixes:
- repository - don't fail when removing a content credential from a repository
(https://bugzilla.redhat.com/show_bug.cgi?id=2224122)
- smart_class_parameter - correctly allow setting ``override`` to ``false``
(https://github.com/theforeman/foreman-ansible-modules/issues/1644)
minor_changes:
- compute_resource - add support for OpenStack
- repositories role - allow disabling/removing of repositories by setting the
``state`` parameter
fragments:
- 1641-openstack.yml
- 1644-smart_class_parameter-override_false.yml
- bz2224122-repo-org-scope.yml
- repositories_role-state_override.yml
modules:
- description: Wait for a task
name: wait_for_task
namespace: ''
release_date: '2023-08-15'
3.2.0:
changes:
bugfixes:
Expand Down
7 changes: 6 additions & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ authors:
- "Adam Růžička <[email protected]>"
- "Alan.Wong <[email protected]>"
- "AlanCoding <[email protected]>"
- "Andrea Perotti <[email protected]>"
- "Andrew Kofink <[email protected]>"
- "Anthony Green <[email protected]>"
- "Anton <[email protected]>"
Expand Down Expand Up @@ -39,6 +40,7 @@ authors:
- "Jesper Reenberg <[email protected]>"
- "John Berninger <[email protected]>"
- "Josh Swanson <[email protected]>"
- "Julien Godin <[email protected]>"
- "Kenny Tordeurs <[email protected]>"
- "Kirill Shirinkin <[email protected]>"
- "Leos Stejskal <[email protected]>"
Expand Down Expand Up @@ -77,11 +79,13 @@ authors:
- "Sorin Sbarnea <[email protected]>"
- "Steffen Frömer <[email protected]>"
- "Stoned Elipot <[email protected]>"
- "Sven Meeus <[email protected]>"
- "TTherouanne <[email protected]>"
- "Thomas Mueller <[email protected]>"
- "William Bradford Clark <[email protected]>"
- "Yifat Makias <[email protected]>"
- "achevalet <[email protected]>"
- "alesc <[email protected]>"
- "bob <[email protected]>"
- "calvingsmith <[email protected]>"
- "divialth <[email protected]>"
Expand All @@ -93,7 +97,8 @@ authors:
- "metalcated <[email protected]>"
- "russianguppie <[email protected]>"
- "willtome <[email protected]>"
version: "3.12.0"
- "yuqo2450 <[email protected]>"
version: "3.13.0"
license:
- "GPL-3.0-or-later"
tags:
Expand Down
1 change: 1 addition & 0 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ action_groups:
- templates_import
- user
- usergroup
- wait_for_task
plugin_routing:
modules:
foreman_architecture:
Expand Down
48 changes: 35 additions & 13 deletions plugins/inventory/foreman.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
- requests >= 1.1
description:
- Get inventory hosts from Foreman.
- Can use the Reports API (default) or the Hosts API to fetch information about the hosts.
- The Reports API is faster with many hosts.
- The Reports API requires the C(foreman_ansible) plugin to be installed on the Foreman server.
- Some options only work when using the Reports API.
- Uses a YAML configuration file that ends with ``foreman.(yml|yaml)``.
extends_documentation_fragment:
- inventory_cache
Expand Down Expand Up @@ -85,13 +89,13 @@
type: int
default: 250
use_reports_api:
description: Use Reporting API.
description: Use Reports API.
type: boolean
default: true
foreman:
description:
- Foreman server related configuration, deprecated.
- You can pass I(use_reports_api) in this dict to enable the Reporting API.
- You can pass I(use_reports_api) in this dict to enable the Reports API.
- Only for backward compatibility.
report:
description:
Expand All @@ -108,39 +112,57 @@
type: int
default: 600
want_organization:
description: Toggle, if true the inventory will fetch organization the host belongs to and create groupings for the same.
description:
- Toggle, if true the inventory will fetch organization the host belongs to and create groupings for the same.
- Only applies to inventories using the Reports API - attribute is ignored otherwise.
type: boolean
default: true
want_location:
description: Toggle, if true the inventory will fetch location the host belongs to and create groupings for the same.
description:
- Toggle, if true the inventory will fetch location the host belongs to and create groupings for the same.
- Only applies to inventories using the Reports API - attribute is ignored otherwise.
type: boolean
default: true
want_ipv4:
description: Toggle, if true the inventory will fetch ipv4 address of the host.
description:
- Toggle, if true the inventory will fetch ipv4 address of the host.
- Only applies to inventories using the Reports API - attribute is ignored otherwise.
type: boolean
default: true
want_ipv6:
description: Toggle, if true the inventory will fetch ipv6 address of the host.
description:
- Toggle, if true the inventory will fetch ipv6 address of the host.
- Only applies to inventories using the Reports API - attribute is ignored otherwise.
type: boolean
default: true
want_host_group:
description: Toggle, if true the inventory will fetch host_groups and create groupings for the same.
description:
- Toggle, if true the inventory will fetch host_groups and create groupings for the same.
- Only applies to inventories using the Reports API - attribute is ignored otherwise.
type: boolean
default: true
want_subnet:
description: Toggle, if true the inventory will fetch subnet.
description:
- Toggle, if true the inventory will fetch subnet.
- Only applies to inventories using the Reports API - attribute is ignored otherwise.
type: boolean
default: true
want_subnet_v6:
description: Toggle, if true the inventory will fetch ipv6 subnet.
description:
- Toggle, if true the inventory will fetch ipv6 subnet.
- Only applies to inventories using the Reports API - attribute is ignored otherwise.
type: boolean
default: true
want_smart_proxies:
description: Toggle, if true the inventory will fetch smart proxy that the host is registered to.
description:
- Toggle, if true the inventory will fetch smart proxy that the host is registered to.
- Only applies to inventories using the Reports API - attribute is ignored otherwise.
type: boolean
default: true
want_content_facet_attributes:
description: Toggle, if true the inventory will fetch content view details that the host is tied to.
description:
- Toggle, if true the inventory will fetch content view details that the host is tied to.
- Only applies to inventories using the Reports API - attribute is ignored otherwise.
type: boolean
default: true
hostnames:
Expand Down Expand Up @@ -196,7 +218,7 @@ class InventoryModule(BaseInventoryPlugin, Cacheable, Constructable):
def __init__(self):

super(InventoryModule, self).__init__()
self.MINIMUM_FOREMAN_VERSION_FOR_REPORTING_API = '1.24.0'
self.MINIMUM_FOREMAN_VERSION_FOR_REPORTS_API = '1.24.0'
# from config
self.foreman_url = None

Expand Down Expand Up @@ -377,7 +399,7 @@ def _use_inventory_report(self):
return False
status_url = "%s/api/v2/status" % self.foreman_url
result = self._get_json(status_url)
foreman_version = (LooseVersion(result.get('version')) >= LooseVersion(self.MINIMUM_FOREMAN_VERSION_FOR_REPORTING_API))
foreman_version = (LooseVersion(result.get('version')) >= LooseVersion(self.MINIMUM_FOREMAN_VERSION_FOR_REPORTS_API))
return foreman_version

def _post_request(self):
Expand Down
2 changes: 1 addition & 1 deletion plugins/module_utils/_apypie.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from __future__ import absolute_import, division, print_function
__metaclass__ = type
try:
from typing import Any, Iterable, List, Optional, Tuple # pylint: disable=unused-import
from typing import Any, Iterable, List, Optional, Tuple # pylint: disable=unused-import # noqa: F401
except ImportError:
pass

Expand Down
18 changes: 18 additions & 0 deletions plugins/module_utils/foreman_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -575,6 +575,21 @@ def _patch_organization_ignore_types_api(self):
_organization_create['params'].append(_ignore_types_param)
_organization_update['params'].append(_ignore_types_param)

@_check_patch_needed(fixed_version='3.8.0', plugins=['katello'])
def _patch_products_repositories_allow_nil_credential(self):
"""
This is a workaround for the missing allow_nil: true in the Products and Repositories controllers
See https://projects.theforeman.org/issues/36497
"""

for resource in ['products', 'repositories']:
methods = self.foremanapi.apidoc['docs']['resources'][resource]['methods']
for action in ['create', 'update']:
resource_action = next(x for x in methods if x['name'] == action)
for param in ['gpg_key_id', 'ssl_ca_cert_id', 'ssl_client_cert_id', 'ssl_client_key_id']:
resource_param = next(x for x in resource_action['params'] if x['name'] == param)
resource_param['allow_nil'] = True

def check_requirements(self):
if not HAS_APYPIE:
self.fail_json(msg=missing_required_lib("requests"), exception=APYPIE_IMP_ERR)
Expand Down Expand Up @@ -620,6 +635,7 @@ def apply_apidoc_patches(self):
self._patch_cv_filter_rule_api()
self._patch_ak_product_content_per_page()
self._patch_organization_ignore_types_api()
self._patch_products_repositories_allow_nil_credential()

@_exception2fail_json(msg="Failed to connect to Foreman server: {0}")
def status(self):
Expand Down Expand Up @@ -842,6 +858,8 @@ def lookup_entity(self, key, params=None):
return result

def _lookup_entity(self, identifier, entity_spec, params=None):
if identifier is NoEntity:
return NoEntity
resource_type = entity_spec['resource_type']
failsafe = entity_spec.get('failsafe', False)
thin = entity_spec.get('thin', True)
Expand Down
Loading

0 comments on commit 028afaf

Please sign in to comment.