Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ external_resources:

![Ansible](/docs/assets/Learn_How_to_Install_Ansible_and_Run_Playbooks_smg.jpg)

# Getting started with Ansible: An Installation and Configuration Tutorial

Consider the monotony of administering a server fleet; keeping them all updated, pushing changes out to them, copying files, etc. Things can get complicated and time consuming very quickly, but it doesn't have to be that way.

*[Ansible](http://www.ansible.com/home)* is a helpful tool that allows you to create groups of machines, describe how those machines should be configured or what actions should be taken on them, and issue all of these commands from a central location. It uses SSH, so nothing needs to be installed on the machines you are targeting. Ansible only runs on your main control machine, which can even be your laptop! It is a simple solution to a complicated problem.
Expand All @@ -40,25 +38,25 @@ Ansible only needs to be installed on the *control machine*, or the machine from

Make sure that you have Python 2.x available on the control machine. Ansible is not compatible with Python 3, nor can you use Windows as the control machine. You can [build Ansible from source](https://github.com/ansible/ansible), or install the latest stable packages using the proper command below.

- Mac OS X:
### MacOS

sudo easy_install pip
sudo pip install ansible
sudo easy_install pip
sudo pip install ansible

- CentOS/Fedora:
### CentOS/Fedora

sudo yum install ansible
sudo yum install ansible

{{< note >}}
{{< note >}}
The EPEL-Release repository may need to be added on certain versions of CentOS, RHEL, and Scientific Linux.
{{< /note >}}

- Ubuntu:
### Ubuntu

sudo apt-get install software-properties-common
sudo apt-add-repository ppa:ansible/ansible
sudo apt-get update
sudo apt-get install ansible
sudo apt-get install software-properties-common
sudo apt-add-repository ppa:ansible/ansible
sudo apt-get update
sudo apt-get install ansible


## First Steps to Configuring Ansible
Expand Down Expand Up @@ -100,21 +98,18 @@ You executed an Ansible command against one client, but it would be cumbersome t
1. By default, the inventory file is expected to be `/etc/ansible/hosts`. Create that path and file if it does not already exist.


{{< note >}}
If you are running OS X, you may want to create your own Ansible directory elsewhere and then set the path in an Ansible configuration file:
If you are running OS X, you may want to create your own Ansible directory elsewhere and then set the path in an Ansible configuration file:

mkdir ~/Path/To/ansible
touch ~/Path/To/ansible/hosts
touch ~/.ansible.cfg
mkdir ~/Path/To/ansible
touch ~/Path/To/ansible/hosts
touch ~/.ansible.cfg

Open `~/.ansible.cfg` file and add the following lines:
Open `~/.ansible.cfg` file and add the following lines:

{{< file-excerpt "> ~/.ansible.cfg" ini >}}
[defaults]
inventory = ~/Path/To/ansible/hosts
{{< /note >}}

{{< /file-excerpt >}}
{{< file-excerpt "~/.ansible.cfg" ini >}}
[defaults]
inventory = ~/Path/To/ansible/hosts
{{< /file-excerpt >}}


2. Add an entry to your hosts file, pointing to a server that you connected to in the previous section. You can include multiple servers in this file, using either domains or IP addresses, and can even group them:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ The current stable version of Docker Compose is 1.16.1. Check for the latest ver

sudo dnf install mysql

### Configure Docker
## Configure Docker

The Docker service will manage your containers, the container's host, Zipkin services, and your MYSQL server.

Expand All @@ -112,7 +112,7 @@ Our goal is to set up the Zipkin Server for:
* Web service: showing searches of time data
* lock down access to only our web and analyst machines.

### Zipkin Server Firewall
## Zipkin Server Firewall

1. Create a new zone in our firewall called **zipkin**

Expand Down Expand Up @@ -142,7 +142,7 @@ Our goal is to set up the Zipkin Server for:

sudo firewall-cmd --zone=zipkin --list-all

### Docker-Compose Configuration
## Docker-Compose Configuration

The **docker-compose yml** files will control which system configuration we can use. We're going to select a MySQL configuration for storage.

Expand Down Expand Up @@ -229,7 +229,7 @@ volumes:

docker-compose -f docker-init.yml down

### Backup Span/Trace Data
## Backup Span/Trace Data

There are 2 different backup methods: using MySQL , and using sysadmin.

Expand Down Expand Up @@ -271,7 +271,7 @@ We can just zip or tar the exported database files on the host system. Since we

3. Remember to start your Zipkin services if they're still needed. They will not restart even on a reboot because we have explicitly shut them down.

#### Testing the Zipkin Service
## Testing the Zipkin Service

1. Easiest way to do this is by using your web browser on your analyst machine. Log into your analyst machine, bring up your browser, and type in the following URL:

Expand Down