Skip to content

Instantly share code, notes, and snippets.

@Ramblurr
Last active August 25, 2019 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Ramblurr/e1ba04aab6177cb4f93054c8dc8958e7 to your computer and use it in GitHub Desktop.
Save Ramblurr/e1ba04aab6177cb4f93054c8dc8958e7 to your computer and use it in GitHub Desktop.
Ansible Recipes
# 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