question: what am I doing wrong? #88
Labels
No Label
bugfix
cleanup
discussion
documentation
doing
done
feature
improvement
packaging
Stale
testing
TODO
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: ungleich-public/cdist#88
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
init manifest:
type code:
cdist-dump -r
output after config run:if i uncomment
__file
and run again:why b and c is skipped?
same thing works with
for
, but not withwhile
.🤷
of course i can
@nico Yee, it's not cdist specific, but it's specific for cdist that types always consume stdin.
Today I became aware of something new :)
mentioned in commit
3c8b470367
closed via merge request !784
This is actually not cdist specific, but happens the same way with ssh - i.e. anything that likes to read stdion in a loop that you input stuff in
@steven Thanks! I will update documentation.
We should document this. It's known since forever.
The workaround e.g.:
So make sure your types inside a loop get there stdin from somewhere else.
mentioned in merge request !784
@ander Can you write your solution with
for
loop?I think we cannot distinguish such stdin from e.g. heredoc stdin.
Or am I missing something?
@nico @steven We should add this as 'Caveats' to cdist type chapter.
assigned to @poljakowski
@ander @nico @steven Got it!
So, parameter foo file content becomes while body's stdin and when executing first
__file
cdist's emulator reads stdin (the rest of foo param file) and saves it tostdin
file (in cdist cache).For the second
read
there is no more lines to read.@ander Look what seems to work:
@ander Interesting.
Currently trying to debug it and not getting it.