push swarm et MEP

This commit is contained in:
2024-07-14 16:11:48 +02:00
parent a26efe12e5
commit a5d394f7d1
14 changed files with 90 additions and 591 deletions

View File

@@ -1,4 +1,4 @@
- hosts: kubernetes
- hosts: docker_swarm_worker
# vars:
become: true
gather_facts: true
@@ -128,46 +128,35 @@
name: sshd.service
state: reloaded
# - name: Retrieve private IP address netbird
# ansible.builtin.gather_facts:
- name: Retrieve private IP address netbird
ansible.builtin.gather_facts:
# - name: Set host_interfaces list
# ansible.builtin.set_fact:
# host_interfaces: "{{ host_interfaces + [item]}}"
# vars:
# host_interfaces: []
# when: ansible_facts[item].ipv4.address is defined
# loop: "{{ ansible_facts.interfaces }}"
- name: Set host_interfaces list
ansible.builtin.set_fact:
host_interfaces: "{{ host_interfaces + [item]}}"
vars:
host_interfaces: []
when: ansible_facts[item].ipv4.address is defined
loop: "{{ ansible_facts.interfaces }}"
# - name: Set host_private_address
# ansible.builtin.set_fact:
# host_private_address: "{{ ansible_facts[item].ipv4.address }}"
# vars:
# host_private_address: ""
# when: ansible_facts[item].ipv4.address | ansible.utils.ipaddr('100.96.0.0/16')
# loop: "{{ host_interfaces }}"
- name: Set host_private_address
ansible.builtin.set_fact:
host_private_address: "{{ ansible_facts[item].ipv4.address }}"
vars:
host_private_address: ""
when: ansible_facts[item].ipv4.address | ansible.utils.ipaddr('100.96.0.0/16')
loop: "{{ host_interfaces }}"
# - name: Debug host_private_address for ALL hosts
# debug:
# msg: "{{ host_private_address }}"
- name: Debug host_private_address for ALL hosts
debug:
msg: "{{ host_private_address }}"
#! Set up docker socket for monitoring
# apiVersion: v1
# kind: PersistentVolumeClaim
# metadata:
# name: coroot-prometheus-server
# spec:
# storageClassName: manual
# accessModes:
# - ReadWriteOnce
# resources:
# requests:
# storage: 15Gi
# - ansible.builtin.import_role:
# name: prometheus.prometheus.node_exporter
- ansible.builtin.import_role:
name: prometheus.prometheus.node_exporter
# - ansible.builtin.import_role:
# name: prometheus.prometheus.prometheus