Gather facts from a host

Collect all Ansible facts (OS, CPU, network) from a host

ansible <host> -i inventory -m setup | jq '._ansible_facts'

tool
ansible56 commands
tags
ansibledebug

More ansible commands

  • ansible-vault encrypt_string 'secret_value' --name 'db_password'

    Encrypt one string so you can paste it straight into a playbook

  • ansible-vault encrypt vars/secrets.yml

    Encrypt a whole variables file with Ansible Vault

  • ansible-vault decrypt vars/secrets.yml

    Decrypt an Ansible Vault file in place

  • ansible-vault view vars/secrets.yml

    Show the contents of a vault file without decrypting it on disk

  • ansible-galaxy install -r requirements.yml -p roles/

    Download the roles listed in requirements.yml to the local roles/ folder

all 56 ansible commands