Ansible

Handling and verifying hosts file

Every time I create a new playbook, I want to verify, that I grouped the hosts correctly. Here I is my "How I do it". First of all. My hosts files are always in the yaml format, even tough it could be an INI file. I am using this format, as all playbooks use this format as well. Example hosts.ya...

Ansible Cheatsheet

Display ansible settings It can be verified which ansible.cfg file is used. ansible --version ansible 2.10.5 config file = /home/ansible/devops/ansible/stpf/setup/ansible.cfg configured module search path = ['/home/ansible/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']...

Install zabbix agent with ansible

I have already an installation guide, on how to install the zabbix agent on linux servers here. Here I show how to create an ansible playbook, which automates the installation. Functionality of the playbook Installs zabbix agent version 5.2 (handled by a variable) works on Ubuntu 20.04 and...

Install Ansible on Debian 10

As Debian takes the Ansibe repository of Ubuntu, the following line has to be appended at /etc/apt/sources.list deb http://ppa.launchpad.net/ansible/ansible/ubuntu trusty main sudo apt-get update sudo apt-get install software-properties-common sudo apt-key adv --keyserver keyserver.ubuntu.com --...

Handle sensitive data in Ansible

First we need a file, which contains the secrets. In my example the file is calles “secrets_demo.enc” and contains originally the following content: sql_root_pw: Sup3rStr0ng another_sql_pw: notThatSecure This file needs to be encrypted by ansible vault: ansible-vault encrypt secrets.enc New Va...