diff --git a/changelogs/fragments/1738-export_chunk_size.yml b/changelogs/fragments/1738-export_chunk_size.yml new file mode 100644 index 0000000000..89b6b97b83 --- /dev/null +++ b/changelogs/fragments/1738-export_chunk_size.yml @@ -0,0 +1,2 @@ +minor_changes: + - content_export_* - document that ``chunk_size_gb`` parameter is only applicable for ``importable`` exports (https://github.com/theforeman/foreman-ansible-modules/issues/1738) diff --git a/plugins/doc_fragments/foreman.py b/plugins/doc_fragments/foreman.py index 0f33b3d1cf..4afd3b73d8 100644 --- a/plugins/doc_fragments/foreman.py +++ b/plugins/doc_fragments/foreman.py @@ -392,6 +392,7 @@ class ModuleDocFragment(object): chunk_size_gb: description: - Split the exported content into archives no greater than the specified size in gigabytes. + - Only applicable for C(format=importable). C(syncable) exports can't be split. required: false type: int format: diff --git a/plugins/module_utils/foreman_helper.py b/plugins/module_utils/foreman_helper.py index e6f6459631..30d4f017e2 100644 --- a/plugins/module_utils/foreman_helper.py +++ b/plugins/module_utils/foreman_helper.py @@ -1585,6 +1585,9 @@ def run(self, **kwargs): if self.params.get('from_history_id') and incremental is not True: self.fail_json(msg='from_history_id is only valid for incremental exports') + if 'chunk_size_gb' in self.foreman_params and self.foreman_params['format'] == 'syncable': + self.fail_json(msg='chunk_size_gb is only valid for importable exports') + self.auto_lookup_entities() payload = _flatten_entity(self.foreman_params, self.foreman_spec)