Ping all hosts (ad-hoc)

Check that Ansible can reach every host in the inventory

ansible all -i inventory -m ping

tool
ansible56 commands
tags
ansible

More ansible commands

  • ansible all -i inventory -m shell -a 'uptime'

    Run a one-line shell command on all hosts

  • ansible all -i inventory -m copy -a 'src=./file dest=/tmp/file'

    Copy a file to all hosts

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

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

  • 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

all 56 ansible commands