-
-
Save Slimmons/021621ddfe98cb79d7216afa1dc10d8a to your computer and use it in GitHub Desktop.
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
This state only creates a single file named 5, in /home/user. | |
The goal was to create 5 files, /home/user/1, 2, 3, 4, 5. | |
The thing that's weird is that it appears to be rendering correctly.: | |
test: | |
local.cmd.run: | |
- tgt: 'minion_1' | |
- arg: | |
- touch /home/user/1 | |
- arg: | |
- touch /home/user/2 | |
- arg: | |
- touch /home/user/3 | |
- arg: | |
- touch /home/user/4 | |
- arg: | |
- touch /home/user/5 | |
Then it shows this | |
[DEBUG ] Results of YAML rendering: | |
OrderedDict([('test', OrderedDict([('local.cmd.run', [OrderedDict([('tgt', 'minion_1')]), OrderedDict([('arg', ['touch /home/user/1'])]), OrderedDict([('arg', ['touch /home/user/2'])]), OrderedDict([('arg', ['touch /home/user/3'])]), OrderedDict([('arg', ['touch /home/user/4'])]), OrderedDict([('arg', ['touch /home/user/5'])])])]))]) | |
Everything looks like it should be working to me. |
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
{% set postdata = data.get('post', {}) %} | |
test: | |
local.cmd.run: | |
- tgt: '{{ postdata.tgt }}' | |
{% set count = 1 %} | |
{% for x in range(1,6) %} | |
- arg: | |
- touch /home/user/{{ count }} | |
- arg: | |
- echo "hello!" >> /home/user/{{ count }} | |
{% set count = count + 1 %} | |
{% endfor %} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment