shell-server icon indicating copy to clipboard operation
shell-server copied to clipboard

add test for `blockinfile` to *always* have a marker

Open RyanSquared opened this issue 7 years ago • 4 comments

this should honestly be an issue with Ansible, but blockinfile will remove other blocks from other tasks if not given a task-specific marker!!! just add marker: "# {mark} ANSIBLE - sssd for ssh" or something like that!

RyanSquared avatar Jun 26 '18 14:06 RyanSquared

i'm adding a PR to fix the blockinfile issues that are currently in master

RyanSquared avatar Jun 26 '18 14:06 RyanSquared

for file in $(find ansible/tasks -type f -name '*.yml'); do yq -e ".. | .blockinfile? | select(. != null) | .marker" $file | grep "^null$"; done

^ that's a really ghetto way of doing it but it works, if you see "null" you messed up

RyanSquared avatar Jun 26 '18 15:06 RyanSquared

Tiny tweak:

[ $(for file in $(find ansible/tasks -type f -name '*.yml'); do yq -e ".. | .blockinfile? | select(. != null) | .marker" $file | grep null; done|wc -l) -eq 0 ]

RyanSquared avatar Apr 09 '20 18:04 RyanSquared

This will need to be changed when #68 is completed.

RyanSquared avatar Apr 09 '20 18:04 RyanSquared