You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ansible/test/integration/targets/includes/roles/test_includes/tasks/main.yml

77 lines
1.7 KiB
YAML

# test code for the ping module
# (c) 2014, James Cammarata <jcammarata@ansible.com>
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
# now try long form includes
- include_tasks: included_task1.yml
vars:
a: 201
b: 202
c: 203
- debug: var=a
- debug: var=b
- debug: var=c
- name: verify long-form include params
assert:
that:
- "ca == 201"
- "cb == 202"
- "cc == 203"
- name: test handlers with includes
shell: echo 1
notify:
# both these via a handler include
- included_handler
- verify_handler
- include_tasks: branch_toplevel.yml
vars:
canary: value1
nested_include_static: 'no'
- assert:
that:
- 'canary_fact == "value1"'
- include_tasks: branch_toplevel.yml
vars:
canary: value2
nested_include_static: 'yes'
- assert:
that:
- 'canary_fact == "value2"'
- import_tasks: branch_toplevel.yml
vars:
canary: value3
nested_include_static: 'no'
- assert:
that:
- 'canary_fact == "value3"'
- import_tasks: branch_toplevel.yml
vars:
canary: value4
nested_include_static: 'yes'
- assert:
that:
- 'canary_fact == "value4"'