Skip to content

uvegla/ansible-test-environment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible test environment

This is a minimalistic test environment for Ansible.

Requirements

Infrastucture

Server Vagrant ssh IP Address
Control server vagrant ssh control-server 172.16.0.10
CentOS 7 node vagrant ssh centos-node 172.16.0.20
Ubuntu 14.04 node vagrant ssh ubuntu-node 172.16.0.30

Your Ansible hosts file will look like this.

[centos]
172.16.0.20

[ubuntu]
172.16.0.30

Usage

Simply execute the run.sh script in the project's root directory.

It will try to create new ssh keys under the ssh directory every time you execute the script.

./run.sh

Once the environment is all set up it will automatically ssh you into the Control server.

Try the following command to test your infrastucture.

ansible all -m ping

Examples

Install telnet on your centos node

On your control server execute the following command.

ansible centos -s -m yum -a "name=telnet state=latest"

Install Apache 2 on your ubuntu node

ansible ubuntu -s -m apt -a "name=apache2 state=latest"

SSH into your Ubuntu 14.04 node and test it.

service apache2 status

Tear down infrastructure

Execute the following snippet in the project's root directory.

vagrant destroy

About

This is a minimalistic test environment for Ansible

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages