refs #8025 Hosts reorganized, clearer names for roles

This commit is contained in:
Juan Ferrer 2024-09-23 16:58:52 +02:00
parent 9b358d0262
commit c7299d8499
11 changed files with 60 additions and 68 deletions

102
hosts
View File

@ -1,36 +1,56 @@
[ceph]
ceph1 ansible_host=ceph1.core.dc.verdnatura.es
ceph2 ansible_host=ceph2.core.dc.verdnatura.es
ceph3 ansible_host=ceph3.core.dc.verdnatura.es
[cephGw]
[ceph_gw]
ceph-gw1 ansible_host=ceph-gw1.core.dc.verdnatura.es
ceph-gw2 ansible_host=ceph-gw2.core.dc.verdnatura.es
[pve]
pve01 ansible_host=pve01.core.dc.verdnatura.es
pve02 ansible_host=pve02.core.dc.verdnatura.es
pve03 ansible_host=pve03.core.dc.verdnatura.es
pve04 ansible_host=pve04.core.dc.verdnatura.es
pve05 ansible_host=pve04.core.dc.verdnatura.es
[coreHelper]
[infra:children]
ceph
ceph_gw
pve
[kube_master]
kube-master1 ansible_host=kube-master1.servers.dc.verdnatura.es
kube-master2 ansible_host=kube-master2.servers.dc.verdnatura.es
kube-master3 ansible_host=kube-master3.servers.dc.verdnatura.es
kube-master4 ansible_host=kube-master4.servers.dc.verdnatura.es
kube-master5 ansible_host=kube-master5.servers.dc.verdnatura.es
[kube_worker]
kube-worker1 ansible_host=kube-worker1.servers.dc.verdnatura.es
kube-worker2 ansible_host=kube-worker2.servers.dc.verdnatura.es
kube-worker3 ansible_host=kube-worker3.servers.dc.verdnatura.es
kube-worker4 ansible_host=kube-worker4.servers.dc.verdnatura.es
kube-worker5 ansible_host=kube-worker5.servers.dc.verdnatura.es
[kube_proxy]
kube-proxy1 ansible_host=kube-proxy1.servers.dc.verdnatura.es
kube-proxy2 ansible_host=kube-proxy2.servers.dc.verdnatura.es
[kube_helper]
kube-helm ansible_host=kube-helm.servers.dc.verdnatura.es
[kube:children]
kube_master
kube_worker
kube_proxy
kube_helper
[core_helper]
core-agent ansible_host=core-agent.core.dc.verdnatura.es
core-proxy ansible_host=core-proxy.core.dc.verdnatura.es
[core:children]
ceph
cephGw
pve
coreHelper
[servers]
dhcp1 ansible_host=dhcp1.servers.dc.verdnatura.es
dhcp2 ansible_host=dhcp2.servers.dc.verdnatura.es
ns1 ansible_host=ns1.servers.dc.verdnatura.es
@ -77,56 +97,32 @@ freeradiustotp ansible_host=freeradiustotp.servers.dc.verdnatura.es
iventoy ansible_host=iventoy.servers.dc.verdnatura.es
[windows]
a3 ansible_host=a3.outsource.dc.verdnatura.es
rsat ansible_host=rsat.servers.dc.verdnatura.es
contaplus ansible_host=contaplus.outsource.dc.verdnatura.es
dipole ansible_host=dipole.outsource.dc.verdnatura.es
printserver ansible_host=printserver.servers.dc.verdnatura.es
sage ansible_host=sage.outsource.dc.verdnatura.es
mrw ansible_host=mrw.servers.dc.verdnatura.es
ts1 ansible_host=ts1.rds.dc.verdnatura.es
ts2 ansible_host=ts2.rds.dc.verdnatura.es
rds-licenses ansible_host=rds-licenses.rds.dc.verdnatura.es
integra2 ansible_host=integra2.servers.dc.verdnatura.es
[outsource]
a3 ansible_host=a3.outsource.dc.verdnatura.es
contaplus ansible_host=contaplus.outsource.dc.verdnatura.es
dipole ansible_host=dipole.outsource.dc.verdnatura.es
sage ansible_host=sage.outsource.dc.verdnatura.es
docuware ansible_host=docuware.outsource.dc.verdnatura.es
[backup]
vm-backup ansible_host=vm-backup.backup.dc.verdnatura.es
backup-nas ansible_host=backup-nas.backup.dc.verdnatura.es
bacularis ansible_host=bacularis.backup.dc.verdnatura.es
bacula-dir ansible_host=bacula-dir.backup.dc.verdnatura.es
bacula-db ansible_host=bacula-db.backup.dc.verdnatura.es
bacularis ansible_host=bacularis.backup.dc.verdnatura.es
backup-nas ansible_host=backup-nas.backup.dc.verdnatura.es
tftp ansible_host=tftp.backup.dc.verdnatura.es
kube-backup ansible_host=kube-backup.backup.dc.verdnatura.es
[kubeMaster]
kube-master1 ansible_host=kube-master1.servers.dc.verdnatura.es
kube-master2 ansible_host=kube-master2.servers.dc.verdnatura.es
kube-master3 ansible_host=kube-master3.servers.dc.verdnatura.es
kube-master4 ansible_host=kube-master4.servers.dc.verdnatura.es
kube-master5 ansible_host=kube-master5.servers.dc.verdnatura.es
[kubeWorker]
kube-worker1 ansible_host=kube-worker1.servers.dc.verdnatura.es
kube-worker2 ansible_host=kube-worker2.servers.dc.verdnatura.es
kube-worker3 ansible_host=kube-worker3.servers.dc.verdnatura.es
kube-worker4 ansible_host=kube-worker4.servers.dc.verdnatura.es
kube-worker5 ansible_host=kube-worker5.servers.dc.verdnatura.es
[kubeProxy]
kube-proxy1 ansible_host=kube-proxy1.servers.dc.verdnatura.es
kube-proxy2 ansible_host=kube-proxy2.servers.dc.verdnatura.es
[kubeBackup]
kube-helm ansible_host=kube-helm.servers.dc.verdnatura.es
[kube:children]
kubeMaster
kubeWorker
kubeProxy
kubeBackup
[guest:children]
core_helper
servers
windows
outsource
backup

View File

@ -5,10 +5,12 @@
name: awx
- name: Configure base system
import_role:
name: linux-base
name: debian-base
- name: Configure guest
import_role:
name: linux-guest
name: debian-guest
when: ansible_virtualization_role == 'guest'
- name: Configure virtual machine
import_role:
name: linux-qemu
name: debian-qemu
when: ansible_virtualization_role == 'guest' and ansible_virtualization_type == 'kvm'

View File

@ -2,4 +2,4 @@
tasks:
- name: Test role
import_role:
name: linux-fail2ban
name: linux-base

View File

@ -1,5 +1,5 @@
- name: Ping Windows hosts
hosts: windows
hosts: all
tasks:
- name: Ping Windows hosts
ansible.windows.win_ping:

View File

@ -1,5 +1,4 @@
- hosts: windows
ignore_unreachable: yes
- hosts: all
serial: 1
tasks:
- block:

View File

@ -0,0 +1,3 @@
- include_role:
name: linux-auth
when: false

View File

@ -1,6 +1,3 @@
- name: Skip if not a QEMU guest
meta: end_host
when: not (ansible_virtualization_type == 'kvm' and ansible_virtualization_role == 'guest')
- name: Install QEMU guest agent
apt:
name: qemu-guest-agent

View File

@ -1,5 +0,0 @@
- name: Skip if not a guest
meta: end_host
when: ansible_virtualization_role != 'guest'
- include_role:
name: linux-auth