Skip to content

Latest commit

 

History

History

getting-started-with-ansible

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

Getting Started with Ansible

Key Concepts

Ansible Key Concepts

Prerequisites

Before you want to try this on your local, here are requirements

  • A public key in .ssh/id_rsa.pub in your home directory
  • Directly download Virtualbox and install, or use homebrew
    brew install --cask virtualbox
    
  • Vagrant
    brew install --cask vagrant
    
  • Ansible
    brew install ansible
    

Provision VMs

cd getting-started-with-ansible
vagrant up

Let's ssh into two guest VMs

Ad-hoc Commands

Ping two guest VMs

ansible all -i inventory.yaml -m ping -u ci

Check current directory after login

ansible all -i inventory.yaml -m shell -a "pwd" -u ci

Playbook

See all available Ansible modules

Execute playbook to install Docker on guest VMs

ansible-playbook -i inventory.yaml playbook.yml