Skip to content
readme.md 5.25 KiB
Newer Older
# Ansible Centreon

Table of Contents

- [Overview](#overview)
Luiz G. Costa's avatar
Luiz G. Costa committed
  - [Ansible Playbooks](#ansible-playbooks)
  - [Roles](#roles)
- [Versions](#versions)
Luiz G. Costa's avatar
Luiz G. Costa committed
  - [18.10.0](#18.10.0)
- [Requirements](#requirements)
Luiz G. Costa's avatar
Luiz G. Costa committed
  - [Operating systems](#operating-systems)
  - [Control Machine](#control-machine)
- [Installation](#installation)
- [Role Variables](#role-variables)
Luiz G. Costa's avatar
Luiz G. Costa committed
  - [Default Values](#default-values)
- [Examples](#examples)
Luiz G. Costa's avatar
Luiz G. Costa committed
  - [Installation](#simple-installation)
  - [Using Vagrant](docs/vagrant.md)
  - [Using AWS Amazon](#amazon-aws)
  - [Using Google Cloud](#google-cloud)
  - [Using Microsoft Azure](#microsoft-azure)
  - [Using Digital Ocean](#digital-ocean)
  - [Using Vultr](#vultr)
- [Screencasts](#screencasts)
- [License](LICENSE)

Luiz G. Costa's avatar
Luiz G. Costa committed
## Overview
Luiz G. Costa's avatar
Luiz G. Costa committed
### Ansible Playbooks
Luiz G. Costa's avatar
Luiz G. Costa committed

Playbooks express configurations, deployment, and orchestration in Ansible. The Playbook format is YAML. Each Playbook maps a group of hosts to a set of roles. Each role is represented by calls to Ansible tasks.

Luiz G. Costa's avatar
Luiz G. Costa committed
See more information: [](https://docs.ansible.com/ansible/latest/user_guide/playbooks.html)
Luiz G. Costa's avatar
Luiz G. Costa committed

Luiz G. Costa's avatar
Luiz G. Costa committed
### Roles
Luiz G. Costa's avatar
Luiz G. Costa committed

Centreon Web Playbook with MySQL Server

- Disable selinux
- Add Centreon Open Source repository
- Import keys from repository
- Install packages to Centreon poller
- Setup timezone to PHP
- Set custom option to Mysql in CentOS 7
- Generate SSH key (used by remote Centreon Poller)
- Start and enable services necessaries
- Setup firewall rules
Luiz G. Costa's avatar
Luiz G. Costa committed

Luiz G. Costa's avatar
Luiz G. Costa committed
Centreon Poller Playbook

- Disable selinux
- Add Centreon Open Source repository
- Import keys from repository
- Install packages to Centreon poller
- Set authorized previously created keys (copy from Centreon-Web)
- Enable and try start centengine service

Luiz G. Costa's avatar
Luiz G. Costa committed
## Versions
Luiz G. Costa's avatar
Luiz G. Costa committed
### 18.10.0

Version with synchronized functions for version 18.10.0 of the Centreon

Luiz G. Costa's avatar
Luiz G. Costa committed
## Requirements
Luiz G. Costa's avatar
Luiz G. Costa committed
### Operating systems
Luiz G. Costa's avatar
Luiz G. Costa committed

This role will work on the following operating systems:
Luiz G. Costa's avatar
Luiz G. Costa committed

Luiz G. Costa's avatar
Luiz G. Costa committed
- Red Hat / Centos
Luiz G. Costa's avatar
Luiz G. Costa committed

Control Machine:
Luiz G. Costa's avatar
Luiz G. Costa committed

- Ansible tools
- Access SSH to remote hosts

Install last version of Ansible

Luiz G. Costa's avatar
Luiz G. Costa committed
[](https://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html#installing-the-control-machine)
Luiz G. Costa's avatar
Luiz G. Costa committed
## Installation
Luiz G. Costa's avatar
Luiz G. Costa committed
### Using GIT

```bash
cd ~/work-dir
git clone https://github.com/centreon/centreon-iac-ansible.git
cd centreon-iac-ansible
Luiz G. Costa's avatar
Luiz G. Costa committed
```

Luiz G. Costa's avatar
Luiz G. Costa committed
### Using Ansible Galaxy
Luiz G. Costa's avatar
Luiz G. Costa committed
## Role Variables

Task: mariadb-server

Luiz G. Costa's avatar
Luiz G. Costa committed
- `mysql_root_password`: (string) Password to use with user root
Luiz G. Costa's avatar
Luiz G. Costa committed
- `php_timezone`: (string)

Timezone to configuration of PHP
Luiz G. Costa's avatar
Luiz G. Costa committed
[](http://php.net/manual/en/timezones.php)

- `mysql_hostname`: (string) Hostname or IP to use for connection with Mysql database
- `mysql_port`: (string) Port number to use for connection with Mysql database
- `mysql_root_password`: (string) Password used by user root (you can use variable from mariadb-server task)
- `mysql_centreon_db`: (string) Database name used by Centreon
- `mysql_centstorage_db`: (string) Database name used by Centreon Storage
- `mysql_centreon_username`: (string) Username used by Centreon
- `mysql_centreon_password`: (string) Password user used by Centreon
- `centreon_admin_password`: (string) Password used by user admin (main administrator user)
- `plugin_pack`: (array)

A array of plugins pack to install
Valid values:
Luiz G. Costa's avatar
Luiz G. Costa committed

- base-generic
- Centreon
- Centreon DB
- Centreon Poller
- Cisco standard
- Linux SNMP
- MySQL DB
- Printer standard
- UPS Standard
- Windows SNMP
- DHCP Server
- DNS Service
- FTP Server
- HTTP Server
- LDAP Server
- 3com Network
- AIX SNMP
- AKCP Sensor
- Alcatel OXE
- Apache Server

Luiz G. Costa's avatar
Luiz G. Costa committed
### Default values

```yaml
  php_timezone: "Europe/Paris"
  mysql_centreon_hostname: "localhost"
  mysql_centstorage_hostname: "localhost"
  mysql_port: "3306"
  mysql_root_password: "p4ssw0rd"
  mysql_centreon_username: "centreon"
  mysql_centreon_password: "p4ssw0rd"
  mysql_centreon_db: "centreon"
  mysql_centstorage_db: "centreon_storage"
  centreon_admin_password: "p4ssw0rd"
```

Luiz G. Costa's avatar
Luiz G. Costa committed
## Examples
Luiz G. Costa's avatar
Luiz G. Costa committed
### Simple Installation

Simple Installation using a Centos clean install and configure a new Host with Centreon
Luiz G. Costa's avatar
Luiz G. Costa committed

You need a installation of CentOS 7 with SSH server enabled

[Using Vagrant images to prepare Centreon](docs/vagrant.md)

on the control machine, export the ssh key to new host:
Luiz G. Costa's avatar
Luiz G. Costa committed

Luiz G. Costa's avatar
Luiz G. Costa committed
```bash
ssh-copy-id root@[remote-ip-or-hostname]
Create a new file of hosts with the configuration to connect in the remote host, example:
Luiz G. Costa's avatar
Luiz G. Costa committed

Luiz G. Costa's avatar
Luiz G. Costa committed
```bash
vi hosts.deploy
[centreon-server]
centreon-web ansible_port=22 ansible_host=[remote-ip-or-hostname]
```

Create a new file with format YAML to deploy components for installation of Centreon Web

Luiz G. Costa's avatar
Luiz G. Costa committed
```bash
vi centreon-deploy.yml
---
Luiz G. Costa's avatar
Luiz G. Costa committed
- name: Centreon-Web
  hosts: centreon-server
Luiz G. Costa's avatar
Luiz G. Costa committed
  remote_user: root

  roles:
    - "roles/common"
    - role: "roles/mariadb-server"
      mysql_root_password: "p4ssw0rd"
    - role: "roles/centreon-web"
Luiz G. Costa's avatar
Luiz G. Costa committed
      php_timezone: "Europe/Paris"
      mysql_hostname: "localhost"
      mysql_port: "3306"
      mysql_root_password: "p4ssw0rd"
      mysql_centreon_db: "centreon"
      mysql_centstorage_db: "centreon_storage"
      mysql_centreon_username: "centreon"
      mysql_centreon_password: "p4ssw0rd"
      centreon_admin_password: "p4ssw0rd"
Luiz G. Costa's avatar
Luiz G. Costa committed
      plugin_pack:
        - "base-generic"
        - "Linux SNMP"
Luiz G. Costa's avatar
Luiz G. Costa committed
```

Now, you can apply the deploy in remote server, use these command:

Luiz G. Costa's avatar
Luiz G. Costa committed
```bash
ansible-playbook -i hosts.deploy centreon-deploy.yml
Luiz G. Costa's avatar
Luiz G. Costa committed
```