diff --git a/changelogs/fragments/1676-content_view_version-async-poll.yml b/changelogs/fragments/1676-content_view_version-async-poll.yml new file mode 100644 index 0000000000..e129960bfe --- /dev/null +++ b/changelogs/fragments/1676-content_view_version-async-poll.yml @@ -0,0 +1,2 @@ +minor_changes: + - content_view_publish role - allow passing ``async`` and ``poll`` to the module (https://github.com/theforeman/foreman-ansible-modules/pull/1676) diff --git a/roles/content_view_publish/README.md b/roles/content_view_publish/README.md index 84953da68a..fd86348db9 100644 --- a/roles/content_view_publish/README.md +++ b/roles/content_view_publish/README.md @@ -12,6 +12,11 @@ This role supports the [Common Role Variables](https://github.com/theforeman/for - `foreman_content_views`: List of Content Views to publish. It can be either a list of Content View names or a list of dictionaries with the parameters as accepted by the `content_view_version` module or the `content_views` role. +### Optional + +- `foreman_content_view_publish_async`: Asynchronous mode lets you control how long-running tasks execute. See the [Ansible documentation](https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_async.html#asynchronous-playbook-tasks) for details. +- `foreman_content_view_publish_poll`: For asynchronous tasks, this is how often to check back on the status of those tasks. + Example Playbook ---------------- diff --git a/roles/content_view_publish/tasks/main.yml b/roles/content_view_publish/tasks/main.yml index 90f8ef5bc0..977c9dbc90 100644 --- a/roles/content_view_publish/tasks/main.yml +++ b/roles/content_view_publish/tasks/main.yml @@ -13,6 +13,8 @@ force_promote: "{{ content_view.force_promote | default(omit) }}" force_yum_metadata_regeneration: "{{ content_view.force_yum_metadata_regeneration | default(omit) }}" current_lifecycle_environment: "{{ content_view.current_lifecycle_environment | default(omit) }}" + async: "{{ foreman_content_view_publish_async | default(omit) }}" + poll: "{{ foreman_content_view_publish_poll | default(omit) }}" loop: "{{ foreman_content_views }}" loop_control: loop_var: "content_view"