Skip to content

zmzm/ansible-devops

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible devops

Ping all servers from ansible_hosts file

ansible -m ping all

Connect to host via SSh

ssh -vvv -i ~/aws/aws_keys/default_ec2.cer [email protected]

Run commands for getting information about hosts

ansible all -a "whoami" (inside "" could be any other command e.g. "python --version, uname, pwd, etc.")

Run commands for spesific host/group

ansible dev -a "whoami" - 'dev' is a group name from hosts file
ansible qa1 -a "whoami" - 'qa1' is a specific server from hosts file

Run ansible playbook

ansible-playbook playbooks/playbook-file-name.yaml

Dynamic ansible inventory

Preparation

Create python venv, install boto3, export aws access key/secret access key

Test

ansible-inventory --list 

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published