From 3211f844f05a6eb29f4070219927888368793fe4 Mon Sep 17 00:00:00 2001
From: linuxonfire <jaimescampositzel@gmail.com>
Date: Fri, 13 Oct 2023 07:37:45 -0600
Subject: [PATCH 1/5] Add to content_view_version versions asynchronical with a
 poll interval

patch to be able to Publish content_view versions asynchronical with a poll interval via the variables:

content_view_async
content_view_poll
---
 roles/content_view_publish/tasks/main.yml | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/roles/content_view_publish/tasks/main.yml b/roles/content_view_publish/tasks/main.yml
index 90f8ef5bc0..d68badb374 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: "{{ content_view_async | default(omit) }}"
+    poll: "{{ content_view_poll | default(omit) }}"
   loop: "{{ foreman_content_views }}"
   loop_control:
     loop_var: "content_view"

From f5362b250c556f156cc5c3e48956feaacf582f93 Mon Sep 17 00:00:00 2001
From: linuxonfire <jaimescampositzel@gmail.com>
Date: Tue, 24 Oct 2023 04:09:22 -0600
Subject: [PATCH 2/5] Update main.yml

update of variables foreman_content_view_publish_async and foreman_content_view_publish_poll
---
 roles/content_view_publish/tasks/main.yml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/roles/content_view_publish/tasks/main.yml b/roles/content_view_publish/tasks/main.yml
index d68badb374..977c9dbc90 100644
--- a/roles/content_view_publish/tasks/main.yml
+++ b/roles/content_view_publish/tasks/main.yml
@@ -13,8 +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: "{{ content_view_async | default(omit) }}"
-    poll: "{{ content_view_poll | 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"

From 6da5b1f7084aca34a0cbe71384939b7e304b976b Mon Sep 17 00:00:00 2001
From: linuxonfire <jaimescampositzel@gmail.com>
Date: Tue, 24 Oct 2023 04:31:36 -0600
Subject: [PATCH 3/5] Create 1676-content_view_version-async-poll.yml

content_view_version role adding foreman_content_view_publish_async and foreman_content_view_publish_poll
---
 changelogs/fragments/1676-content_view_version-async-poll.yml | 4 ++++
 1 file changed, 4 insertions(+)
 create mode 100644 changelogs/fragments/1676-content_view_version-async-poll.yml

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..cb857afa0a
--- /dev/null
+++ b/changelogs/fragments/1676-content_view_version-async-poll.yml
@@ -0,0 +1,4 @@
+minor_changes:
+  - content_view_version role adding foreman_content_view_publish_async and foreman_content_view_publish_poll (https://github.com/theforeman/foreman-ansible-modules/pull/1676)
+
+

From 3af9dfeb1a7c4f288f32a449fbdc02afcd18e97a Mon Sep 17 00:00:00 2001
From: linuxonfire <jaimescampositzel@gmail.com>
Date: Tue, 24 Oct 2023 05:47:32 -0600
Subject: [PATCH 4/5] Update README.md

Adding optional variables foreman_content_view_publish_async and foreman_content_view_publish_poll
---
 roles/content_view_publish/README.md | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/roles/content_view_publish/README.md b/roles/content_view_publish/README.md
index 84953da68a..71824f7c08 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.The default is 5 seconds. This can be too low on slower systems, or systems under heavy load.
+- `foreman_content_view_publish_poll`:  For asynchronous tasks in this is how often to check back on the status of those tasks when an explicit poll interval is not supplied. The default is a reasonably moderate 15 seconds which is a tradeoff between checking in frequently and providing a quick turnaround when something may have completed.
+  
 Example Playbook
 ----------------
 

From 2089bb0323db2b0221c57f68b242171cd9dc6e8c Mon Sep 17 00:00:00 2001
From: Evgeni Golov <evgeni@golov.de>
Date: Tue, 24 Oct 2023 14:47:37 +0200
Subject: [PATCH 5/5] Apply suggestions from code review

---
 changelogs/fragments/1676-content_view_version-async-poll.yml | 4 +---
 roles/content_view_publish/README.md                          | 4 ++--
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/changelogs/fragments/1676-content_view_version-async-poll.yml b/changelogs/fragments/1676-content_view_version-async-poll.yml
index cb857afa0a..e129960bfe 100644
--- a/changelogs/fragments/1676-content_view_version-async-poll.yml
+++ b/changelogs/fragments/1676-content_view_version-async-poll.yml
@@ -1,4 +1,2 @@
 minor_changes:
-  - content_view_version role adding foreman_content_view_publish_async and foreman_content_view_publish_poll (https://github.com/theforeman/foreman-ansible-modules/pull/1676)
-
-
+  - 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 71824f7c08..fd86348db9 100644
--- a/roles/content_view_publish/README.md
+++ b/roles/content_view_publish/README.md
@@ -14,8 +14,8 @@ This role supports the [Common Role Variables](https://github.com/theforeman/for
 
 ### Optional  
 
-- `foreman_content_view_publish_async`: Asynchronous mode lets you control how long-running tasks execute.The default is 5 seconds. This can be too low on slower systems, or systems under heavy load.
-- `foreman_content_view_publish_poll`:  For asynchronous tasks in this is how often to check back on the status of those tasks when an explicit poll interval is not supplied. The default is a reasonably moderate 15 seconds which is a tradeoff between checking in frequently and providing a quick turnaround when something may have completed.
+- `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
 ----------------