Created
August 7, 2018 21:38
-
-
Save deekayen/d0660cdeec2cb5ab55996d21a5e887bf to your computer and use it in GitHub Desktop.
Ansible: loop through a string list. Could be useful for creating lots of EC2 instances passed from a textarea in Ansible Tower.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: all | |
connection: local | |
vars: | |
stuff: "asdf | |
asdfasdf | |
asdfasdfasdf | |
asdfasdfasdf | |
asdfasdfasdf | |
asdfasdf" | |
tasks: | |
- name: with_nested -> loop | |
debug: | |
msg: "{{ item }}" | |
loop: "{{ stuff.split(' ') }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment