Compare commits
1 Commits
v0.0.7e-ak
...
v0.0.6t-ps
Author | SHA1 | Date | |
---|---|---|---|
d16ccae801 |
@ -1,21 +0,0 @@
|
|||||||
# Rôle Kea
|
|
||||||
***
|
|
||||||
Rôle Kea: Configuration de 2 serveurs KEA en mode haute disponbilité.
|
|
||||||
|
|
||||||
## Tables des matières
|
|
||||||
1. [Que fait le rôle Kea ?]
|
|
||||||
2. [Installation et configuration de ka]
|
|
||||||
3. [Remarques]
|
|
||||||
|
|
||||||
|
|
||||||
## Que fait le rôle Kea ?
|
|
||||||
Le rôle KEA permet de configurer 1 serveurs kea (s-kea1 et s-kea2) en mode haute disponibilité.
|
|
||||||
- Le serveur **s-kea1** sera en mode **primary** il délivrera les baux DHCP sur le réseau n-user.
|
|
||||||
- Le serveur **s-kea2**, sera en mode **stand-by** le service DHCP basculera donc sur **s-kea2** en cas disponibilité du serveur**s-kea1**.
|
|
||||||
|
|
||||||
### Installation et configuration de kea
|
|
||||||
|
|
||||||
Le rôle kea installe les packets **kea dhcp4, hooks, admin** une fois les packets installer. Il configure un serveur kea pour qu'il distribue les ips sur le réseau n-user et soit en haute disponibilité.
|
|
||||||
|
|
||||||
### Remarquees ###
|
|
||||||
Une fois le playbook **s-kea** correctement terminé et la machine **s-kea** redemarrée, redémarrée le service **isc-kea-dhcp4.service** afin de prendre en compte les modifications éfféctuées sur la couche réseau par le role POST.
|
|
@ -1,8 +0,0 @@
|
|||||||
#variable kea
|
|
||||||
kea_ver: "2.4.1"
|
|
||||||
kea_dbname: ""
|
|
||||||
kaa_dbuser: ""
|
|
||||||
kea_dbpasswd: ""
|
|
||||||
kea_dhcp4_dir: "/etc/kea/kea-dhcp4.conf"
|
|
||||||
kea_ctrl_dir: "/etc/kea/kea-ctrl-agent.conf"
|
|
||||||
|
|
@ -1,6 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Restart isc-stork-server.service
|
|
||||||
ansible.builtin.service:
|
|
||||||
name: isc-stork-server.service
|
|
||||||
state: restarted
|
|
||||||
enabled: yes
|
|
@ -1,47 +0,0 @@
|
|||||||
---
|
|
||||||
- name: Preparation
|
|
||||||
ansible.builtin.shell: curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.28.5+k3s1 sh -s - --write-kubeconfig-mode 644 --node-ip "{{ awx_ip }}" --flanel-iface "{{ awx_if }}"
|
|
||||||
|
|
||||||
- name: clonage du dépot awx-on-k3s
|
|
||||||
git:
|
|
||||||
repo: https://github.com/kurokobo/awx-on-k3s.git
|
|
||||||
dest: "{{ awx_dir }}"
|
|
||||||
clone: yes
|
|
||||||
force: yes
|
|
||||||
|
|
||||||
- name: Deploiement AWX Operator ...
|
|
||||||
ansible.builtin.shell: "kubectl apply -k operator"
|
|
||||||
args:
|
|
||||||
chdir: "{{ awx_dir }}"
|
|
||||||
|
|
||||||
- name: Git checkout
|
|
||||||
ansible.builtin.git:
|
|
||||||
repo: 'https://github.com/kurokobo/awx-on-k3s.git'
|
|
||||||
dest: "{{ awx_dir }}"
|
|
||||||
version: release-2.10.0
|
|
||||||
|
|
||||||
- name: Generation de certification auto-signé
|
|
||||||
ansible.builtin.shell: 'openssl req -x509 -nodes -days 3650 -newkey rsa:2048 -out ./base/tls.crt -keyout ./base/tls.key -subj "/CN={{ awx_host }}/O={{ awx_host }}" -addext "subjectAltName = DNS:{{ awx_host }}"'
|
|
||||||
args:
|
|
||||||
chdir: "{{ awx_dir }}"
|
|
||||||
|
|
||||||
- name: creation du repertoire postgres-13
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: /data/postgres-13
|
|
||||||
state: directory
|
|
||||||
mode: '0755'
|
|
||||||
|
|
||||||
- name: Creation repertoire projects
|
|
||||||
ansible.builtin.file:
|
|
||||||
path: /data/projects
|
|
||||||
state: directory
|
|
||||||
owner: 1000:0
|
|
||||||
|
|
||||||
- name: Deploiement d'AWX ...
|
|
||||||
ansible.builtin.shell: "kubectl apply -k base"
|
|
||||||
args:
|
|
||||||
chdir: "{{ awx_dir }}"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
|||||||
### database settings
|
|
||||||
### the address of a PostgreSQL database
|
|
||||||
STORK_DATABASE_HOST=localhost
|
|
||||||
### the port of a PostgreSQL database
|
|
||||||
STORK_DATABASE_PORT=5432
|
|
||||||
### the name of a database
|
|
||||||
STORK_DATABASE_NAME={{ stork_db_name }}
|
|
||||||
### the username for connecting to the database
|
|
||||||
STORK_DATABASE_USER_NAME={{ stork_db_user }}
|
|
||||||
### the SSL mode for connecting to the database
|
|
||||||
### possible values: disable, require, verify-ca, or verify-full
|
|
||||||
# STORK_DATABASE_SSLMODE=
|
|
||||||
### the location of the SSL certificate used by the server to connect to the database
|
|
||||||
# STORK_DATABASE_SSLCERT=
|
|
||||||
### the location of the SSL key used by the server to connect to the database
|
|
||||||
# STORK_DATABASE_SSLKEY=
|
|
||||||
### the location of the root certificate file used to verify the database server's certificate
|
|
||||||
# STORK_DATABASE_SSLROOTCERT=
|
|
||||||
### the password for the username connecting to the database
|
|
||||||
### empty password is set to avoid prompting a user for database password
|
|
||||||
STORK_DATABASE_PASSWORD={{stork_db_passwd }}
|
|
||||||
|
|
||||||
### REST API settings
|
|
||||||
### the IP address on which the server listens
|
|
||||||
# STORK_REST_HOST=
|
|
||||||
### the port number on which the server listens
|
|
||||||
# STORK_REST_PORT=
|
|
||||||
### the file with a certificate to use for secure connections
|
|
||||||
# STORK_REST_TLS_CERTIFICATE=
|
|
||||||
### the file with a private key to use for secure connections
|
|
||||||
# STORK_REST_TLS_PRIVATE_KEY=
|
|
||||||
### the certificate authority file used for mutual TLS authentication
|
|
||||||
# STORK_REST_TLS_CA_CERTIFICATE=
|
|
||||||
### the directory with static files served in the UI
|
|
||||||
STORK_REST_STATIC_FILES_DIR=/usr/share/stork/www
|
|
||||||
### the base URL of the UI - to be used only if the UI is served from a subdirectory
|
|
||||||
# STORK_REST_BASE_URL=
|
|
||||||
|
|
||||||
### enable Prometheus /metrics HTTP endpoint for exporting metrics from
|
|
||||||
### the server to Prometheus. It is recommended to secure this endpoint
|
|
||||||
### (e.g. using HTTP proxy).
|
|
||||||
# STORK_SERVER_ENABLE_METRICS=true
|
|
||||||
|
|
||||||
### Logging parameters
|
|
||||||
|
|
||||||
### Set logging level. Supported values are: DEBUG, INFO, WARN, ERROR
|
|
||||||
# STORK_LOG_LEVEL=DEBUG
|
|
||||||
### disable output colorization
|
|
||||||
# CLICOLOR=false
|
|
||||||
|
|
||||||
### path to the hook directory
|
|
||||||
# STORK_SERVER_HOOK_DIRECTORY=
|
|
@ -1,31 +1,22 @@
|
|||||||
---
|
---
|
||||||
- name: Récupération de filebeat
|
- name: Récupération de filebeat
|
||||||
get_url:
|
get_url:
|
||||||
url: "http://s-adm.gsb.adm/gsbstore/filebeat-{{ BEATVER }}-amd64.deb"
|
url: http://s-adm.gsb.adm/gsbstore/filebeat-${BEATVAR}-amd64.deb
|
||||||
dest: /tmp/
|
dest: /tmp/
|
||||||
|
|
||||||
- name: Installation de filebeat
|
- name: Installation de filebeat
|
||||||
apt:
|
apt:
|
||||||
deb: "/tmp/filebeat-{{ BEATVER }}-amd64.deb"
|
deb: /tmp/filebeat-${BEATVEAR}-amd64.deb
|
||||||
|
|
||||||
- name: Chgt filebeat.yml - localhost:9200 - Elastic
|
- name: sorie pou debug
|
||||||
replace:
|
fail:
|
||||||
path: /etc/filebeat/filebeat.yml
|
msg: "packet installe"
|
||||||
regexp: 'localhost:9200'
|
|
||||||
replace: 's-elk.gsb.adm:9200'
|
|
||||||
backup: yes
|
|
||||||
|
|
||||||
- name: Chgt filebeat.yml - localhost:5601 - Kibana
|
|
||||||
replace:
|
|
||||||
path: /etc/filebeat/filebeat.yml
|
|
||||||
regexp: 'localhost:5601'
|
|
||||||
replace: 's-elk.gsb.adm:5601'
|
|
||||||
backup: yes
|
|
||||||
|
|
||||||
#- name: Changement du fichier de conf
|
- name: Changement du fichier de conf
|
||||||
# copy:
|
copy:
|
||||||
# src: filebeat.yml
|
src: filebeat.yml
|
||||||
# dest: /etc/filebeat/filebeat.yml
|
dest: /etc/filebeat/filebeat.yml
|
||||||
|
|
||||||
- name: Configuration de filebeat
|
- name: Configuration de filebeat
|
||||||
shell: filebeat modules enable system
|
shell: filebeat modules enable system
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
# Rôle Gotify
|
|
||||||
***
|
|
||||||
Rôle gotify pour la notification Zabbix et pas que
|
|
||||||
|
|
||||||
## Que fait le rôle gotify ?
|
|
||||||
|
|
||||||
Le rôle gotify va installer gotify en binaire, il s'agit d'une installation basic sans https.
|
|
||||||
***
|
|
||||||
## Identifiant
|
|
||||||
|
|
||||||
***
|
|
||||||
|
|
||||||
Admin
|
|
||||||
Admin
|
|
||||||
|
|
||||||
***
|
|
@ -16,5 +16,5 @@
|
|||||||
copy:
|
copy:
|
||||||
src: /root/id_rsa_sbackup
|
src: /root/id_rsa_sbackup
|
||||||
dest: /var/www/html/gsbstore
|
dest: /var/www/html/gsbstore
|
||||||
mode: 0644
|
mode: 0600
|
||||||
remote_src: yes
|
remote_src: yes
|
||||||
|
@ -1,9 +0,0 @@
|
|||||||
####récupération d'une clé publique####
|
|
||||||
|
|
||||||
Ce script permet de récupérer un clé publique créer depuis la machine s-adm:
|
|
||||||
1. Création du répertoire .ssh :
|
|
||||||
- Il crée le répertoire `~/.ssh` avec des permissions strictes (0700) pour l'utilisateur.
|
|
||||||
|
|
||||||
2. Récupération de la clé privée :
|
|
||||||
- Il télécharge une clé privée depuis l'URL spécifiée (`http://s-adm.gsb.adm/gsbstore/id_rsa_sbackup`) et la place dans le répertoire `~/.ssh` avec le nom `id_rsa_sbackup`.
|
|
||||||
- La clé privée est configurée avec des permissions strictes (0600) pour garantir la sécurité.
|
|
@ -1,9 +1,9 @@
|
|||||||
- name: Installation paquet zabbix agent
|
- name: Intallation paquet zabbix agent
|
||||||
get_url:
|
get_url:
|
||||||
url: "https://repo.zabbix.com/zabbix/6.4/debian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian12_all.deb"
|
url: "https://repo.zabbix.com/zabbix/6.4/debian/pool/main/z/zabbix-release/zabbix-release_6.4-1+debian12_all.deb"
|
||||||
dest: "/tmp"
|
dest: "/tmp"
|
||||||
|
|
||||||
- name: Installation paquet zabbix agent suite
|
- name: Intallation paquet zabbix agent suite
|
||||||
apt:
|
apt:
|
||||||
deb: "/tmp/zabbix-release_6.4-1+debian12_all.deb"
|
deb: "/tmp/zabbix-release_6.4-1+debian12_all.deb"
|
||||||
state: present
|
state: present
|
||||||
@ -12,7 +12,7 @@
|
|||||||
apt:
|
apt:
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
|
|
||||||
- name: Installation Zabbix agent
|
- name: Intallation Zabbix agent
|
||||||
apt:
|
apt:
|
||||||
name: zabbix-agent
|
name: zabbix-agent
|
||||||
state: present
|
state: present
|
||||||
@ -33,6 +33,6 @@
|
|||||||
src: hostcreate.sh.j2
|
src: hostcreate.sh.j2
|
||||||
dest: /tmp/hostcreate.sh
|
dest: /tmp/hostcreate.sh
|
||||||
|
|
||||||
- name: lancement script hostcreate
|
#- name: lancement script hostcreate
|
||||||
command: bash /tmp/hostcreate.sh
|
#command: bash /tmp/hostcreate.sh
|
||||||
|
|
||||||
|
@ -10,12 +10,6 @@ Rôle zabbix-srv pour la supervision des différentes machines
|
|||||||
|
|
||||||
Le rôle zabbix-srv va installer `apache2` pour le serveur web, `zabbix-server` pour la supervision et `zabbix-agent` pour gérer les clients, **Zabbix** qui sera notre outil de supervision.
|
Le rôle zabbix-srv va installer `apache2` pour le serveur web, `zabbix-server` pour la supervision et `zabbix-agent` pour gérer les clients, **Zabbix** qui sera notre outil de supervision.
|
||||||
|
|
||||||
La base de données est importée depuis une sauvegarde existante sur s-adm qui contient les clés API pour la notification gotify.
|
Lors de l'éxecution du playbook, les identifiants de la BDD sont crées avec le nom d'utilisateur "zabbix" et le mot de passe "password".
|
||||||
|
|
||||||
Lors de l'éxecution du playbook, les identifiants de la BDD sont crées avec le nom d'utilisateur "zabbix" et le mot de passe "password" pour se connecter a la BD importée.
|
|
||||||
|
|
||||||
Pour l'identifiant de Zabbix, c'est "Admin" et le mot de passe "zabbix", à l'adresse <http://s-mon/zabbix>.
|
Pour l'identifiant de Zabbix, c'est "Admin" et le mot de passe "zabbix", à l'adresse <http://s-mon/zabbix>.
|
||||||
|
|
||||||
## Notification Zabbix avec gotify
|
|
||||||
|
|
||||||
Ce rôle installe la base pour pouvoir faire des notification avec gotify, la base importée est pre-configurer pas besoin de rajouter le media gotify. Le serveur gotify est sur s-backup et est accessible via s-backup.gsb.adm:8008.
|
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
|
|
||||||
ALERTSENDTO=$1
|
|
||||||
ALERTSUBJECT=$2
|
|
||||||
ALERTMESSAGE=$3
|
|
||||||
|
|
||||||
curl -X POST "http://s-backup.gsb.adm:8008/message?token=$ALERTSENDTO" -F "title=$ALERTSUBJECT" -F "message=$ALERTMESSAGE" -F "priority=5" > /dev/null 2>&1
|
|
17
s-awx.yml
17
s-awx.yml
@ -1,17 +0,0 @@
|
|||||||
---
|
|
||||||
- hosts: localhost
|
|
||||||
connection: local
|
|
||||||
vars:
|
|
||||||
awx_host: "s-awx.gsb.lan"
|
|
||||||
awx_dir: "/root/tools/awx-on-k3s"
|
|
||||||
awx_ip: "192.168.0.2"
|
|
||||||
awx_if: "enp0s3"
|
|
||||||
|
|
||||||
roles:
|
|
||||||
- base
|
|
||||||
# - goss
|
|
||||||
#- ssh-cli
|
|
||||||
- awx
|
|
||||||
# - zabbix-cli
|
|
||||||
#- journald-snd
|
|
||||||
#- post
|
|
@ -4,12 +4,11 @@
|
|||||||
# include: config.yml
|
# include: config.yml
|
||||||
roles:
|
roles:
|
||||||
- base
|
- base
|
||||||
# - zabbix-cli
|
- zabbix-cli
|
||||||
- goss
|
- goss
|
||||||
- dns-master
|
- dns-master
|
||||||
- webautoconf
|
- webautoconf
|
||||||
- elk-filebeat-cli
|
- journald-snd
|
||||||
# - journald-snd
|
|
||||||
- ssh-cli
|
- ssh-cli
|
||||||
- post
|
- post
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ function create_vm{ param([string]$nomvm)
|
|||||||
} else {
|
} else {
|
||||||
#Importation depuis l'ova
|
#Importation depuis l'ova
|
||||||
& "$vboxmanage" import "$ovafile" --vsys 0 --vmname "$nomvm"
|
& "$vboxmanage" import "$ovafile" --vsys 0 --vmname "$nomvm"
|
||||||
Write-Host "Machine $nomvm importée"
|
Write-Host "Machine $nomvm importée"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user