Adding tst inventory, ansible.cfg

This commit is contained in:
Sebastien Laithier 2022-08-17 16:33:32 +02:00
parent f449d2cb4e
commit 92ef17cdc1
9 changed files with 104 additions and 30 deletions

19
ansible/2022-08-17.csv Normal file
View File

@ -0,0 +1,19 @@
vlearning-db001-tst.infolegale.net;Debian;10;0;5
app-db001-tst.infolegale.net;Debian;10;0;9
consults-db001-tst.infolegale.net;Debian;10;0;147
vador-db001-tst.infolegale.net;Debian;10;0;147
tlearning-db003-tst.infolegale.net;Ubuntu;18.04;0;308
transdb-db001-tst.infolegale.net;Debian;10;0;147
mysql8-db001-tst.infolegale.net;Debian;11;3;119
mongo-db001-tst.infolegale.net;Ubuntu;20.04;0;28
orchestrator-mgr001-tst.infolegale.net;Ubuntu;20.04;0;28
redis5-db001-tst.infolegale.net;Debian;10;0;326
redis-db001-tst.infolegale.net;Ubuntu;18.04;0;326
docker-hpv001-tst.infolegale.net;Ubuntu;20.04;0;106
docker-hpv002-tst.infolegale.net;Ubuntu;20.04;0;398
docker-hpv004-tst.infolegale.net;Ubuntu;20.04;0;28
rundeck-sch001-tst.infolegale.net;Debian;10;0;91
docker-hpv003-tst.infolegale.net;Ubuntu;20.04;0;125
proxysql-db001-tst.infolegale.net;Ubuntu;20.04;0;475
docker-hpv005-tst.infolegale.net;Ubuntu;20.04;0;119
docker-hpv006-tst.infolegale.net;Ubuntu;20.04;0;309
1 vlearning-db001-tst.infolegale.net Debian 10 0 5
2 app-db001-tst.infolegale.net Debian 10 0 9
3 consults-db001-tst.infolegale.net Debian 10 0 147
4 vador-db001-tst.infolegale.net Debian 10 0 147
5 tlearning-db003-tst.infolegale.net Ubuntu 18.04 0 308
6 transdb-db001-tst.infolegale.net Debian 10 0 147
7 mysql8-db001-tst.infolegale.net Debian 11 3 119
8 mongo-db001-tst.infolegale.net Ubuntu 20.04 0 28
9 orchestrator-mgr001-tst.infolegale.net Ubuntu 20.04 0 28
10 redis5-db001-tst.infolegale.net Debian 10 0 326
11 redis-db001-tst.infolegale.net Ubuntu 18.04 0 326
12 docker-hpv001-tst.infolegale.net Ubuntu 20.04 0 106
13 docker-hpv002-tst.infolegale.net Ubuntu 20.04 0 398
14 docker-hpv004-tst.infolegale.net Ubuntu 20.04 0 28
15 rundeck-sch001-tst.infolegale.net Debian 10 0 91
16 docker-hpv003-tst.infolegale.net Ubuntu 20.04 0 125
17 proxysql-db001-tst.infolegale.net Ubuntu 20.04 0 475
18 docker-hpv005-tst.infolegale.net Ubuntu 20.04 0 119
19 docker-hpv006-tst.infolegale.net Ubuntu 20.04 0 309

12
ansible/ansible.cfg Normal file
View File

@ -0,0 +1,12 @@
[defaults]
vault_password_file = ~/.vault_password
roles_path = roles
interpreter_python = auto
callback_plugins = ./hooks/
fact_caching = jsonfile
fact_caching_connection = ~/.cache/ansible/
deprecation_warnings=False
[hashi_vault_collection]
url = "https://vault.infolegale.net"
token_file = .vault-token
token_validate = None

View File

@ -0,0 +1,23 @@
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.plugins.callback import CallbackBase
class CallbackModule(CallbackBase):
CALLBACK_VERSION = 2.0
CALLBACK_TYPE = 'stdout'
CALLBACK_NAME = 'update_dashboard'
def v2_runner_on_ok(self, result):
if result._task.action == 'debug':
ansible_msg = result._result.get('msg', None)
if ansible_msg:
print(ansible_msg)
def v2_runner_on_unreachable(self, result):
print("%s;UNREACHABLE" % result._host.get_name())
def v2_runner_on_failed(self, result, ignore_errors=False):
print("%s;FAILED" % result._host.get_name())

