Skip to content

Instantly share code, notes, and snippets.

@04n0
Last active April 8, 2017 21:04
Show Gist options
  • Save 04n0/5b55a823d6748b925bab279fbc9adc43 to your computer and use it in GitHub Desktop.
Save 04n0/5b55a823d6748b925bab279fbc9adc43 to your computer and use it in GitHub Desktop.
ansible notes

loop - create multiple files from list (file_id) in vars

vars/ file with defined variable as list

file_id:
  - test1
  - test2
  - test3
  - test4

Main task that includes series of tasks from generate_files.yml

- name: generate files 
  include: generate_files.yml
  vars:
    file_id_loop: "{{ item }}"
  with_items:
    - "{{ file_id }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment