mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
Migrate Linux CI roles to test targets. (#17997)
This commit is contained in:
parent
374e4348e4
commit
75e4645ee7
263 changed files with 53 additions and 53 deletions
86
test/integration/targets/include_vars/tasks/main.yml
Normal file
86
test/integration/targets/include_vars/tasks/main.yml
Normal file
|
@ -0,0 +1,86 @@
|
|||
---
|
||||
- name: verify that the default value is indeed 1
|
||||
assert:
|
||||
that:
|
||||
- "testing == 1"
|
||||
- "base_dir == 'defaults'"
|
||||
|
||||
- name: include the vars/environments/development/all.yml
|
||||
include_vars:
|
||||
file: environments/development/all.yml
|
||||
|
||||
- name: verify that the default value is indeed 789
|
||||
assert:
|
||||
that:
|
||||
- "testing == 789"
|
||||
- "base_dir == 'environments/development'"
|
||||
|
||||
- name: include the vars/environments/development/all.yml and save results in all
|
||||
include_vars:
|
||||
file: environments/development/all.yml
|
||||
name: all
|
||||
|
||||
- name: verify that the values are stored in the all variable
|
||||
assert:
|
||||
that:
|
||||
- "all['testing'] == 789"
|
||||
- "all['base_dir'] == 'environments/development'"
|
||||
|
||||
- name: include the all directory in vars
|
||||
include_vars:
|
||||
dir: all
|
||||
depth: 1
|
||||
|
||||
- name: verify that the default value is indeed 123
|
||||
assert:
|
||||
that:
|
||||
- "testing == 123"
|
||||
- "base_dir == 'all'"
|
||||
|
||||
- name: include every directory in vars
|
||||
include_vars:
|
||||
dir: vars
|
||||
|
||||
- name: verify that the variable overwrite based on alphabetical order
|
||||
assert:
|
||||
that:
|
||||
- "testing == 456"
|
||||
- "base_dir == 'services'"
|
||||
- "webapp_containers == 10"
|
||||
|
||||
- name: include every directory in vars except files matching webapp.yml
|
||||
include_vars:
|
||||
dir: vars
|
||||
ignore_files:
|
||||
- webapp.yml
|
||||
|
||||
- name: verify that the webapp.yml file was not included
|
||||
assert:
|
||||
that:
|
||||
- "testing == 789"
|
||||
- "base_dir == 'environments/development'"
|
||||
|
||||
- name: include only files matching webapp.yml
|
||||
include_vars:
|
||||
dir: environments
|
||||
files_matching: webapp.yml
|
||||
|
||||
- name: verify that only files matching webapp.yml and in the environments directory get loaded.
|
||||
assert:
|
||||
that:
|
||||
- "testing == 101112"
|
||||
- "base_dir == 'development/services'"
|
||||
- "webapp_containers == 20"
|
||||
|
||||
- name: include only files matching webapp.yml and store results in webapp
|
||||
include_vars:
|
||||
dir: environments
|
||||
files_matching: webapp.yml
|
||||
name: webapp
|
||||
|
||||
- name: verify that only files matching webapp.yml and in the environments directory get loaded into stored variable webapp.
|
||||
assert:
|
||||
that:
|
||||
- "webapp['testing'] == 101112"
|
||||
- "webapp['base_dir'] == 'development/services'"
|
||||
- "webapp['webapp_containers'] == 20"
|
Loading…
Add table
Add a link
Reference in a new issue