Last active
March 6, 2020 12:47
-
-
Save heiwa4126/2979c6579bc5f6919ec7b6033c37b317 to your computer and use it in GitHub Desktop.
Ansibleのjoinとsequenceのサンプル
This file contains hidden or 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
- 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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
予測はつくでしょーが、以下のような出力が得られます。