Adding tst inventory, ansible.cfg
This commit is contained in:
parent
f449d2cb4e
commit
92ef17cdc1
19
ansible/2022-08-17.csv
Normal file
19
ansible/2022-08-17.csv
Normal 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
|
||||||
|
12
ansible/ansible.cfg
Normal file
12
ansible/ansible.cfg
Normal 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
|
||||||
BIN
ansible/hooks/__pycache__/update_dashboard.cpython-38.pyc
Normal file
BIN
ansible/hooks/__pycache__/update_dashboard.cpython-38.pyc
Normal file
Binary file not shown.
23
ansible/hooks/update_dashboard.py
Normal file
23
ansible/hooks/update_dashboard.py
Normal 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
44
ansible/hosts-tst
Normal 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
|
||||||
@ -27,25 +27,6 @@
|
|||||||
tags:
|
tags:
|
||||||
- skip_ansible_lint
|
- 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
|
# get number of updates and debug
|
||||||
- name: (debian) update apt cache if older than 1 day
|
- name: (debian) update apt cache if older than 1 day
|
||||||
apt: update_cache=yes cache_valid_time=86400
|
apt: update_cache=yes cache_valid_time=86400
|
||||||
@ -58,9 +39,9 @@
|
|||||||
when: update_cache_result is succeeded
|
when: update_cache_result is succeeded
|
||||||
|
|
||||||
- name: (Debian) output
|
- 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"
|
when: ansible_distribution == "Debian"
|
||||||
|
|
||||||
- name: (Ubuntu) output
|
- 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"
|
when: ansible_distribution == "Ubuntu"
|
||||||
@ -9,28 +9,23 @@
|
|||||||
- apt
|
- apt
|
||||||
- apache2
|
- apache2
|
||||||
- bash
|
- bash
|
||||||
- dnsmasq
|
- check-mk-agent
|
||||||
- exim
|
- elasticsearch
|
||||||
- httpd
|
|
||||||
- libc-bin
|
- libc-bin
|
||||||
- mailx
|
|
||||||
- make
|
- make
|
||||||
- mariadb-server
|
|
||||||
- memcached
|
|
||||||
- mysql-server
|
- mysql-server
|
||||||
- nagios
|
|
||||||
- nginx
|
- nginx
|
||||||
- nrpe
|
|
||||||
- openssh-server
|
- openssh-server
|
||||||
- php5
|
- php5
|
||||||
- php7.0
|
- php7.0
|
||||||
- php7.1
|
- php7.1
|
||||||
- php7.2
|
- php7.2
|
||||||
- php7.4
|
- php7.4
|
||||||
- phpmyadmin
|
|
||||||
- postfix
|
- postfix
|
||||||
|
- proxysql
|
||||||
- redis
|
- redis
|
||||||
- redis-server
|
- redis-server
|
||||||
|
- sphinxsearch
|
||||||
- sudo
|
- sudo
|
||||||
- systemd
|
- systemd
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user