Install Icinga Using Ansible

I wanted to play around with Icinga and automate the installation of it as documented on https://www.icinga.com/docs/icinga2/latest/doc/02-getting-started/

Prerequisites

  • Vagrant
  • Virtualbox
  • Ansible
  • Ansible-vault
  • .vault file in your home folder
  • encrypted_variables.yml in your icinga-poc folder (ignored by .gitignore containing the following variables with your own preferred passwords:
mysql_root_passwd: "abcdefghijklmn"
# SELECT PASSWORD('abcdefghijklmn');
mysql_root_passwd_encrypted: "*1A2B3C4D5E6F7G8H9I0J"
icinga_db_pass: "abcdefghijklmn"
icinga_api_root_pass: "abcdefghijklmn"
icinga_api_pass: "abcdefghijklmn"
icingaweb2_setup_token: "abcdefghijklmn"

If you’ll have cloned https://bitbucket.org/masterdam79/icinga-poc/src/master/ and cd into the icinga-poc directory, you’ll be able to run the playbook doing most of the install as follows:

ansible-playbook -i hosts --vault-password-file=~/.vault playbook.yml

If you then go to http://192.168.22.155/icingaweb2/setup you’ll be able to set-up your icinga2 server with the credentials above.

Leave a comment

Your email address will not be published. Required fields are marked *