44
ansible/hosts-tst Normal file
View File

@ -0,0 +1,44 @@
##########
# VARS
##########
[all:vars]
env='tst'
symfony_env="recette"
vmpass='$6$oIJS8mHoKPJVXZIR$fQVPI7.M9/3wD6O.8JS5iYIL6v0tx3BfmiHKIeb/h88yL9R9GYsGJnePK9UEoBZ2F8AfZhwHGRvV3iv9CGChV.'
relayhost='maildump.infolegale.net'
scriptsToSupervise=[['borg-backup.sh','129600']]
graylogapp="graylog-log001-stg.infolegale.net:12201"
cmk_server_ip="10.12.251.1"
[mysql]
tlearning-db003-tst.infolegale.net
vlearning-db001-tst.infolegale.net
app-db001-tst.infolegale.net
consults-db001-tst.infolegale.net
vador-db001-tst.infolegale.net
transdb-db001-tst.infolegale.net
mysql8-db001-tst.infolegale.net
[mongo]
mongo-db001-tst.infolegale.net
[mgr]
orchestrator-mgr001-tst.infolegale.net
[redis]
redis-db001-tst.infolegale.net
redis5-db001-tst.infolegale.net
[docker]
docker-hpv001-tst.infolegale.net
docker-hpv002-tst.infolegale.net
docker-hpv003-tst.infolegale.net
docker-hpv004-tst.infolegale.net
docker-hpv005-tst.infolegale.net
docker-hpv006-tst.infolegale.net
[proxysql]
proxysql-db001-tst.infolegale.net
[rundeck]
rundeck-sch001-tst.infolegale.net

View File

@ -27,25 +27,6 @@
tags:
- skip_ansible_lint
#
## Debian / RedHat hosts ##
#
# get auto-updates script status
- include: auto-updates-result.yml
when: "'auto_updates' in group_names and
((ansible_os_family == 'RedHat' and ansible_distribution_major_version|int >= 6) or
(ansible_os_family == 'Debian' and ansible_distribution_major_version|int >= 8))"
- name: set status if not in auto-updates
set_fact: auto_updates_status=NA
when: "'auto_updates' not in group_names or
(ansible_os_family == 'RedHat' and ansible_distribution_major_version|int < 6) or
(ansible_os_family == 'Debian' and ansible_distribution_major_version|int < 8)"
## Debian
# get number of updates and debug
- name: (debian) update apt cache if older than 1 day
apt: update_cache=yes cache_valid_time=86400
@ -58,9 +39,9 @@
when: update_cache_result is succeeded
- name: (Debian) output
debug: msg="{{ inventory_hostname }};{{ ansible_distribution }};{{ ansible_distribution_major_version }};{{ available_updates.stdout | default('') }};{{ uptime.stdout }};{{ auto_updates_status | default('UNK')}}"
debug: msg="{{ inventory_hostname }};{{ ansible_distribution }};{{ ansible_distribution_major_version }};{{ available_updates.stdout | default('') }};{{ uptime.stdout }}"
when: ansible_distribution == "Debian"
- name: (Ubuntu) output
debug: msg="{{ inventory_hostname }};{{ ansible_distribution }};{{ ansible_distribution_version }};{{ available_updates.stdout | default('') }};{{ uptime.stdout }};{{ auto_updates_status | default('UNK')}}"
debug: msg="{{ inventory_hostname }};{{ ansible_distribution }};{{ ansible_distribution_version }};{{ available_updates.stdout | default('') }};{{ uptime.stdout }}"
when: ansible_distribution == "Ubuntu"

View File

@ -9,28 +9,23 @@
- apt
- apache2
- bash
- dnsmasq
- exim
- httpd
- check-mk-agent
- elasticsearch
- libc-bin
- mailx
- make
- mariadb-server
- memcached
- mysql-server
- nagios
- nginx
- nrpe
- openssh-server
- php5
- php7.0
- php7.1
- php7.2
- php7.4
- phpmyadmin
- postfix
- proxysql
- redis
- redis-server
- sphinxsearch
- sudo
- systemd