Skip to content

Commit

Permalink
Merge pull request #34 from RedHatSatellite/rel220
Browse files Browse the repository at this point in the history
release 2.2.0
  • Loading branch information
evgeni authored Sep 1, 2021
2 parents f2a0ce0 + 70db2bc commit 9509b46
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 6 deletions.
13 changes: 13 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ redhat.satellite Release Notes

This changelog describes changes after version 0.8.1.

v2.2.0
======

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

- repository - add support for filtering repositories by OS version based on API feature apidoc/v2/repositories/create.html

Bugfixes
--------

- host, hostgroup - don't accidentally duplicate ``kt_activation_keys`` param (https://github.com/theforeman/foreman-ansible-modules/issues/1268)

v2.1.2
======

Expand Down
12 changes: 12 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -490,3 +490,15 @@ releases:
- bz1980274.yml
- katello41-subscription-org-required.yml
release_date: '2021-07-13'
2.2.0:
changes:
bugfixes:
- host, hostgroup - don't accidentally duplicate ``kt_activation_keys`` param
(https://github.com/theforeman/foreman-ansible-modules/issues/1268)
minor_changes:
- repository - add support for filtering repositories by OS version based on
API feature apidoc/v2/repositories/create.html
fragments:
- 1268-ak_param_duplicate.yml
- repository.yml
release_date: '2021-08-24'
4 changes: 3 additions & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ authors:
- "Olivier <[email protected]>"
- "Ondrej Prazak <[email protected]>"
- "Ondřej Ezr <[email protected]>"
- "Ondřej Gajdušek <[email protected]>"
- "Patrick C. F. Ernzer <[email protected]>"
- "Patrick Creech <[email protected]>"
- "Paul Armstrong <[email protected]>"
Expand All @@ -62,12 +63,13 @@ authors:
- "achevalet <[email protected]>"
- "calvingsmith <[email protected]>"
- "furhouse <[email protected]>"
- "igramic <[email protected]>"
- "jerrejkw <[email protected]>"
- "marco <[email protected]>"
- "metalcated <[email protected]>"
- "russianguppie <[email protected]>"
- "willtome <[email protected]>"
version: "2.1.2"
version: "2.2.0"
license:
- "GPL-3.0-or-later"
tags:
Expand Down
7 changes: 4 additions & 3 deletions plugins/module_utils/foreman_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,10 @@ def run(self, **kwargs):
ak_param = {'name': 'kt_activation_keys', 'parameter_type': 'string', 'value': self.foreman_params.pop('activation_keys')}
self.foreman_params['parameters'] = parameters + [ak_param]
elif 'parameters' in self.foreman_params and entity is not None:
ak_param = next((param for param in entity.get('parameters') if param['name'] == 'kt_activation_keys'), None)
if ak_param:
self.foreman_params['parameters'].append(ak_param)
current_ak_param = next((param for param in entity.get('parameters') if param['name'] == 'kt_activation_keys'), None)
desired_ak_param = next((param for param in self.foreman_params['parameters'] if param['name'] == 'kt_activation_keys'), None)
if current_ak_param and desired_ak_param is None:
self.foreman_params['parameters'].append(current_ak_param)

self.validate_parameters()

Expand Down
15 changes: 14 additions & 1 deletion plugins/modules/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,18 @@
- repositories will be automatically enabled on a registered host subscribed to this product
type: bool
required: false
os_versions:
description:
- Identifies whether the repository should be disabled on a client with a non-matching OS version.
- A maximum of one OS version can be selected.
- Set to C([]) to disable filtering again.
type: list
elements: str
required: false
choices:
- rhel-6
- rhel-7
- rhel-8
extends_documentation_fragment:
- redhat.satellite.foreman
- redhat.satellite.foreman.entity_state_with_defaults
Expand Down Expand Up @@ -292,6 +304,7 @@ def main():
ignorable_content=dict(type='list', elements='str'),
ansible_collection_requirements=dict(),
auto_enabled=dict(type='bool'),
os_versions=dict(type='list', elements='str', choices=['rhel-6', 'rhel-7', 'rhel-8']),
),
argument_spec=dict(
state=dict(default='present', choices=['present_with_defaults', 'present', 'absent']),
Expand Down Expand Up @@ -319,7 +332,7 @@ def main():
module.fail_json(msg="({0}) can only be used with content_type 'ansible_collection'".format(",".join(invalid_list)))

if module.foreman_params['content_type'] != 'yum':
invalid_list = [key for key in ['ignorable_content'] if key in module.foreman_params]
invalid_list = [key for key in ['ignorable_content', 'os_versions'] if key in module.foreman_params]
if invalid_list:
module.fail_json(msg="({0}) can only be used with content_type 'yum'".format(",".join(invalid_list)))

Expand Down
2 changes: 1 addition & 1 deletion roles/hostgroups/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
username: "{{ satellite_username | default(omit) }}"
password: "{{ satellite_password | default(omit) }}"
server_url: "{{ satellite_server_url | default(omit) }}"
validate_certs: "{{ validate_certs | default(omit) }}"
validate_certs: "{{ satellite_validate_certs | default(omit) }}"
name: "{{ item.name }}"
updated_name: "{{ item.updated_name | default(omit) }}"
description: "{{ item.description | default(omit) }}"
Expand Down

0 comments on commit 9509b46

Please sign in to comment.