mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Fix nested noop block padding in dynamic includes (#38814)
* Fix nested noop block padding in dynamic includes * Address issues from the review * Fix typo
This commit is contained in:
committed by
Matt Martz
parent
4b01b92cfe
commit
5dd8977cfa
1
test/integration/targets/strategy_linear/aliases
Normal file
1
test/integration/targets/strategy_linear/aliases
Normal file
@@ -0,0 +1 @@
|
||||
posix/ci/group3
|
||||
@@ -0,0 +1,6 @@
|
||||
- name: Include tasks
|
||||
include_tasks: "tasks.yml"
|
||||
|
||||
- name: Mark role as finished
|
||||
set_fact:
|
||||
role1_complete: True
|
||||
@@ -0,0 +1,7 @@
|
||||
- name: Call role2
|
||||
include_role:
|
||||
name: role2
|
||||
|
||||
- name: Call role2 again
|
||||
include_role:
|
||||
name: role2
|
||||
@@ -0,0 +1,7 @@
|
||||
- block:
|
||||
- block:
|
||||
- name: Nested task 1
|
||||
debug: msg="Nested task 1"
|
||||
|
||||
- name: Nested task 2
|
||||
debug: msg="Nested task 2"
|
||||
5
test/integration/targets/strategy_linear/runme.sh
Executable file
5
test/integration/targets/strategy_linear/runme.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -eux
|
||||
|
||||
ansible-playbook test_include_file_noop.yml -i ../../inventory "$@"
|
||||
@@ -0,0 +1,16 @@
|
||||
- hosts:
|
||||
- testhost
|
||||
- testhost2
|
||||
gather_facts: no
|
||||
vars:
|
||||
secondhost: testhost2
|
||||
tasks:
|
||||
- name: Call the first role only on one host
|
||||
include_role:
|
||||
name: role1
|
||||
when: inventory_hostname is match(secondhost)
|
||||
|
||||
- name: Make sure nothing else runs until role1 finishes
|
||||
assert:
|
||||
that:
|
||||
- "'role1_complete' in hostvars[secondhost]"
|
||||
Reference in New Issue
Block a user