File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 11---
22- hosts : satellite6
3- gather_facts : False
3+ gather_facts : false
44 tasks :
55 - name : " Run 'hammer host list' command"
66 ansible.builtin.shell :
77 hammer -u "{{ sat_user }}" -p "{{ sat_pass }}" host list --organization "{{ organization }}" --page 1 --per-page 100 >/dev/null
8- register : run_hammer
9- loop : " {{ range(30)|list }}"
108 environment :
119 TZ : UTC
10+ register : run_hammer
11+ loop : " {{ range(30) | list }}"
1212
1313 - name : " Calculate command duration"
1414 ansible.builtin.set_fact :
15- run_hammer_duration : " {{ (run_hammer.end | to_datetime('%Y-%m-%d %H:%M:%S.%f')).timestamp() - (run_hammer.start | to_datetime('%Y-%m-%d %H:%M:%S.%f')).timestamp() }}"
15+ combined : " {{ combined + [item | combine( { 'duration': (item.end | to_datetime('%Y-%m-%d %H:%M:%S.%f')).timestamp() - (item.start | to_datetime('%Y-%m-%d %H:%M:%S.%f')).timestamp() } )] }}"
16+ vars :
17+ combined : []
18+ loop : " {{ run_hammer.results }}"
1619
1720 - name : " Print results"
1821 ansible.builtin.debug :
19- msg : " HammerHostList {{ item.start }} to {{ item.end }} taking {{ run_hammer_duration }} seconds"
20- loop : " {{ run_hammer.results }}"
22+ msg : " HammerHostList {{ item.start }} to {{ item.end }} taking {{ item.duration }} seconds"
23+ loop : " {{ combined }}"
24+ ...
You can’t perform that action at this time.
0 commit comments