Last active
August 25, 2019 17:34
-
-
Save Ramblurr/e1ba04aab6177cb4f93054c8dc8958e7 to your computer and use it in GitHub Desktop.
Ansible Recipes
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
# a collection of ansible copypastas | |
▄▄▖▄▄▖▄▄▖▄▄▖▄▄▖▄▄▖▄▄▖▄▄▖ | |
# get python/pip package installed version | |
- name: check PACKAGENAME version | |
shell: pip list [--user] --format=json | jq --raw-output '.[] | select(.name == "PACKAGENAME").version' | |
register: PACKAGENAME_installed_version | |
changed_when: false | |
▄▄▖▄▄▖▄▄▖▄▄▖▄▄▖▄▄▖▄▄▖▄▄▖ | |
# Import PGP key into user's keyring | |
# requires module from https://github.com/tnt/ansible-gpg-import-module | |
- name: fetch XX pgp key | |
gpg_import: | |
key_id: "0xabcd" | |
servers: | |
- hkp://YOUR KEYSERVER | |
▄▄▖▄▄▖▄▄▖▄▄▖▄▄▖▄▄▖▄▄▖▄▄▖ | |
# Verify pgp signatures using gpg. IF the sig is invalid, it will return non-0 and exit | |
- name: verify sigs | |
shell: gpg --verify ./SIG_FILE_NAME.asc | |
args: | |
chdir: "SIG_PATH" | |
changed_when: false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment