Skip to content

Commit 267261b

Browse files
authored
Merge pull request #105 from RedHatSatellite/rel570
Release 5.7.0
2 parents a0016a6 + dd71876 commit 267261b

28 files changed

Lines changed: 917 additions & 405 deletions

.github/workflows/codeql-analysis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ jobs:
2929
uses: actions/checkout@v5
3030

3131
- name: Initialize CodeQL
32-
uses: github/codeql-action/init@v3
32+
uses: github/codeql-action/init@v4
3333
with:
3434
languages: ${{ matrix.language }}
3535

3636
- name: Perform CodeQL Analysis
37-
uses: github/codeql-action/analyze@v3
37+
uses: github/codeql-action/analyze@v4

.github/workflows/main.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ jobs:
2222
- stable-2.17
2323
- stable-2.18
2424
- stable-2.19
25+
- stable-2.20
2526
- devel
2627

2728
runs-on: ubuntu-24.04
@@ -52,6 +53,7 @@ jobs:
5253
- stable-2.17
5354
- stable-2.18
5455
- stable-2.19
56+
- stable-2.20
5557
- devel
5658
include:
5759
- python: "3.8"
@@ -74,6 +76,8 @@ jobs:
7476
ansible: "stable-2.15"
7577
- python: "3.13"
7678
ansible: "devel"
79+
- python: "3.14"
80+
ansible: "devel"
7781
steps:
7882
- uses: actions/checkout@v5
7983
- name: Set up Python

.mailmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Baptiste Agasse <baptiste.agasse@gmail.com> <bagasse@redhat.com>
88
Christoffer Reijer <ephracis@gmail.com> <christoffer.reijer@basalt.se>
99
Christoffer Reijer <ephracis@gmail.com> <preijer@redhat.com>
1010
Eric D. Helms <ericdhelms@gmail.com> <eric.d.helms@gmail.com>
11+
Evgeni Golov <evgeni@golov.de> <evgeni@redhat.com>
1112
Manisha Singhal <manisha1595@gmail.com> <singhal@atix.de>
1213
Matthias Dellweg <2500@gmx.de> <mdellweg@redhat.com>
1314
Matthias Dellweg <2500@gmx.de> <dellweg@atix.de>

CHANGELOG.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ redhat.satellite Release Notes
66

77
This changelog describes changes after version 0.8.1.
88

9+
v5.7.0
10+
======
11+
12+
New Modules
13+
-----------
14+
15+
- redhat.satellite.content_view_history_info - Fetch history of a Content View
16+
917
v5.6.0
1018
======
1119

changelogs/changelog.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1006,3 +1006,9 @@ releases:
10061006
- registration_command - clarify example to show where the generated command
10071007
needs to be executed
10081008
release_date: '2025-09-16'
1009+
5.7.0:
1010+
modules:
1011+
- description: Fetch history of a Content View
1012+
name: content_view_history_info
1013+
namespace: ''
1014+
release_date: '2025-10-14'

galaxy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ authors:
123123
- "russianguppie <46544650+russianguppie@users.noreply.github.com>"
124124
- "willtome <willtome@gmail.com>"
125125
- "yuqo2450 <79540477+yuqo2450@users.noreply.github.com>"
126-
version: "5.6.0"
126+
version: "5.7.0"
127127
license:
128128
- "GPL-3.0-or-later"
129129
tags:

