Skip to content

Instantly share code, notes, and snippets.

@mihaiparv
Last active August 29, 2015 14:17
Show Gist options
  • Save mihaiparv/834aa170f51690abfc3c to your computer and use it in GitHub Desktop.
Save mihaiparv/834aa170f51690abfc3c to your computer and use it in GitHub Desktop.
Configuration management with Ansible - demo commands
# set-up authetication using the private key of the vagrant box
ssh-agent zsh
ssh-add .vagrant/machines/default/virtualbox/private_key
# test the connectivity / authentication
ansible all -i "192.168.120.10," -u vagrant -m ping
# ansible command line shell module basic usage
ansible all -i "192.168.120.10," -u vagrant -m shell -a "date"
ansible all -i "192.168.120.10," -u vagrant -m shell -a "uname -a"
# ansible command line apt module usage
ansible all -i "192.168.120.10," -u vagrant -m apt -a "pkg=git state=latest" --sudo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment