-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Release 3.14.0 #68
Merged
Release 3.14.0 #68
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9f33316
Bump version to 3.14.0-dev
evgeni b41b65e
add smart_class_parameter_override_value module
evgeni f0a9ced
add puppetclass/smart_class_parameter aliases to smart_class_parameter
evgeni 7dae292
Deprecate REX time span option
adamruzicka 6cc6283
add import_only to content_view module
evgeni 9e28a9f
Bump actions/checkout from 3 to 4
dependabot[bot] cad0b27
correctly pass `version` not `description` to the module
Griffin-Sullivan 3eef35c
ensure we test and document the lowest ansible possible
evgeni 9667a1d
also publish built artifact to github (#1665)
evgeni 84567b9
Release 3.14.0 (#1669)
evgeni cdbf4cd
correct version number in galaxy.yml for 3.14.0
evgeni 9ddbdb5
Merge tag 'v3.14.0' into rel3140
evgeni 5d997f9
make release workflow work for satellite collection
evgeni File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,8 +2,8 @@ name: release | |
|
||
on: | ||
push: | ||
branches-ignore: | ||
- '**' | ||
tags: | ||
- '[0-9]+.[0-9]+.[0-9]+' | ||
|
||
concurrency: | ||
group: ${{ github.ref_name }}-${{ github.workflow }} | ||
|
@@ -14,7 +14,7 @@ jobs: | |
runs-on: ubuntu-latest | ||
if: github.repository == 'RedHatSatellite/satellite-ansible-collection' | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
|
@@ -23,5 +23,7 @@ jobs: | |
run: pip install --upgrade ansible py | ||
- name: Build Ansible Collection | ||
run: make dist | ||
- name: Deploy Ansible Collection | ||
run: make publish GALAXY_API_KEY=${{ secrets.GALAXY_API_KEY }} | ||
Comment on lines
-26
to
-27
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we currently have no token to push to AH automatically |
||
- name: Create GitHub Release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: redhat-satellite-*.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,3 +30,4 @@ Lucas Bickel <[email protected]> <[email protected]> | |
Kenny Tordeurs <[email protected]> <[email protected]> | ||
Paul Armstrong <[email protected]> <[email protected]> | ||
Lukas Magauer <[email protected]> <[email protected]> | ||
Griffin Sullivan <[email protected]> <[email protected]> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -98,7 +98,7 @@ authors: | |
- "russianguppie <[email protected]>" | ||
- "willtome <[email protected]>" | ||
- "yuqo2450 <[email protected]>" | ||
version: "3.13.0" | ||
version: "3.14.0" | ||
license: | ||
- "GPL-3.0-or-later" | ||
tags: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
131 changes: 131 additions & 0 deletions
131
plugins/modules/smart_class_parameter_override_value.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
#!/usr/bin/python | ||
# -*- coding: utf-8 -*- | ||
# (c) 2023 Evgeni Golov <[email protected]> | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
from __future__ import absolute_import, division, print_function | ||
__metaclass__ = type | ||
|
||
|
||
DOCUMENTATION = ''' | ||
--- | ||
module: smart_class_parameter_override_value | ||
version_added: 3.14.0 | ||
short_description: Manage Smart Class Parameter Override Values | ||
description: | ||
- Manage Smart Class Parameter Override Values | ||
author: | ||
- "Evgeni Golov (@evgeni)" | ||
options: | ||
puppetclass: | ||
description: | ||
- Puppet Class the Smart Class Parameter belongs to | ||
type: str | ||
required: true | ||
aliases: | ||
- puppetclass_name | ||
smart_class_parameter: | ||
description: | ||
- Smart Class Parameter the Override Value belongs to | ||
required: true | ||
type: str | ||
aliases: | ||
- parameter | ||
match: | ||
description: | ||
- Override match | ||
required: true | ||
type: str | ||
omit: | ||
description: | ||
- Foreman will not send this parameter in classification output | ||
required: false | ||
type: bool | ||
value: | ||
description: | ||
- Override value, required if omit is false | ||
required: false | ||
type: raw | ||
|
||
extends_documentation_fragment: | ||
- redhat.satellite.foreman | ||
- redhat.satellite.foreman.entity_state | ||
''' | ||
|
||
EXAMPLES = ''' | ||
- name: Set ntp::servers override value | ||
redhat.satellite.smart_class_parameter_override_value: | ||
server_url: "https://satellite.example.com" | ||
username: "admin" | ||
password: "changeme" | ||
puppetclass: ntp | ||
smart_class_parameter: servers | ||
match: domain=example.org | ||
value: | ||
- ntp1.example.org | ||
- ntp2.example.org | ||
state: present | ||
''' | ||
|
||
RETURN = ''' | ||
entity: | ||
description: Final state of the affected entities grouped by their type. | ||
returned: success | ||
type: dict | ||
contains: | ||
override_values: | ||
description: List of override_values. | ||
type: list | ||
elements: dict | ||
''' | ||
|
||
from ansible_collections.redhat.satellite.plugins.module_utils.foreman_helper import ForemanEntityAnsibleModule, parameter_value_to_str | ||
|
||
|
||
class ForemanOverrideValueModule(ForemanEntityAnsibleModule): | ||
pass | ||
|
||
|
||
def main(): | ||
module = ForemanOverrideValueModule( | ||
foreman_spec=dict( | ||
puppetclass=dict(required=True, type='entity', ensure=False, aliases=['puppetclass_name']), | ||
smart_class_parameter=dict(required=True, type='entity', scope=['puppetclass'], search_by='parameter', aliases=['parameter']), | ||
match=dict(required=True, type='str'), | ||
value=dict(required=False, type='raw'), | ||
omit=dict(required=False, type='bool'), | ||
), | ||
) | ||
|
||
module_params = module.foreman_params | ||
|
||
with module.api_connection(): | ||
scp = module.lookup_entity('smart_class_parameter') | ||
parameter_type = scp.get('parameter_type', 'string') | ||
scope = {'smart_class_parameter_id': scp['id']} | ||
override_values = module.list_resource('override_values', params=scope) | ||
entity = next((ov for ov in override_values if ov['match'] == module_params['match']), None) | ||
if entity is not None: | ||
# this is a hack, otherwise update_entity() tries to update that | ||
entity['smart_class_parameter_id'] = scp['id'] | ||
entity['value'] = parameter_value_to_str(entity['value'], parameter_type) | ||
module.set_entity('entity', entity) | ||
if 'value' in module_params: | ||
module_params['value'] = parameter_value_to_str(module_params['value'], parameter_type) | ||
module.ensure_entity('override_values', module_params, entity, params=scope) | ||
|
||
|
||
if __name__ == '__main__': | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
tests/fixtures/apidoc/smart_class_parameter_override_value.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
foreman.json |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this was previously completely disabled