Skip to content

batch_template

Note

Always use the FQCN (Fully Qualified Collection Name) arista.avd.batch_template when using this plugin.

This plugin is deprecated

This module will be removed in version 5.0.0.

Render Jinja2 template on multiple items and write result to individual files.

Synopsis

Render Jinja2 template on multiple items and write result to individual files.

Destination file mode is hardcoded to 0o664.

Parameters

Argument Type Required Default Value Restrictions Description
template str True None Path to Jinja2 Template file
dest_format_string str True None Format string used to specify target file for each item. 'item' is the current item from 'items'. Like "mypath/{item}.md"
items list True None List of strings. Each list item is passed to 'dest_format_string' as 'item' and passed to templater as 'item'

Examples

- name: Output eos_cli_config_gen Documentation
  tags: [eos_cli_config_gen]
  delegate_to: localhost
  run_once: true
  arista.avd.batch_template:
    template: avd_schema_documentation.j2
    dest_format_str: "{{ role_documentation_dir }}/{item}.md"
    items: "{{ data_in_list_form }}"

Authors

  • Arista Ansible Team (@aristanetworks)