meta/runtime.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ action_groups:
2424
- content_view_filter_info
2525
- content_view_filter_rule
2626
- content_view_filter_rule_info
27+
- content_view_history_info
2728
- content_view_info
2829
- content_view_version
2930
- content_view_version_info
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
#!/usr/bin/python
2+
# -*- coding: utf-8 -*-
3+
# (c) Evgeni Golov
4+
#
5+
# This program is free software: you can redistribute it and/or modify
6+
# it under the terms of the GNU General Public License as published by
7+
# the Free Software Foundation, either version 3 of the License, or
8+
# (at your option) any later version.
9+
#
10+
# This program is distributed in the hope that it will be useful,
11+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
# GNU General Public License for more details.
14+
#
15+
# You should have received a copy of the GNU General Public License
16+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
18+
from __future__ import absolute_import, division, print_function
19+
__metaclass__ = type
20+
21+
22+
DOCUMENTATION = '''
23+
---
24+
module: content_view_history_info
25+
version_added: 5.7.0
26+
short_description: Fetch history of a Content View
27+
description:
28+
- Fetch history of a Content View
29+
author:
30+
- "Evgeni Golov (@evgeni)"
31+
options:
32+
content_view:
33+
description:
34+
- Content view to get the history for
35+
required: true
36+
type: str
37+
38+
extends_documentation_fragment:
39+
- redhat.satellite.foreman
40+
- redhat.satellite.foreman.katelloinfomodule
41+
- redhat.satellite.foreman.infomodulewithoutname
42+
'''
43+
44+
EXAMPLES = '''
45+
- name: "Show history of CentOS Stream CV"
46+
redhat.satellite.content_view_history_info:
47+
username: "admin"
48+
password: "changeme"
49+
server_url: "https://satellite.example.com"
50+
organization: "Default Organization"
51+
content_view: "CentOS Stream"
52+
'''
53+
54+
RETURN = '''
55+
content_view_histories:
56+
description: History of the Content View
57+
returned: success
58+
type: list
59+
elements: dict
60+
'''
61+
62+
from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import KatelloInfoAnsibleModule
63+
64+
65+
class KatelloContentViewHistoryInfo(KatelloInfoAnsibleModule):
66+
pass
67+
68+
69+
def main():
70+
module = KatelloContentViewHistoryInfo(
71+
foreman_spec=dict(
72+
content_view=dict(required=True, scope=['organization'], type='entity', flat_name='id'),
73+
name=dict(invisible=True),
74+
),
75+
)
76+
77+
with module.api_connection():
78+
module.run()
79+
80+
81+
if __name__ == '__main__':
82+
main()

plugins/modules/resource_info.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,12 @@ def main():
148148

149149
with module.api_connection():
150150
if resource not in module.foremanapi.resources:
151-
msg = "Resource '{0}' does not exist in the API. Existing resources: {1}".format(resource, ', '.join(sorted(module.foremanapi.resources)))
151+
existing_resources = [
152+
resource for resource in module.foremanapi.resources
153+
if module.foremanapi.resource(resource).has_action('index')
154+
and module.foremanapi.resource(resource).has_action('show')
155+
]
156+
msg = "Resource '{0}' does not exist in the API. Existing resources: {1}".format(resource, ', '.join(sorted(existing_resources)))
152157
module.fail_json(msg=msg)
153158
if 'organization' in module_params:
154159
params['organization_id'] = module.find_resource_by_name('organizations', module_params['organization'], thin=True)['id']

roles/content_views/tasks/_create_content_view.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
- name: Create content view # noqa: args[module]
2+
- name: Create or delete content view # noqa: args[module]
33
redhat.satellite.content_view:
44
username: "{{ satellite_username | default(omit) }}"
55
password: "{{ satellite_password | default(omit) }}"
@@ -14,6 +14,7 @@
1414
label: "{{ content_view.label | default(omit) }}"
1515
repositories: "{{ content_view.repositories | default(omit) }}"
1616
solve_dependencies: "{{ content_view.solve_dependencies | default(omit) }}"
17+
state: "{{ content_view.state | default('present') }}"
1718

1819
- name: Add content view filters
1920
redhat.satellite.content_view_filter:
@@ -31,6 +32,8 @@
3132
filter_state: "{{ item.filter_state | default(omit) }}"
3233
original_packages: "{{ item.original_packages | default(omit) }}"
3334
original_module_streams: "{{ item.original_module_streams | default(omit) }}"
35+
when:
36+
- content_view.state is not defined or content_view.state != 'absent'
3437
loop: "{{ content_view.filters | default([]) }}"
3538

3639
- name: Add content view filters rules
@@ -53,4 +56,6 @@
5356
version: "{{ item.version | default(omit) }}"
5457
architecture: "{{ item.architecture | default(omit) }}"
5558
rule_state: "{{ item.rule_state | default(omit) }}"
59+
when:
60+
- content_view.state is not defined or content_view.state != 'absent'
5661
loop: "{{ content_view.filters | default([]) }}"

0 commit comments

Comments
 (0)