Created
September 4, 2017 14:15
-
-
Save juanino/e8043be04cec2dadbbb5202bf9a6e29a to your computer and use it in GitHub Desktop.
check ansible yml file for package existence in raspian (or any apt system for that matter)
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
# problem: you have a bunch of files in some ansible playbook but some don't exist | |
# solution: apt-cache show each of them and check return code $? | |
cat pi-base.yml | grep "\- " | grep -v name\: | grep -v hosts\: | sed 's/.*- //g' | awk {'print "echo -n " $1 " ; apt-cache show " $1 " 1>/dev/null ;echo \" \" $?" '} | sh | tee /tmp/output |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment