Skip to content

Variable: include

Misat11 edited this page May 9, 2020 · 4 revisions

include

This variable link other file to place where is it.

Yaml:

- include: [loader]:[variable with data]@<file>
# Example usage
- include: yml:shop3@shop.yml 
- include: :shop3@shop.yml
- include: shop.yml
- include: csv@shop.csv
# Short variant:
- @shop.yml
- @shop.csv
- @yml:data3@shop.yml

You don't have to specify loader but when you have another extension than is normal you need it.

Note that you can't do this:

- include: file
  stack: STONE # this will be ignored

You must do this:

- include: file
- stack: STONE # stack can't have same hyphen as definition

Groovy:

inventory {
  // include '[loader]:[variable with data]@<file>'
  // Example usage
  include 'yml:shop3@shop.yml'
  item('...') {
    include ':shop3@shop.yml'
  }
  include 'shop.yml'
  include 'csv@shop.csv'
}

Clone this wiki locally