mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Fixing multiple v2 bugs
This commit is contained in:
parent
4bc79a746a
commit
e82ba723e2
8 changed files with 115 additions and 95 deletions
10
v2/samples/test_free.yml
Normal file
10
v2/samples/test_free.yml
Normal file
|
@ -0,0 +1,10 @@
|
|||
- hosts: all
|
||||
strategy: free
|
||||
gather_facts: no
|
||||
tasks:
|
||||
- debug: msg="all hosts should print this"
|
||||
- pause: seconds=5
|
||||
when: inventory_hostname == 'l2'
|
||||
- pause: seconds=10
|
||||
when: inventory_hostname == 'l3'
|
||||
- debug: msg="and we're done"
|
|
@ -1,12 +1,7 @@
|
|||
# will use linear strategy by default
|
||||
- hosts:
|
||||
- "{{hosts|default('all')}}"
|
||||
#- ubuntu1404
|
||||
#- awxlocal
|
||||
connection: ssh
|
||||
- hosts: "{{hosts|default('all')}}"
|
||||
#gather_facts: false
|
||||
#strategy: free
|
||||
#serial: 3
|
||||
strategy: "{{strategy|default('linear')}}"
|
||||
vars:
|
||||
play_var: foo
|
||||
test_dict:
|
||||
|
@ -15,14 +10,9 @@
|
|||
vars_files:
|
||||
- testing/vars.yml
|
||||
tasks:
|
||||
- block:
|
||||
- debug: var=ansible_nodename
|
||||
when: ansible_nodename == "ubuntu1404"
|
||||
- block:
|
||||
- debug: msg="in block for {{inventory_hostname}} ({{ansible_nodename}}), group_var is {{group_var}}, host var is {{host_var}}"
|
||||
notify: foo
|
||||
- debug: msg="test dictionary is {{test_dict}}"
|
||||
when: asdf is defined
|
||||
- command: hostname
|
||||
register: hostname_result
|
||||
- debug: msg="registered result is {{hostname_result.stdout}}"
|
||||
|
@ -31,26 +21,18 @@
|
|||
sudo_user: testing
|
||||
- assemble: src=./testing/ dest=/tmp/output.txt remote_src=no
|
||||
- copy: content="hello world\n" dest=/tmp/copy_content.out mode=600
|
||||
- command: /bin/false
|
||||
retries: "{{num_retries|default(5)}}"
|
||||
delay: 1
|
||||
- debug: msg="you shouldn't see me"
|
||||
#- command: /bin/false
|
||||
# retries: "{{num_retries|default(5)}}"
|
||||
# delay: 1
|
||||
#- debug: msg="you shouldn't see me"
|
||||
rescue:
|
||||
- debug: msg="this is the rescue"
|
||||
- command: /bin/false
|
||||
- debug: msg="you should not see this rescue message"
|
||||
always:
|
||||
- debug: msg="this is the always block, it should always be seen"
|
||||
- command: /bin/false
|
||||
- debug: msg="you should not see this always message"
|
||||
|
||||
#- debug: msg="linear task 01"
|
||||
#- debug: msg="linear task 02"
|
||||
#- debug: msg="linear task 03"
|
||||
# with_items:
|
||||
# - a
|
||||
# - b
|
||||
# - c
|
||||
#- command: /bin/false
|
||||
#- debug: msg="you should not see this always message"
|
||||
|
||||
handlers:
|
||||
- name: foo
|
||||
|
@ -58,13 +40,3 @@
|
|||
- name: bar
|
||||
debug: msg="this is the bar handler, you should not see this"
|
||||
|
||||
#- hosts: all
|
||||
# connection: local
|
||||
# strategy: free
|
||||
# tasks:
|
||||
# - ping:
|
||||
# - command: /bin/false
|
||||
# - debug: msg="free task 01"
|
||||
# - debug: msg="free task 02"
|
||||
# - debug: msg="free task 03"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue