SlideShare une entreprise Scribd logo
1  sur  23
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Ansible
What is
Ansible?
Inventory
Virtual Machines
DEMO
Conclusion
The End
Icinga2 through Ansible
Monitoring migration through automation
Toshaan Bharvani - VanTosh bvba
<toshaan@vantosh.com>
Icinga Camp Antwerp 2015
13 April 2015
Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 1 / 23
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Ansible
What is
Ansible?
Inventory
Virtual Machines
DEMO
Conclusion
The End
$ whoami
Toshaan Bharvani - VanTosh
From Antwerp, Belgium
Self-employed engineer/trainer (available for hire)
http://www.vantosh.com
Involved with Enterprise OS : RHEL, CentOS, IBM AIX,
OpenBSD, FreeBSD, SLES, . . .
Likes to keep everything secure : SELinux, WebSec, . . .
Lives in a virtual world : KVM, Xen, LXC, PowerVM, z/VM, . . .
Likes automation : Ansible, Puppet, Salt
Works on both hardware and software side
Wants to take over the world
Twitter : @toshywoshy
Blog : http://www.toshaan.com
Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 2 / 23
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Ansible
What is
Ansible?
Inventory
Virtual Machines
DEMO
Conclusion
The End
Table of contents
1 Ansible
What is Ansible?
Inventory
2 Virtual Machines
3 DEMO
4 Conclusion
Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 3 / 23
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Ansible
What is
Ansible?
Inventory
Virtual Machines
DEMO
Conclusion
The End
Monitoring Sucks!
Nagios
Zenoss
Zabbix
Ganglia
Icinga
OpsView
Shinken
Icinga2
Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 4 / 23
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Ansible
What is
Ansible?
Inventory
Virtual Machines
DEMO
Conclusion
The End
1
Ansible
Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 5 / 23
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Ansible
What is
Ansible?
Inventory
Virtual Machines
DEMO
Conclusion
The End
“Ansible is a fictional machine capable of instantaneous or
superluminal communication. Typically it is depicted as a
lunch-box-sized object with some combination of microphone, speaker,
keyboard and display. It can send and receive messages to and from a
corresponding device over any distance whatsoever with no delay.”1
Configuration Management Tool
System Orchestration Tool
Remote Execution/Deployment Tool
. . .
1Rocannon’s World - Ursula K. Le Guin
Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 6 / 23
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Ansible
What is
Ansible?
Inventory
Virtual Machines
DEMO
Conclusion
The End
An overview
Python2 based
Server based, agentless2
uses SSH (can use accelerated mode uses a daemon and port)
host information in flat files, CMDB, scripts, . . .
executes a task on the host side
Playbook : combination of tasks with meta information
YAML
JSON
Templates : Jinja2
works where Python2 works3
2Abstraction of SSH and in certain setup an agent might be required, but by default it is not necessary
3Ansible can actually run without Python on the remote host, however it is not fully supported
Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 7 / 23
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Ansible
What is
Ansible?
Inventory
Virtual Machines
DEMO
Conclusion
The End
Internal Design
Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 8 / 23
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Ansible
What is
Ansible?
Inventory
Virtual Machines
DEMO
Conclusion
The End
Normal Adhoc Mode
Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 9 / 23
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Ansible
What is
Ansible?
Inventory
Virtual Machines
DEMO
Conclusion
The End
Delegation Mode
Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 10 / 23
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Ansible
What is
Ansible?
Inventory
Virtual Machines
DEMO
Conclusion
The End
Inventory - Hypervisors
hosts file is by default in ini format
§ ¤
1 [hypervisors ]
2 hypervisor0 ansible_ssh_host =hyper0.vantosh.com ansible_ssh_port =22221
ansible_ssh_user =ansible ansible_ssh_private_key_file =/ path/to/my/private/
key0
3 hypervisor1 ansible_ssh_host =hyper1.vantosh.com ansible_ssh_port =22222
ansible_ssh_user =ansible ansible_ssh_private_key_file =/ path/to/my/private/
key1
4 hypervisor2 ansible_ssh_host =hyper2.vantosh.com ansible_ssh_port =22223
ansible_ssh_user =ansible ansible_ssh_private_key_file =/ path/to/my/private/
key2
5 hypervisor3 ansible_ssh_host =hyper3.vantosh.com ansible_ssh_port =22224
ansible_ssh_user =ansible ansible_ssh_private_key_file =/ path/to/my/private/
key3
6
7 [ virtualmachines ]
8 vm0 ansible_ssh_host =vm0.vantosh.com ansible_ssh_port =22230
ansible_ssh_user =ansible ansible_ssh_private_key_file =/ path/to/my/private/
key4
9 vm1 ansible_ssh_host =vm1.vantosh.com ansible_ssh_port =22231
ansible_ssh_user =ansible ansible_ssh_private_key_file =/ path/to/my/private/
key5
10 vm2
11 vm3
¦ ¥
Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 11 / 23
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Ansible
What is
Ansible?
Inventory
Virtual Machines
DEMO
Conclusion
The End
Inventory - Virtual Machine (el7)
§ ¤
1 ---
2 hyper: hypervisor0
3 distro: centos7
4 rootpwd: $1$f0pPKH0e$0xrX07Ki9DPmpcmJooede7X .
5 virtualfilespath : /virtual/
6 disks:
7 - { path: /virtual/star -boot0.qcow2 , size: 512M }
8 - { path: /virtual/star -root0.qcow2 , size: 6G }
9 - { path: /virtual/star -swap0.qcow2 , size: 512M }
10 - { path: /virtual/star -swap1.qcow2 , size: 512M }
11 vmwaittime: 5
12 virtualcpus: 1
13 ramsize: 512
14 language: en_US
15 keyboard: us
16 timezone: "Europe/Brussels"
17 nics:
18 - { type: bridge , name: br0 , model: virtio , bootproto: dhcp , device:
eth0 , onboot: on }
19 hostname: star.vantosh.com
20 partitions:
21 - part /boot --ondisk=vda --asprimary --fstype="xfs" --fsoptions=’defaults ,
noatime ,discard ’ --grow --size =1
22 - part pv.01 --ondisk=vdb --asprimary --grow --size =1
23 - volgroup VolGroupRoot --pesize =131072 pv.01
24 - logvol / --fstype="xfs" --fsoptions=’defaults ,noatime ,discard ’ --name=
LogVolRoot0 --vgname= VolGroupRoot --grow --size =1
25 - part swap --onpart=vdc --asprimary --fstype="swap" --fsoptions=’defaults ,
discard ’ --grow --size =1
26 - part swap --onpart=vdd --asprimary --fstype="swap" --fsoptions=’defaults ,
discard ’ --grow --size =1
27 bootloader: bootloader --location=mbr --driveorder=vda ,vdb ,vdc ,vdd
28 sshdrsakeylength : 8192
29 sshdecdsakeylength : 521
30 users:
31 - { name: supervisor , id: 1000 , ssh: yes , sshpubkey: /home/toshywoshy /.
keys/id_star.pub }
¦ ¥
Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 12 / 23
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Ansible
What is
Ansible?
Inventory
Virtual Machines
DEMO
Conclusion
The End
2
Virtual Machines
Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 13 / 23
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Ansible
What is
Ansible?
Inventory
Virtual Machines
DEMO
Conclusion
The End
Playbooks - el7§ ¤
1 ---
2 - name: install -vm -el6
3 hosts: "{{ host }}"
4 vars_files:
5 - "vars/distros /{{ distro }}. yml"
6 gather_facts : no
7 sudo: yes
8 pre_tasks:
9 - local_action : slurp src ={{ ansible_ssh_private_key_file }}. pub
10 sudo: no
11 register: sshpubkey
12 - action: qemu -img dest ={{ item.path }} size ={{ item.size }} format="qcow2"
options=" preallocation =metadata"
13 with_items: disks
14 delegate_to: "{{ hyper }}"
15 - action: template src="~/. ansible/playbooks/templates/el6/kickstart.cfg"
dest="{{ virtualfilespath }}{{ inventory_hostname }}. cfg"
16 delegate_to: "{{ hyper }}"
17 - action: template src="~/. ansible/playbooks/templates/common/install -vm.sh
" dest="{{ virtualfilespath }}{{ inventory_hostname }}-create -vm.sh"
owner=root group=root mode =770
18 delegate_to: "{{ hyper }}"
19 - action: command /bin/bash {{ virtualfilespath }}{{ inventory_hostname }}-
create -vm.sh
20 delegate_to: "{{ hyper }}"
21 register: createdvm
22 - local_action : pause minutes ={{ vmwaittime }}
23 - action: template src="templates/common/minram.sh" dest="{{
virtualfilespath }}{{ inventory_hostname }}- minram.sh" owner=root group=
root mode =770
24 delegate_to: "{{ hyper }}"
25 when: ramsize < minram
26 - action: command /bin/bash {{ virtualfilespath }}{{ inventory_hostname }}-
minram.sh
27 delegate_to: "{{ hyper }}"
28 when: ramsize < minram
29 - action: virt guest ={{ inventory_hostname }} command=start
30 delegate_to: "{{ hyper }}"
31 ignore_errors : yes
32 - action: file path ={{ item }} state=absentIcinga2 through Ansible Toshaan Bharvani - VanTosh bvba 14 / 23
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Ansible
What is
Ansible?
Inventory
Virtual Machines
DEMO
Conclusion
The End
Variables - el7
§ ¤
1 ---
2 distroname: centos7
3 distrotype: rhel7
4 templatetype : el7
5 minram: 512
6 location: "http :// be.mirror.eurid.eu/centos /7/ os/x86_64/"
7 repos:
8 - { name: "CentOS -base", uri: "http :// be.mirror.eurid.eu/centos /7/ os/x86_64/"
, cost: 100 }
9 - { name: "CentOS -updates", uri: "http ://be.mirror.eurid.eu/centos /7/ updates/
x86_64/", cost: 200 }
10 - { name: "CentOS -fasttrack", uri: "http :// be.mirror.eurid.eu/centos /7/
fasttrack/x86_64/", cost: 300 }
11 - { name: "CentOS -extras", uri: "http ://be.mirror.eurid.eu/centos /7/ extras/
x86_64/", cost: 400 }
12 textrargs: ’text ks=file :/{{ inventory_hostname }}. cfg console=ttyS0 ,115200
headless noshell nofirewire ’
¦ ¥
Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 15 / 23
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Ansible
What is
Ansible?
Inventory
Virtual Machines
DEMO
Conclusion
The End
Install script§ ¤
1 #!/bin/bash
2
3 if [ ! -f /etc/libvirt/qemu /{{ inventory_hostname }}. xml ]; then
4
5 virt -install 
6 --name ={{ inventory_hostname }} 
7 --vcpus ={{ virtualcpus }} 
8 {% if minram is defined and ramsize < minram %}
9 --ram ={{ minram }} 
10 {% else %}
11 --ram ={{ ramsize }} 
12 {% endif %}
13 --hvm 
14 --accelerate 
15 --os -variant ={{ distrotype }} 
16 {% for disk in disks %}
17 {% if disk.size [ -1:] == ’T’ %}
18 {% set disk_size = (disk.size [: -1]| float) * 1024 %}
19 {% elif disk.size [ -1:] == ’G’ %}
20 {% set disk_size = (disk.size [: -1]| float) %}
21 {% elif disk.size [ -1:] == ’M’ %}
22 {% set disk_size = (disk.size [: -1]| float) / 1024 %}
23 {% elif disk.size [ -1:] == ’K’ %}
24 {% set disk_size = (disk.size [: -1]| float) / 1024 / 1024 %}
25 {% else %}
26 {% set disk_size = (disk.size [: -1]| float) %}
27 {% endif %}
28 --disk path ={{ disk.path }}, device=disk ,size ={{ disk_size }}, cache=writeback ,
format=qcow2 ,io=threads ,bus=virtio 
29 {% endfor %}
30 {% for nic in nics %}
31 --network {{ nic.type }}={{ nic.name }}, model ={{ nic.model }} 
32 {% endfor %}
33 --location ={{ location }} 
34 {% if injectfile is defined %}
35 --initrd -inject ={{ virtualfilespath }}{{ injectfile }} 
36 {% else %}
37 --initrd -inject ={{ virtualfilespath }}{{ inventory_hostname }}. cfg 
38 {% endif %}
39 {% if graphics is defined %}Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 16 / 23
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Ansible
What is
Ansible?
Inventory
Virtual Machines
DEMO
Conclusion
The End
Kickstart file§ ¤
1 # config
2 install
3 cmdline
4 skipx
5 reboot
6 url --url ={{ location }}
7 # authentication
8 rootpw --iscrypted {{ rootpwd }}
9 auth --useshadow --passalgo=sha512
10 firewall --enabled --service=ssh
11 selinux --enforcing
12 # localasation
13 lang {{ language }}
14 keyboard {{ keyboard }}
15 timezone --isUtc {{ timezone }}
16 # network
17 {% for network in networks %}
18 {{ network }}
19 {% endfor %}
20 # partition
21 zerombr
22 clearpart --all --initlabel
23 {% for partition in partitions %}
24 {{ partition }}
25 {% endfor %}
26 {{ bootloader }}
27 # first booting
28 firstboot --disable
29 logging --level=info
30 reboot
31 # repositories
32 {% for repo in repos %}
33 repo --name ={{ repo.name }} --baseurl ={{ repo.uri }} --cost ={{ repo.cost }}
34 {% endfor %}
35 # package selection
36 %packages --nobase --excludedocs
37 @core
38 %end
39 # post script
40 %post --log=/ root/post -ks -logIcinga2 through Ansible Toshaan Bharvani - VanTosh bvba 17 / 23
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Ansible
What is
Ansible?
Inventory
Virtual Machines
DEMO
Conclusion
The End
3
DEMO
Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 18 / 23
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Ansible
What is
Ansible?
Inventory
Virtual Machines
DEMO
Conclusion
The End
Demo
Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 19 / 23
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Ansible
What is
Ansible?
Inventory
Virtual Machines
DEMO
Conclusion
The End
4
Conclusion
Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 20 / 23
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Ansible
What is
Ansible?
Inventory
Virtual Machines
DEMO
Conclusion
The End
Conclusion
Automation MUST
[RFC2119] be easy
Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 21 / 23
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Ansible
What is
Ansible?
Inventory
Virtual Machines
DEMO
Conclusion
The End
More information
Icinga : http://www.icinga.org
Ansible : http://www.ansible.com/
Ansible Install VM : https:
//github.com/toshywoshy/ansible-roles-vminstall
Ansible Roles Icinga :
https://github.com/toshywoshy/ansible-roles-icinga2
Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 22 / 23
Icinga2 through
Ansible
Toshaan
Bharvani -
VanTosh bvba
Ansible
What is
Ansible?
Inventory
Virtual Machines
DEMO
Conclusion
The End
The End
Thank You
Toshaan Bharvani - VanTosh bvba <toshaan@vantosh.com>
http://www.vantosh.com/
Made with Beamer LATEX
a TEXbased Presentation program
Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 23 / 23

Contenu connexe

Tendances

Icinga lsm 2015 copy
Icinga lsm 2015 copyIcinga lsm 2015 copy
Icinga lsm 2015 copy
NETWAYS
 

Tendances (20)

Why favour Icinga over Nagios - Rootconf 2015
Why favour Icinga over Nagios - Rootconf 2015Why favour Icinga over Nagios - Rootconf 2015
Why favour Icinga over Nagios - Rootconf 2015
 
Why favour Icinga over Nagios @ OSDC 2015
Why favour Icinga over Nagios @ OSDC 2015Why favour Icinga over Nagios @ OSDC 2015
Why favour Icinga over Nagios @ OSDC 2015
 
Icinga @OSMC 2013
Icinga @OSMC 2013Icinga @OSMC 2013
Icinga @OSMC 2013
 
Current State of Icinga - FlossUK 2014
Current State of Icinga - FlossUK 2014Current State of Icinga - FlossUK 2014
Current State of Icinga - FlossUK 2014
 
Icinga Camp Barcelona - Current State of Icinga
Icinga Camp Barcelona - Current State of IcingaIcinga Camp Barcelona - Current State of Icinga
Icinga Camp Barcelona - Current State of Icinga
 
Icinga @GUUG 2013
Icinga @GUUG 2013Icinga @GUUG 2013
Icinga @GUUG 2013
 
Icinga lsm 2015 copy
Icinga lsm 2015 copyIcinga lsm 2015 copy
Icinga lsm 2015 copy
 
Open Source Monitoring with Icinga at Fossasia 2015
Open Source Monitoring with Icinga at Fossasia 2015Open Source Monitoring with Icinga at Fossasia 2015
Open Source Monitoring with Icinga at Fossasia 2015
 
Icinga2 Hacking Session 2014-10-10
Icinga2 Hacking Session 2014-10-10Icinga2 Hacking Session 2014-10-10
Icinga2 Hacking Session 2014-10-10
 
Icinga 2011 at Nagios Workshop
Icinga 2011 at Nagios WorkshopIcinga 2011 at Nagios Workshop
Icinga 2011 at Nagios Workshop
 
Icinga 2 and puppet: automate monitoring
Icinga 2 and puppet: automate monitoringIcinga 2 and puppet: automate monitoring
Icinga 2 and puppet: automate monitoring
 
Icinga 1, Icinga 2 @ FrOSCon 2014
Icinga 1, Icinga 2 @ FrOSCon 2014Icinga 1, Icinga 2 @ FrOSCon 2014
Icinga 1, Icinga 2 @ FrOSCon 2014
 
Icinga @CLT 2013
Icinga @CLT 2013Icinga @CLT 2013
Icinga @CLT 2013
 
Icinga 2 @ SIG-NOC Meeting
Icinga 2 @ SIG-NOC MeetingIcinga 2 @ SIG-NOC Meeting
Icinga 2 @ SIG-NOC Meeting
 
Icinga Camp Barcelona - Icinga
Icinga Camp Barcelona - IcingaIcinga Camp Barcelona - Icinga
Icinga Camp Barcelona - Icinga
 
Welcome Icinga Camp San Francisco 2014
Welcome Icinga Camp San Francisco 2014Welcome Icinga Camp San Francisco 2014
Welcome Icinga Camp San Francisco 2014
 
Icinga 2012 Development at 6th TF-NOC Meeting
Icinga 2012 Development at 6th TF-NOC MeetingIcinga 2012 Development at 6th TF-NOC Meeting
Icinga 2012 Development at 6th TF-NOC Meeting
 
Icinga2 - Upcoming API for Icinga2
Icinga2 - Upcoming API for Icinga2Icinga2 - Upcoming API for Icinga2
Icinga2 - Upcoming API for Icinga2
 
Monitoring with Icinga2 at Adobe
Monitoring with Icinga2 at AdobeMonitoring with Icinga2 at Adobe
Monitoring with Icinga2 at Adobe
 
Icinga 2010 at CeBIT
Icinga 2010 at CeBITIcinga 2010 at CeBIT
Icinga 2010 at CeBIT
 

En vedette

Cebit 2015 icinga
Cebit 2015 icingaCebit 2015 icinga
Cebit 2015 icinga
Icinga
 

En vedette (17)

Icinga 2010 at OSMC
Icinga 2010 at OSMCIcinga 2010 at OSMC
Icinga 2010 at OSMC
 
Icinga at Flossuk 2015 in York
Icinga at Flossuk 2015 in YorkIcinga at Flossuk 2015 in York
Icinga at Flossuk 2015 in York
 
Icinga Web 2 at Icinga Camp San Francisco
Icinga Web 2 at Icinga Camp San FranciscoIcinga Web 2 at Icinga Camp San Francisco
Icinga Web 2 at Icinga Camp San Francisco
 
IcingaCamp Portland 2015 - Welcome
IcingaCamp Portland 2015 - WelcomeIcingaCamp Portland 2015 - Welcome
IcingaCamp Portland 2015 - Welcome
 
Icinga Camp Antwerp - Current State of Icinga
Icinga Camp Antwerp - Current State of IcingaIcinga Camp Antwerp - Current State of Icinga
Icinga Camp Antwerp - Current State of Icinga
 
Icinga 2011 at FrOSCon 6
Icinga 2011 at FrOSCon 6Icinga 2011 at FrOSCon 6
Icinga 2011 at FrOSCon 6
 
Icinga Camp Barcelona - Icinga Web 2
Icinga Camp Barcelona - Icinga Web 2Icinga Camp Barcelona - Icinga Web 2
Icinga Camp Barcelona - Icinga Web 2
 
Icinga 2011 at OSMC
Icinga 2011 at OSMCIcinga 2011 at OSMC
Icinga 2011 at OSMC
 
Icinga 2 at Icinga Camp San Francisco
Icinga 2 at Icinga Camp San FranciscoIcinga 2 at Icinga Camp San Francisco
Icinga 2 at Icinga Camp San Francisco
 
Icinga Web 2 at Icinga Camp Antwerp
Icinga Web 2 at Icinga Camp AntwerpIcinga Web 2 at Icinga Camp Antwerp
Icinga Web 2 at Icinga Camp Antwerp
 
Loadays 2015 - Enterprise Monitoring with Icinga
Loadays 2015 - Enterprise Monitoring with IcingaLoadays 2015 - Enterprise Monitoring with Icinga
Loadays 2015 - Enterprise Monitoring with Icinga
 
Icinga @ OSMC 2014
Icinga @ OSMC 2014Icinga @ OSMC 2014
Icinga @ OSMC 2014
 
Icinga Camp Antwerp - Icinga2 Cluster
Icinga Camp Antwerp - Icinga2 ClusterIcinga Camp Antwerp - Icinga2 Cluster
Icinga Camp Antwerp - Icinga2 Cluster
 
Cebit 2015 icinga
Cebit 2015 icingaCebit 2015 icinga
Cebit 2015 icinga
 
Icinga 2012 at Monitoring Workshop
Icinga 2012 at Monitoring WorkshopIcinga 2012 at Monitoring Workshop
Icinga 2012 at Monitoring Workshop
 
Icinga2 at PuppetLabs
Icinga2 at PuppetLabsIcinga2 at PuppetLabs
Icinga2 at PuppetLabs
 
Icinga at OSMC 2012
Icinga at OSMC 2012Icinga at OSMC 2012
Icinga at OSMC 2012
 

Similaire à Toshaan Bharvani – Icinga2 and Ansible, how to manage and migrate

Similaire à Toshaan Bharvani – Icinga2 and Ansible, how to manage and migrate (20)

Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with Vagrant
 
OpenNebula 5.4 Hands-on Tutorial
OpenNebula 5.4 Hands-on TutorialOpenNebula 5.4 Hands-on Tutorial
OpenNebula 5.4 Hands-on Tutorial
 
Minicurso de Vagrant
Minicurso de VagrantMinicurso de Vagrant
Minicurso de Vagrant
 
Assembling an Open Source Toolchain to Manage Public, Private and Hybrid Clou...
Assembling an Open Source Toolchain to Manage Public, Private and Hybrid Clou...Assembling an Open Source Toolchain to Manage Public, Private and Hybrid Clou...
Assembling an Open Source Toolchain to Manage Public, Private and Hybrid Clou...
 
Intro to vagrant
Intro to vagrantIntro to vagrant
Intro to vagrant
 
NAS Botnet Revealed - Mining Bitcoin
NAS Botnet Revealed - Mining Bitcoin NAS Botnet Revealed - Mining Bitcoin
NAS Botnet Revealed - Mining Bitcoin
 
Vagrant for real
Vagrant for realVagrant for real
Vagrant for real
 
Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)Vagrant for real (codemotion rome 2016)
Vagrant for real (codemotion rome 2016)
 
Integrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suiteIntegrating icinga2 and the HashiCorp suite
Integrating icinga2 and the HashiCorp suite
 
Hacktivity 2016: Stealthy, hypervisor based malware analysis
Hacktivity 2016: Stealthy, hypervisor based malware analysisHacktivity 2016: Stealthy, hypervisor based malware analysis
Hacktivity 2016: Stealthy, hypervisor based malware analysis
 
DevOps(2) : Vagrant - (MOSG)
DevOps(2) : Vagrant  -  (MOSG)DevOps(2) : Vagrant  -  (MOSG)
DevOps(2) : Vagrant - (MOSG)
 
DevSecCon Asia 2017: Guillaume Dedrie: A trip through the securitiy of devops...
DevSecCon Asia 2017: Guillaume Dedrie: A trip through the securitiy of devops...DevSecCon Asia 2017: Guillaume Dedrie: A trip through the securitiy of devops...
DevSecCon Asia 2017: Guillaume Dedrie: A trip through the securitiy of devops...
 
Python Hashlib & A True Story of One Bug
Python Hashlib & A True Story of One BugPython Hashlib & A True Story of One Bug
Python Hashlib & A True Story of One Bug
 
Postgres the hardway
Postgres the hardwayPostgres the hardway
Postgres the hardway
 
Pursue container architecture with mincs
Pursue container architecture with mincsPursue container architecture with mincs
Pursue container architecture with mincs
 
Tech Talk - Vagrant
Tech Talk - VagrantTech Talk - Vagrant
Tech Talk - Vagrant
 
Vagrant-Overview
Vagrant-OverviewVagrant-Overview
Vagrant-Overview
 
Puppet and the HashiCorp Suite
Puppet and the HashiCorp SuitePuppet and the HashiCorp Suite
Puppet and the HashiCorp Suite
 
Mininet Basics
Mininet BasicsMininet Basics
Mininet Basics
 
KVM tools and enterprise usage
KVM tools and enterprise usageKVM tools and enterprise usage
KVM tools and enterprise usage
 

Plus de Icinga

Plus de Icinga (20)

Upgrading Incident Management with Icinga - Icinga Camp Milan 2023
Upgrading Incident Management with Icinga - Icinga Camp Milan 2023Upgrading Incident Management with Icinga - Icinga Camp Milan 2023
Upgrading Incident Management with Icinga - Icinga Camp Milan 2023
 
Extending Icinga Web with Modules: powerful, smart and easily created - Icing...
Extending Icinga Web with Modules: powerful, smart and easily created - Icing...Extending Icinga Web with Modules: powerful, smart and easily created - Icing...
Extending Icinga Web with Modules: powerful, smart and easily created - Icing...
 
Infrastructure Monitoring for Cloud Native Enterprises - Icinga Camp Milan 2023
Infrastructure Monitoring for Cloud Native Enterprises - Icinga Camp Milan 2023Infrastructure Monitoring for Cloud Native Enterprises - Icinga Camp Milan 2023
Infrastructure Monitoring for Cloud Native Enterprises - Icinga Camp Milan 2023
 
Incident management: Best industry practices your team should know - Icinga C...
Incident management: Best industry practices your team should know - Icinga C...Incident management: Best industry practices your team should know - Icinga C...
Incident management: Best industry practices your team should know - Icinga C...
 
Monitoring Cooling Units in a pharmaceutical GxP regulated environment - Icin...
Monitoring Cooling Units in a pharmaceutical GxP regulated environment - Icin...Monitoring Cooling Units in a pharmaceutical GxP regulated environment - Icin...
Monitoring Cooling Units in a pharmaceutical GxP regulated environment - Icin...
 
SNMP Monitoring at scale - Icinga Camp Milan 2023
SNMP Monitoring at scale - Icinga Camp Milan 2023SNMP Monitoring at scale - Icinga Camp Milan 2023
SNMP Monitoring at scale - Icinga Camp Milan 2023
 
Monitoring Kubernetes with Icinga - Icinga Camp Milan 2023
Monitoring Kubernetes with Icinga - Icinga Camp Milan 2023Monitoring Kubernetes with Icinga - Icinga Camp Milan 2023
Monitoring Kubernetes with Icinga - Icinga Camp Milan 2023
 
Current State of Icinga - Icinga Camp Milan 2023
Current State of Icinga - Icinga Camp Milan 2023Current State of Icinga - Icinga Camp Milan 2023
Current State of Icinga - Icinga Camp Milan 2023
 
Efficient IT operations using monitoring systems and standardized tools - Ici...
Efficient IT operations using monitoring systems and standardized tools - Ici...Efficient IT operations using monitoring systems and standardized tools - Ici...
Efficient IT operations using monitoring systems and standardized tools - Ici...
 
Tornado Complex Event Processing Framework for Icinga - Icinga Camp Zurich 2019
Tornado Complex Event Processing Framework for Icinga - Icinga Camp Zurich 2019Tornado Complex Event Processing Framework for Icinga - Icinga Camp Zurich 2019
Tornado Complex Event Processing Framework for Icinga - Icinga Camp Zurich 2019
 
Signalilo: Visualizing Prometheus alerts in Icinga2 - Icinga Camp Zurich 2019
Signalilo: Visualizing Prometheus alerts in Icinga2 - Icinga Camp Zurich 2019Signalilo: Visualizing Prometheus alerts in Icinga2 - Icinga Camp Zurich 2019
Signalilo: Visualizing Prometheus alerts in Icinga2 - Icinga Camp Zurich 2019
 
Moving from Icinga 1 to Icinga 2 + Director - Icinga Camp Zurich 2019
Moving from Icinga 1 to Icinga 2 + Director - Icinga Camp Zurich 2019Moving from Icinga 1 to Icinga 2 + Director - Icinga Camp Zurich 2019
Moving from Icinga 1 to Icinga 2 + Director - Icinga Camp Zurich 2019
 
Icinga Director and vSphereDB - how they play together - Icinga Camp Zurich 2019
Icinga Director and vSphereDB - how they play together - Icinga Camp Zurich 2019Icinga Director and vSphereDB - how they play together - Icinga Camp Zurich 2019
Icinga Director and vSphereDB - how they play together - Icinga Camp Zurich 2019
 
Current State of Icinga - Icinga Camp Zurich 2019
Current State of Icinga - Icinga Camp Zurich 2019Current State of Icinga - Icinga Camp Zurich 2019
Current State of Icinga - Icinga Camp Zurich 2019
 
NetEye 4 based on Icinga 2 - Icinga Camp Milan 2019
NetEye 4 based on Icinga 2 - Icinga Camp Milan 2019NetEye 4 based on Icinga 2 - Icinga Camp Milan 2019
NetEye 4 based on Icinga 2 - Icinga Camp Milan 2019
 
Integrating Icinga 2 and ntopng - Icinga Camp Milan 2019
Integrating Icinga 2 and ntopng - Icinga Camp Milan 2019Integrating Icinga 2 and ntopng - Icinga Camp Milan 2019
Integrating Icinga 2 and ntopng - Icinga Camp Milan 2019
 
DevOps monitoring: Best Practices using OpenShift combined with Icinga & Big ...
DevOps monitoring: Best Practices using OpenShift combined with Icinga & Big ...DevOps monitoring: Best Practices using OpenShift combined with Icinga & Big ...
DevOps monitoring: Best Practices using OpenShift combined with Icinga & Big ...
 
Current State of Icinga - Icinga Camp Milan 2019
Current State of Icinga - Icinga Camp Milan 2019Current State of Icinga - Icinga Camp Milan 2019
Current State of Icinga - Icinga Camp Milan 2019
 
Best of Icinga Modules - Icinga Camp Milan 2019
Best of Icinga Modules - Icinga Camp Milan 2019Best of Icinga Modules - Icinga Camp Milan 2019
Best of Icinga Modules - Icinga Camp Milan 2019
 
hallenges of Monitoring Big Infrastructure - Icinga Camp Milan 2019
hallenges of Monitoring Big Infrastructure - Icinga Camp Milan 2019hallenges of Monitoring Big Infrastructure - Icinga Camp Milan 2019
hallenges of Monitoring Big Infrastructure - Icinga Camp Milan 2019
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Dernier (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 

Toshaan Bharvani – Icinga2 and Ansible, how to manage and migrate

  • 1. Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Ansible What is Ansible? Inventory Virtual Machines DEMO Conclusion The End Icinga2 through Ansible Monitoring migration through automation Toshaan Bharvani - VanTosh bvba <toshaan@vantosh.com> Icinga Camp Antwerp 2015 13 April 2015 Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 1 / 23
  • 2. Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Ansible What is Ansible? Inventory Virtual Machines DEMO Conclusion The End $ whoami Toshaan Bharvani - VanTosh From Antwerp, Belgium Self-employed engineer/trainer (available for hire) http://www.vantosh.com Involved with Enterprise OS : RHEL, CentOS, IBM AIX, OpenBSD, FreeBSD, SLES, . . . Likes to keep everything secure : SELinux, WebSec, . . . Lives in a virtual world : KVM, Xen, LXC, PowerVM, z/VM, . . . Likes automation : Ansible, Puppet, Salt Works on both hardware and software side Wants to take over the world Twitter : @toshywoshy Blog : http://www.toshaan.com Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 2 / 23
  • 3. Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Ansible What is Ansible? Inventory Virtual Machines DEMO Conclusion The End Table of contents 1 Ansible What is Ansible? Inventory 2 Virtual Machines 3 DEMO 4 Conclusion Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 3 / 23
  • 4. Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Ansible What is Ansible? Inventory Virtual Machines DEMO Conclusion The End Monitoring Sucks! Nagios Zenoss Zabbix Ganglia Icinga OpsView Shinken Icinga2 Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 4 / 23
  • 5. Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Ansible What is Ansible? Inventory Virtual Machines DEMO Conclusion The End 1 Ansible Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 5 / 23
  • 6. Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Ansible What is Ansible? Inventory Virtual Machines DEMO Conclusion The End “Ansible is a fictional machine capable of instantaneous or superluminal communication. Typically it is depicted as a lunch-box-sized object with some combination of microphone, speaker, keyboard and display. It can send and receive messages to and from a corresponding device over any distance whatsoever with no delay.”1 Configuration Management Tool System Orchestration Tool Remote Execution/Deployment Tool . . . 1Rocannon’s World - Ursula K. Le Guin Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 6 / 23
  • 7. Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Ansible What is Ansible? Inventory Virtual Machines DEMO Conclusion The End An overview Python2 based Server based, agentless2 uses SSH (can use accelerated mode uses a daemon and port) host information in flat files, CMDB, scripts, . . . executes a task on the host side Playbook : combination of tasks with meta information YAML JSON Templates : Jinja2 works where Python2 works3 2Abstraction of SSH and in certain setup an agent might be required, but by default it is not necessary 3Ansible can actually run without Python on the remote host, however it is not fully supported Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 7 / 23
  • 8. Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Ansible What is Ansible? Inventory Virtual Machines DEMO Conclusion The End Internal Design Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 8 / 23
  • 9. Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Ansible What is Ansible? Inventory Virtual Machines DEMO Conclusion The End Normal Adhoc Mode Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 9 / 23
  • 10. Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Ansible What is Ansible? Inventory Virtual Machines DEMO Conclusion The End Delegation Mode Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 10 / 23
  • 11. Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Ansible What is Ansible? Inventory Virtual Machines DEMO Conclusion The End Inventory - Hypervisors hosts file is by default in ini format § ¤ 1 [hypervisors ] 2 hypervisor0 ansible_ssh_host =hyper0.vantosh.com ansible_ssh_port =22221 ansible_ssh_user =ansible ansible_ssh_private_key_file =/ path/to/my/private/ key0 3 hypervisor1 ansible_ssh_host =hyper1.vantosh.com ansible_ssh_port =22222 ansible_ssh_user =ansible ansible_ssh_private_key_file =/ path/to/my/private/ key1 4 hypervisor2 ansible_ssh_host =hyper2.vantosh.com ansible_ssh_port =22223 ansible_ssh_user =ansible ansible_ssh_private_key_file =/ path/to/my/private/ key2 5 hypervisor3 ansible_ssh_host =hyper3.vantosh.com ansible_ssh_port =22224 ansible_ssh_user =ansible ansible_ssh_private_key_file =/ path/to/my/private/ key3 6 7 [ virtualmachines ] 8 vm0 ansible_ssh_host =vm0.vantosh.com ansible_ssh_port =22230 ansible_ssh_user =ansible ansible_ssh_private_key_file =/ path/to/my/private/ key4 9 vm1 ansible_ssh_host =vm1.vantosh.com ansible_ssh_port =22231 ansible_ssh_user =ansible ansible_ssh_private_key_file =/ path/to/my/private/ key5 10 vm2 11 vm3 ¦ ¥ Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 11 / 23
  • 12. Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Ansible What is Ansible? Inventory Virtual Machines DEMO Conclusion The End Inventory - Virtual Machine (el7) § ¤ 1 --- 2 hyper: hypervisor0 3 distro: centos7 4 rootpwd: $1$f0pPKH0e$0xrX07Ki9DPmpcmJooede7X . 5 virtualfilespath : /virtual/ 6 disks: 7 - { path: /virtual/star -boot0.qcow2 , size: 512M } 8 - { path: /virtual/star -root0.qcow2 , size: 6G } 9 - { path: /virtual/star -swap0.qcow2 , size: 512M } 10 - { path: /virtual/star -swap1.qcow2 , size: 512M } 11 vmwaittime: 5 12 virtualcpus: 1 13 ramsize: 512 14 language: en_US 15 keyboard: us 16 timezone: "Europe/Brussels" 17 nics: 18 - { type: bridge , name: br0 , model: virtio , bootproto: dhcp , device: eth0 , onboot: on } 19 hostname: star.vantosh.com 20 partitions: 21 - part /boot --ondisk=vda --asprimary --fstype="xfs" --fsoptions=’defaults , noatime ,discard ’ --grow --size =1 22 - part pv.01 --ondisk=vdb --asprimary --grow --size =1 23 - volgroup VolGroupRoot --pesize =131072 pv.01 24 - logvol / --fstype="xfs" --fsoptions=’defaults ,noatime ,discard ’ --name= LogVolRoot0 --vgname= VolGroupRoot --grow --size =1 25 - part swap --onpart=vdc --asprimary --fstype="swap" --fsoptions=’defaults , discard ’ --grow --size =1 26 - part swap --onpart=vdd --asprimary --fstype="swap" --fsoptions=’defaults , discard ’ --grow --size =1 27 bootloader: bootloader --location=mbr --driveorder=vda ,vdb ,vdc ,vdd 28 sshdrsakeylength : 8192 29 sshdecdsakeylength : 521 30 users: 31 - { name: supervisor , id: 1000 , ssh: yes , sshpubkey: /home/toshywoshy /. keys/id_star.pub } ¦ ¥ Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 12 / 23
  • 13. Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Ansible What is Ansible? Inventory Virtual Machines DEMO Conclusion The End 2 Virtual Machines Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 13 / 23
  • 14. Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Ansible What is Ansible? Inventory Virtual Machines DEMO Conclusion The End Playbooks - el7§ ¤ 1 --- 2 - name: install -vm -el6 3 hosts: "{{ host }}" 4 vars_files: 5 - "vars/distros /{{ distro }}. yml" 6 gather_facts : no 7 sudo: yes 8 pre_tasks: 9 - local_action : slurp src ={{ ansible_ssh_private_key_file }}. pub 10 sudo: no 11 register: sshpubkey 12 - action: qemu -img dest ={{ item.path }} size ={{ item.size }} format="qcow2" options=" preallocation =metadata" 13 with_items: disks 14 delegate_to: "{{ hyper }}" 15 - action: template src="~/. ansible/playbooks/templates/el6/kickstart.cfg" dest="{{ virtualfilespath }}{{ inventory_hostname }}. cfg" 16 delegate_to: "{{ hyper }}" 17 - action: template src="~/. ansible/playbooks/templates/common/install -vm.sh " dest="{{ virtualfilespath }}{{ inventory_hostname }}-create -vm.sh" owner=root group=root mode =770 18 delegate_to: "{{ hyper }}" 19 - action: command /bin/bash {{ virtualfilespath }}{{ inventory_hostname }}- create -vm.sh 20 delegate_to: "{{ hyper }}" 21 register: createdvm 22 - local_action : pause minutes ={{ vmwaittime }} 23 - action: template src="templates/common/minram.sh" dest="{{ virtualfilespath }}{{ inventory_hostname }}- minram.sh" owner=root group= root mode =770 24 delegate_to: "{{ hyper }}" 25 when: ramsize < minram 26 - action: command /bin/bash {{ virtualfilespath }}{{ inventory_hostname }}- minram.sh 27 delegate_to: "{{ hyper }}" 28 when: ramsize < minram 29 - action: virt guest ={{ inventory_hostname }} command=start 30 delegate_to: "{{ hyper }}" 31 ignore_errors : yes 32 - action: file path ={{ item }} state=absentIcinga2 through Ansible Toshaan Bharvani - VanTosh bvba 14 / 23
  • 15. Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Ansible What is Ansible? Inventory Virtual Machines DEMO Conclusion The End Variables - el7 § ¤ 1 --- 2 distroname: centos7 3 distrotype: rhel7 4 templatetype : el7 5 minram: 512 6 location: "http :// be.mirror.eurid.eu/centos /7/ os/x86_64/" 7 repos: 8 - { name: "CentOS -base", uri: "http :// be.mirror.eurid.eu/centos /7/ os/x86_64/" , cost: 100 } 9 - { name: "CentOS -updates", uri: "http ://be.mirror.eurid.eu/centos /7/ updates/ x86_64/", cost: 200 } 10 - { name: "CentOS -fasttrack", uri: "http :// be.mirror.eurid.eu/centos /7/ fasttrack/x86_64/", cost: 300 } 11 - { name: "CentOS -extras", uri: "http ://be.mirror.eurid.eu/centos /7/ extras/ x86_64/", cost: 400 } 12 textrargs: ’text ks=file :/{{ inventory_hostname }}. cfg console=ttyS0 ,115200 headless noshell nofirewire ’ ¦ ¥ Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 15 / 23
  • 16. Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Ansible What is Ansible? Inventory Virtual Machines DEMO Conclusion The End Install script§ ¤ 1 #!/bin/bash 2 3 if [ ! -f /etc/libvirt/qemu /{{ inventory_hostname }}. xml ]; then 4 5 virt -install 6 --name ={{ inventory_hostname }} 7 --vcpus ={{ virtualcpus }} 8 {% if minram is defined and ramsize < minram %} 9 --ram ={{ minram }} 10 {% else %} 11 --ram ={{ ramsize }} 12 {% endif %} 13 --hvm 14 --accelerate 15 --os -variant ={{ distrotype }} 16 {% for disk in disks %} 17 {% if disk.size [ -1:] == ’T’ %} 18 {% set disk_size = (disk.size [: -1]| float) * 1024 %} 19 {% elif disk.size [ -1:] == ’G’ %} 20 {% set disk_size = (disk.size [: -1]| float) %} 21 {% elif disk.size [ -1:] == ’M’ %} 22 {% set disk_size = (disk.size [: -1]| float) / 1024 %} 23 {% elif disk.size [ -1:] == ’K’ %} 24 {% set disk_size = (disk.size [: -1]| float) / 1024 / 1024 %} 25 {% else %} 26 {% set disk_size = (disk.size [: -1]| float) %} 27 {% endif %} 28 --disk path ={{ disk.path }}, device=disk ,size ={{ disk_size }}, cache=writeback , format=qcow2 ,io=threads ,bus=virtio 29 {% endfor %} 30 {% for nic in nics %} 31 --network {{ nic.type }}={{ nic.name }}, model ={{ nic.model }} 32 {% endfor %} 33 --location ={{ location }} 34 {% if injectfile is defined %} 35 --initrd -inject ={{ virtualfilespath }}{{ injectfile }} 36 {% else %} 37 --initrd -inject ={{ virtualfilespath }}{{ inventory_hostname }}. cfg 38 {% endif %} 39 {% if graphics is defined %}Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 16 / 23
  • 17. Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Ansible What is Ansible? Inventory Virtual Machines DEMO Conclusion The End Kickstart file§ ¤ 1 # config 2 install 3 cmdline 4 skipx 5 reboot 6 url --url ={{ location }} 7 # authentication 8 rootpw --iscrypted {{ rootpwd }} 9 auth --useshadow --passalgo=sha512 10 firewall --enabled --service=ssh 11 selinux --enforcing 12 # localasation 13 lang {{ language }} 14 keyboard {{ keyboard }} 15 timezone --isUtc {{ timezone }} 16 # network 17 {% for network in networks %} 18 {{ network }} 19 {% endfor %} 20 # partition 21 zerombr 22 clearpart --all --initlabel 23 {% for partition in partitions %} 24 {{ partition }} 25 {% endfor %} 26 {{ bootloader }} 27 # first booting 28 firstboot --disable 29 logging --level=info 30 reboot 31 # repositories 32 {% for repo in repos %} 33 repo --name ={{ repo.name }} --baseurl ={{ repo.uri }} --cost ={{ repo.cost }} 34 {% endfor %} 35 # package selection 36 %packages --nobase --excludedocs 37 @core 38 %end 39 # post script 40 %post --log=/ root/post -ks -logIcinga2 through Ansible Toshaan Bharvani - VanTosh bvba 17 / 23
  • 18. Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Ansible What is Ansible? Inventory Virtual Machines DEMO Conclusion The End 3 DEMO Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 18 / 23
  • 19. Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Ansible What is Ansible? Inventory Virtual Machines DEMO Conclusion The End Demo Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 19 / 23
  • 20. Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Ansible What is Ansible? Inventory Virtual Machines DEMO Conclusion The End 4 Conclusion Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 20 / 23
  • 21. Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Ansible What is Ansible? Inventory Virtual Machines DEMO Conclusion The End Conclusion Automation MUST [RFC2119] be easy Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 21 / 23
  • 22. Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Ansible What is Ansible? Inventory Virtual Machines DEMO Conclusion The End More information Icinga : http://www.icinga.org Ansible : http://www.ansible.com/ Ansible Install VM : https: //github.com/toshywoshy/ansible-roles-vminstall Ansible Roles Icinga : https://github.com/toshywoshy/ansible-roles-icinga2 Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 22 / 23
  • 23. Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba Ansible What is Ansible? Inventory Virtual Machines DEMO Conclusion The End The End Thank You Toshaan Bharvani - VanTosh bvba <toshaan@vantosh.com> http://www.vantosh.com/ Made with Beamer LATEX a TEXbased Presentation program Icinga2 through Ansible Toshaan Bharvani - VanTosh bvba 23 / 23