Skip to content
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

Multiple task and requirements #309

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
8 changes: 8 additions & 0 deletions chatty_block.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
- name: send one message
ansible.builtin.debug:
msg: "{{ chatty_message | default('This is test message') }}"

- name: Pause for {{ pause_time_min | default('1') }} min.
ansible.builtin.pause:
minutes: "{{ pause_time_min | default('1') }}"
13 changes: 13 additions & 0 deletions chatty_multiple_tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
- hosts: all
gather_facts: false

vars:
num_messages: 50

tasks:

- name: Running {{ num_messages }} tasks
with_sequence: 'count={{ num_messages }}'
ansible.builtin.include_tasks:
file: single_task.yml
15 changes: 15 additions & 0 deletions chatty_payload_block.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
- hosts: all
gather_facts: false

vars:
message_size: 1024 #message size in Bytes[1KB]
num_messages: 10 #number of messages
chatty_message: "{{ '$' * message_size|int }}"

tasks:

- name: Running {{ num_messages }} tasks
with_sequence: 'count={{ num_messages }}'
ansible.builtin.include_tasks:
file: single_payload_task.yml
14 changes: 14 additions & 0 deletions chatty_sleep_tasks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
- hosts: all
gather_facts: no
vars:
message_size: 1048576 # message size in Bytes[1MB]
num_messages: 5 # number of messages
chatty_message: "{{ '$' * message_size|int }}"
pause_time_min: 65

tasks:

- name: Run a task an sleep
include_tasks: chatty_block.yml
with_sequence: "count={{ num_messages }}"
4 changes: 4 additions & 0 deletions single_payload_task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- name: Send single debug message
ansible.builtin.debug:
msg: "{{ chatty_message | default('This is test message') }}"
4 changes: 4 additions & 0 deletions single_task.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
- name: Running task number {{ item }}
ansible.builtin.debug:
msg: "This is a debug message for task number : {{ item }}"