Skip to content

Instantly share code, notes, and snippets.

@heiwa4126
Last active March 6, 2020 12:47
Show Gist options
  • Save heiwa4126/2979c6579bc5f6919ec7b6033c37b317 to your computer and use it in GitHub Desktop.
Save heiwa4126/2979c6579bc5f6919ec7b6033c37b317 to your computer and use it in GitHub Desktop.
Ansibleのjoinとsequenceのサンプル
- name: join and sequence example
hosts: localhost
become: no
gather_facts: False
vars:
data: [foo, bar, baz]
tasks:
-
name: join example
debug: msg="{{ data|join(', ') }}"
-
name: sequence example
debug: msg="{{ 'count %02d'|format(item|int) }}"
with_sequence: count=4
-
name: sequence example 2
debug: var=item
with_sequence: start=3 end=1 stride=-1 format=%08d
@heiwa4126
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment