Skip to content

Commit

Permalink
repository - add support for mirroring_policy for Katello 4.4+
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Apr 29, 2022
1 parent 2d9f1a2 commit aa8abee
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions changelogs/fragments/1388-repository-mirroring_policy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- repository - add support for ``mirroring_policy`` for Katello 4.4+ (https://github.com/theforeman/foreman-ansible-modules/issues/1388)
18 changes: 16 additions & 2 deletions plugins/modules/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,19 @@
mirror_on_sync:
description:
- toggle "mirror on sync" where the state of the repository mirrors that of the upstream repository at sync time
default: true
- This is deprecated with Katello 4.4
- It has been superseeded by I(mirroring_policy=mirror_content_only)
type: bool
required: false
mirroring_policy:
description:
- Policy to set for mirroring content
- Supported since Katello 4.4
type: str
choices:
- additive
- mirror_content_only
- mirror_complete
verify_ssl_on_sync:
description:
- verify the upstream certifcates are signed by a trusted CA
Expand Down Expand Up @@ -302,7 +312,8 @@ def main():
ssl_client_key=dict(type='entity', resource_type='content_credentials', scope=['organization'], no_log=False),
download_policy=dict(choices=['background', 'immediate', 'on_demand']),
download_concurrency=dict(type='int'),
mirror_on_sync=dict(type='bool', default=True),
mirror_on_sync=dict(type='bool'),
mirroring_policy=dict(type='str', choices=['additive', 'mirror_content_only', 'mirror_complete']),
verify_ssl_on_sync=dict(type='bool'),
upstream_username=dict(),
upstream_password=dict(no_log=True),
Expand All @@ -321,6 +332,9 @@ def main():
os_versions=dict(type='list', elements='str', choices=['rhel-6', 'rhel-7', 'rhel-8']),
arch=dict(),
),
mutually_exclusive=[
['mirror_on_sync', 'mirroring_policy']
],
argument_spec=dict(
state=dict(default='present', choices=['present_with_defaults', 'present', 'absent']),
),
Expand Down

0 comments on commit aa8abee

Please sign in to comment.