From bd9059f3c50679c093f5c0ae21f5751da096e99a Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Thu, 26 Sep 2024 13:49:23 +0200 Subject: [PATCH] refs #8025 Production hosts updated, tags without brackets --- inventories/production | 139 ++++++++++++++++--------------- playbooks/clean.yml | 10 +-- roles/debian-base/tasks/main.yml | 12 ++- 3 files changed, 87 insertions(+), 74 deletions(-) diff --git a/inventories/production b/inventories/production index c150cfa..60314ed 100644 --- a/inventories/production +++ b/inventories/production @@ -40,74 +40,16 @@ kube-proxy2 ansible_host=kube-proxy2.servers.dc.verdnatura.es [kube_helper] kube-helm ansible_host=kube-helm.servers.dc.verdnatura.es -[kube:children] +[kubernetes: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 - -[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 -ns2 ansible_host=ns2.servers.dc.verdnatura.es -mailgw1 ansible_host=mailgw1.servers.dc.verdnatura.es -mailgw2 ansible_host=mailgw2.servers.dc.verdnatura.es -postfix ansible_host=postfix.servers.dc.verdnatura.es -time1 ansible_host=time1.servers.dc.verdnatura.es -time2 ansible_host=time2.servers.dc.verdnatura.es -pbx ansible_host=pbx.servers.dc.verdnatura.es -homes ansible_host=homes.servers.dc.verdnatura.es -server ansible_host=server.servers.dc.verdnatura.es -vpn ansible_host=vpn.servers.dc.verdnatura.es -cacti ansible_host=cacti.servers.dc.verdnatura.es -logger ansible_host=logger.servers.dc.verdnatura.es -nagios ansible_host=nagios.servers.dc.verdnatura.es -nagiosql-db ansible_host=nagiosql-db.servers.dc.verdnatura.es -doku ansible_host=doku.servers.dc.verdnatura.es -unifi ansible_host=unifi.servers.dc.verdnatura.es +[ad] dc1 ansible_host=dc1.servers.dc.verdnatura.es dc2 ansible_host=dc2.servers.dc.verdnatura.es -ldap-proxy1 ansible_host=ldap-proxy1.servers.dc.verdnatura.es -ldap-proxy2 ansible_host=ldap-proxy2.servers.dc.verdnatura.es -ldap1 ansible_host=ldap1.servers.dc.verdnatura.es -ldap2 ansible_host=ldap2.servers.dc.verdnatura.es -ldap3 ansible_host=ldap3.servers.dc.verdnatura.es -db1 ansible_host=db1.servers.dc.verdnatura.es -db2 ansible_host=db2.servers.dc.verdnatura.es -db-proxy1 ansible_host=db-proxy1.servers.dc.verdnatura.es -db-proxy2 ansible_host=db-proxy2.servers.dc.verdnatura.es -test-db1 ansible_host=test-db1.servers.dc.verdnatura.es -test-db-proxy1 ansible_host=test-db-proxy1.servers.dc.verdnatura.es -test-db-proxy2 ansible_host=test-db-proxy2.servers.dc.verdnatura.es -monthly-db ansible_host=monthly-db.servers.dc.verdnatura.es -dev-db ansible_host=dev-db.servers.dc.verdnatura.es -spamd-db ansible_host=spamd-db.servers.dc.verdnatura.es -spamd ansible_host=spamd.servers.dc.verdnatura.es -dovecot ansible_host=dovecot.servers.dc.verdnatura.es -debian12-vm ansible_host=debian12-vm.servers.dc.verdnatura.es -freeradiustotp ansible_host=freeradiustotp.servers.dc.verdnatura.es -iventoy ansible_host=iventoy.servers.dc.verdnatura.es - -[windows] -rsat ansible_host=rsat.servers.dc.verdnatura.es -printserver ansible_host=printserver.servers.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 +server ansible_host=server.servers.dc.verdnatura.es [backup] bacula-dir ansible_host=bacula-dir.backup.dc.verdnatura.es @@ -117,9 +59,76 @@ 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 +[core] +core-agent ansible_host=core-agent.core.dc.verdnatura.es +core-proxy ansible_host=core-proxy.core.dc.verdnatura.es + +[db] +db-proxy1 ansible_host=db-proxy1.servers.dc.verdnatura.es +db-proxy2 ansible_host=db-proxy2.servers.dc.verdnatura.es +db1 ansible_host=db1.servers.dc.verdnatura.es +db2 ansible_host=db2.servers.dc.verdnatura.es + +[ldap] +ldap-proxy1 ansible_host=ldap-proxy1.servers.dc.verdnatura.es +ldap-proxy2 ansible_host=ldap-proxy2.servers.dc.verdnatura.es +ldap1 ansible_host=ldap1.servers.dc.verdnatura.es +ldap2 ansible_host=ldap2.servers.dc.verdnatura.es +ldap3 ansible_host=ldap3.servers.dc.verdnatura.es + +[mail] +dovecot ansible_host=dovecot.servers.dc.verdnatura.es +mailgw1 ansible_host=mailgw1.servers.dc.verdnatura.es +mailgw2 ansible_host=mailgw2.servers.dc.verdnatura.es +postfix ansible_host=postfix.servers.dc.verdnatura.es +spamd ansible_host=spamd.servers.dc.verdnatura.es +spamd-db ansible_host=spamd-db.servers.dc.verdnatura.es + +[monitoring] +cacti ansible_host=cacti.servers.dc.verdnatura.es +logger ansible_host=logger.servers.dc.verdnatura.es +nagios ansible_host=nagios.servers.dc.verdnatura.es +nagiosql-db ansible_host=nagiosql-db.servers.dc.verdnatura.es +librenms ansible_host=librenms.servers.dc.verdnatura.es + +[network] +dhcp1 ansible_host=dhcp1.servers.dc.verdnatura.es +dhcp2 ansible_host=dhcp2.servers.dc.verdnatura.es +ns1 ansible_host=ns1.servers.dc.verdnatura.es +ns2 ansible_host=ns2.servers.dc.verdnatura.es +unifi ansible_host=unifi.servers.dc.verdnatura.es +vpn ansible_host=vpn.servers.dc.verdnatura.es +time1 ansible_host=time1.servers.dc.verdnatura.es +time2 ansible_host=time2.servers.dc.verdnatura.es + +[princ] +pbx ansible_host=pbx.servers.dc.verdnatura.es +homes ansible_host=homes.servers.dc.verdnatura.es +doku ansible_host=doku.servers.dc.verdnatura.es +iventoy ansible_host=iventoy.servers.dc.verdnatura.es + +[rds] +ts-proxy1 ansible_host=ts-proxy1.servers.dc.verdnatura.es +ts-proxy2 ansible_host=ts-proxy2.servers.dc.verdnatura.es +profiles ansible_host=profiles.servers.dc.verdnatura.es + +[test] +test-db1 ansible_host=test-db1.servers.dc.verdnatura.es +test-db-proxy1 ansible_host=test-db-proxy1.servers.dc.verdnatura.es +test-db-proxy2 ansible_host=test-db-proxy2.servers.dc.verdnatura.es +monthly-db ansible_host=monthly-db.servers.dc.verdnatura.es +dev-db ansible_host=dev-db.servers.dc.verdnatura.es + [guest:children] -core_helper -servers -windows -outsource +ad backup +core +db +kubernetes +ldap +mail +monitoring +network +princ +rds +test diff --git a/playbooks/clean.yml b/playbooks/clean.yml index f5c8d90..c19a4c5 100644 --- a/playbooks/clean.yml +++ b/playbooks/clean.yml @@ -7,17 +7,17 @@ name: awx-user state: absent remove: yes - tags: [awx] + tags: awx - name: Delete awx-user sudoers file file: path: /etc/sudoers.d/awx-user state: absent - tags: [awx] + tags: awx - name: Delete old MOTD configuration file: path: /etc/profile.d/mymotd.sh state: absent - tags: [motd] + tags: motd - name: Delete old Ansible bashrc configuration blockinfile: path: /root/.bashrc @@ -25,11 +25,11 @@ marker_end: 'END ANSIBLE MANAGED BLOCK' marker: "# {mark}" state: absent - tags: [bashrc] + tags: bashrc - name: Delete old custom bashrc configuration replace: path: /root/.bashrc - regexp: '{{ start_delimiter }}[\\s\\S]*?{{ end_delimiter }}' + regexp: '{{ start_delimiter }}\\s\\S*?{{ end_delimiter }}' replace: '' vars: start_delimiter: '### 4Loo' diff --git a/roles/debian-base/tasks/main.yml b/roles/debian-base/tasks/main.yml index 3933958..0e3ba90 100644 --- a/roles/debian-base/tasks/main.yml +++ b/roles/debian-base/tasks/main.yml @@ -1,12 +1,16 @@ - import_tasks: install.yml + tags: install - import_tasks: locale.yml + tags: locale - import_tasks: tzdata.yml + tags: tzdata - import_tasks: relayhost.yml + tags: relayhost - import_tasks: motd.yml - tags: [motd] + tags: motd - import_tasks: profile.yml - tags: [profile] + tags: profile - import_tasks: vim.yml - tags: [vim] + tags: vim - import_tasks: nrpe.yml - tags: [nrpe] + tags: nrpe