From ea6a8bed79fcc46ff427246f67026564ab536f4a Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 23 Sep 2024 14:30:38 +0200 Subject: [PATCH 01/20] refs #8025 Project structure & clean --- ansible.cfg | 10 ++ group_vars/all.yaml | 6 + group_vars/backup.yaml | 0 group_vars/core.yaml | 0 group_vars/devices.yaml | 0 group_vars/ilo.yaml | 0 group_vars/kubernetes.yaml | 0 group_vars/servers.yaml | 0 group_vars/swarm.yaml | 0 group_vars/test.yaml | 0 group_vars/vmware.yaml | 0 group_vars/windows.yaml | 0 host_vars/cephtest01.yaml | 133 -------------- host_vars/cephtest02.yaml | 133 -------------- host_vars/cephtest03.yaml | 133 -------------- host_vars/core-proxytest.yaml | 11 -- host_vars/debian-test-awx-ct.yaml | 11 -- host_vars/debian-test-awx-vm.yaml | 43 ----- host_vars/debian-vn-test.yaml | 133 -------------- host_vars/docker-test.yaml | 11 -- host_vars/ejemplo-hostvar.yaml | 133 -------------- host_vars/freeradius-playbook.yaml | 133 -------------- host_vars/freeradiustotp.yaml | 133 -------------- host_vars/homes.yaml | 11 -- host_vars/hot-plug-test.yaml | 11 -- host_vars/iventoy-test.yaml | 133 -------------- host_vars/iventoy.yaml | 133 -------------- host_vars/k3s128test.yaml | 13 -- host_vars/kube-master1.yaml | 133 -------------- host_vars/kube-master2.yaml | 133 -------------- host_vars/kube-master3.yaml | 133 -------------- host_vars/kube-worker1.yaml | 133 -------------- host_vars/kube-worker2.yaml | 133 -------------- host_vars/kube-worker3.yaml | 133 -------------- host_vars/kube-worker4.yaml | 133 -------------- host_vars/kubelab-proxy1.yaml | 133 -------------- host_vars/nagios4-test.yaml | 12 -- host_vars/nagiosql-db.yaml | 137 --------------- host_vars/openvpn-freeradius.yaml | 133 -------------- host_vars/pbx.yaml | 133 -------------- host_vars/test-playbook.yaml | 133 -------------- host_vars/time1.yaml | 133 -------------- host_vars/time2.yaml | 133 -------------- host_vars/vm-debian12.yaml | 133 -------------- host_vars/zabbix-frontend-web.yaml | 133 -------------- host_vars/zabbix-server-db.yaml | 133 -------------- hosts | 70 ++++---- hosts2 | 71 -------- linux-base-config-debian-ct.yaml | 162 ------------------ linux-base-config-debian-physical-server.yaml | 76 -------- linux-base-config-debian-vm.yaml | 156 ----------------- linux-base-config-debian.yaml | 72 -------- linux-config-autofs-homes.yaml | 18 -- linux-config-awx-user.yaml | 12 -- linux-config-base-debian-os.yaml | 20 --- linux-config-centralized-auth.yaml | 18 -- linux-config-fail2ban.yaml | 18 -- linux-config-freeradius-totp.yaml | 12 -- linux-config-hostname.yaml | 18 -- linux-config-hosts.yaml | 19 -- linux-config-hot-plug.yaml | 18 -- linux-config-install-packages.yaml | 18 -- linux-config-locales.yaml | 18 -- linux-config-motd.yaml | 18 -- linux-config-nagios-nrpe.yaml | 12 -- linux-config-nsupdate.yaml | 12 -- linux-config-ntp.yaml | 18 -- linux-config-relayhost-smtp.yaml | 18 -- linux-config-repo-vn.yaml | 18 -- linux-config-resolv.yaml | 18 -- linux-config-root-user.yaml | 18 -- linux-config-secure-grub.yaml | 18 -- linux-config-send-mail.yaml | 12 -- linux-config-server-type.yaml | 18 -- linux-config-sudoers.yaml | 18 -- linux-config-tzdata.yaml | 18 -- linux-config-update-and-upgrade-packages.yaml | 18 -- linux-config-vim-options.yaml | 18 -- linux-config-zabbix-agent.yaml | 18 -- linux-patch-exim4.yaml | 27 --- linux-ping.yml | 6 - playbooks/debian-base.yaml | 20 +++ playbooks/debian-ct.yaml | 27 +++ playbooks/debian-infra.yaml | 23 +++ playbooks/debian-upgrade.yaml | 5 + playbooks/debian-vm.yaml | 57 ++++++ playbooks/debian.yaml | 5 + playbooks/freeradius.yaml | 5 + playbooks/nsupdate.yaml | 5 + playbooks/ping.yml | 3 + playbooks/send-mail.yaml | 7 + playbooks/test.yaml | 5 + playbooks/windows-ping.yml | 5 + .../windows-update.yaml | 10 +- roles/awx/files/awx | 1 + roles/awx/tasks/main.yaml | 23 +++ roles/awx/vars/main.yaml | 1 + roles/config-autofs-homes/handlers/main.yaml | 13 -- roles/config-autofs-homes/tasks/main.yaml | 70 -------- roles/config-autofs-homes/vars/main.yaml | 7 - roles/config-awx-user/tasks/main.yaml | 46 ----- roles/config-awx-user/vars/main.yaml | 2 - .../handlers/main.yaml | 6 - roles/config-centralized-auth/tasks/main.yaml | 52 ------ roles/config-fail2ban/handlers/main.yaml | 10 -- roles/config-fail2ban/tasks/main.yaml | 49 ------ roles/config-fail2ban/templates/jail.j2 | 38 ---- roles/config-fail2ban/templates/jail2.j2 | 91 ---------- roles/config-fail2ban/vars/main.yaml | 5 - roles/config-hostname/tasks/main.yaml | 18 -- roles/config-hosts/tasks/main.yaml | 15 -- roles/config-hosts/vars/main.yaml | 3 - roles/config-hot-plug/tasks/main.yaml | 35 ---- roles/config-hot-plug/templates/grub.j2 | 1 - roles/config-hot-plug/templates/udev.j2 | 1 - roles/config-hot-plug/vars/main.yaml | 5 - roles/config-install-packages/tasks/main.yaml | 31 ---- roles/config-locales/files/set_locales.sh | 4 - roles/config-locales/tasks/main.yaml | 8 - roles/config-motd/files/mymotd.sh | 40 ----- roles/config-motd/tasks/main.yaml | 9 - roles/config-motd/vars/main.yaml | 2 - roles/config-nagios-nrpe/files/90-vn.cfg | 11 -- roles/config-nagios-nrpe/handlers/main.yaml | 5 - roles/config-nagios-nrpe/tasks/main.yaml | 45 ----- roles/config-nagios-nrpe/vars/main.yaml | 3 - roles/config-nsupdate/meta/main.yaml | 4 - roles/config-nsupdate/tasks/main.yaml | 19 -- roles/config-ntp/tasks/main.yaml | 53 ------ roles/config-ntp/vars/main.yaml | 4 - .../config-relayhost-smtp/handlers/main.yaml | 6 - roles/config-repo-vn/tasks/main.yaml | 45 ----- roles/config-resolv/tasks/main.yaml | 15 -- roles/config-resolv/templates/resolv.j2 | 7 - roles/config-resolv/vars/main.yaml | 3 - roles/config-root-user/handlers/main.yaml | 5 - roles/config-root-user/tasks/main.yaml | 103 ----------- roles/config-root-user/vars/main.yaml | 10 -- roles/config-secure-grub/handlers/main.yaml | 4 - roles/config-secure-grub/tasks/main.yaml | 18 -- roles/config-server-type/tasks/main.yaml | 26 --- roles/config-server-type/vars/main.yaml | 3 - roles/config-sudoers/tasks/main.yaml | 20 --- roles/config-tzdata/tasks/main.yaml | 21 --- .../tasks/main.yaml | 34 ---- roles/config-vim-options/tasks/main.yaml | 26 --- roles/config-vim-options/vars/main.yaml | 2 - .../zabbix-release_6.4-1+debian12_all.deb | Bin 3540 -> 0 bytes roles/config-zabbix-agent/handlers/main.yaml | 5 - roles/config-zabbix-agent/tasks/main.yaml | 59 ------- roles/config-zabbix-agent/vars/main.yaml | 5 - .../files/ldap | 0 .../handlers/main.yaml | 0 .../tasks/main.yaml | 0 .../templates/clients.j2 | 0 .../templates/default.j2 | 0 .../templates/dictionary.j2 | 0 .../templates/filter.j2 | 0 .../templates/freeradiusservice.j2 | 0 .../templates/radiusd.j2 | 0 .../templates/radiusdpam.j2 | 0 .../vars/main.yaml | 0 .../files/nslcd.conf | 0 roles/linux-auth/tasks/main.yaml | 39 +++++ .../vars/main.yaml | 1 - .../files/auto.homes | 0 .../files/homes.autofs | 0 roles/linux-autofs/handlers/main.yaml | 8 + roles/linux-autofs/tasks/main.yaml | 41 +++++ roles/linux-autofs/vars/main.yaml | 1 + roles/linux-bacula/files/bacula-fd.conf.jd2 | 24 +++ roles/linux-bacula/tasks/main.yaml | 20 +++ roles/linux-base/tasks/main.yaml | 10 ++ roles/linux-fail2ban/handlers/main.yaml | 4 + roles/linux-fail2ban/tasks/main.yaml | 15 ++ roles/linux-fail2ban/templates/jail.local.j2 | 20 +++ roles/linux-fail2ban/vars/main.yaml | 5 + roles/linux-hostname/tasks/main.yaml | 23 +++ .../templates/hosts.j2 | 2 +- roles/linux-hostname/templates/resolv.j2 | 7 + roles/linux-install-packages/tasks/main.yaml | 10 ++ roles/linux-locale/tasks/main.yaml | 15 ++ roles/{config-motd => linux-motd}/files/90-vn | 0 roles/linux-motd/tasks/main.yaml | 7 + roles/linux-nrpe/files/90-vn.cfg | 12 ++ roles/linux-nrpe/handlers/main.yaml | 4 + roles/linux-nrpe/tasks/main.yaml | 22 +++ .../{config-ntp => linux-ntp}/files/timesync | 3 - .../handlers/main.yaml | 1 - roles/linux-ntp/tasks/main.yaml | 24 +++ roles/linux-ntp/vars/main.yaml | 1 + roles/linux-profile/files/vn.sh | 39 +++++ roles/linux-profile/tasks/main.yaml | 7 + .../linux-qemu/files/80-hotplug-cpu-mem.rules | 1 + roles/linux-qemu/files/hotplug.cfg | 1 + roles/linux-qemu/tasks/main.yaml | 20 +++ .../defaults/main.yaml | 3 +- roles/linux-relayhost/handlers/main.yaml | 4 + .../tasks/main.yaml | 27 +-- .../vars/main.yaml | 1 - roles/linux-root/handlers/main.yaml | 4 + roles/linux-root/tasks/main.yaml | 26 +++ roles/linux-secure-grub/handlers/main.yaml | 2 + roles/linux-secure-grub/tasks/main.yaml | 9 + .../vars/main.yaml | 1 - roles/linux-sudoers/files/vn | 1 + roles/linux-sudoers/tasks/main.yaml | 7 + .../files/set_timezone.sh | 4 +- roles/linux-tzdata/tasks/main.yaml | 2 + roles/linux-upgrade/tasks/main.yaml | 20 +++ roles/linux-vim/files/vimrc.local | 5 + roles/linux-vim/tasks/main.yaml | 11 ++ roles/linux-vm/tasks/main.yaml | 10 ++ roles/linux-vn-repo/tasks/main.yaml | 12 ++ .../vars/main.yaml | 3 +- roles/nsupdate/meta/main.yaml | 2 + roles/nsupdate/tasks/main.yaml | 12 ++ .../vars/main.yaml | 2 - .../tasks/main.yaml | 5 - .../vars/main.yaml | 0 windows-install-package.yml | 14 -- windows-ping-test.yml | 6 - windows-restart_service.yml | 7 - 223 files changed, 771 insertions(+), 5840 deletions(-) create mode 100644 ansible.cfg create mode 100644 group_vars/all.yaml delete mode 100644 group_vars/backup.yaml delete mode 100644 group_vars/core.yaml delete mode 100644 group_vars/devices.yaml delete mode 100644 group_vars/ilo.yaml delete mode 100644 group_vars/kubernetes.yaml delete mode 100644 group_vars/servers.yaml delete mode 100644 group_vars/swarm.yaml delete mode 100644 group_vars/test.yaml delete mode 100644 group_vars/vmware.yaml delete mode 100644 group_vars/windows.yaml delete mode 100644 host_vars/cephtest01.yaml delete mode 100644 host_vars/cephtest02.yaml delete mode 100644 host_vars/cephtest03.yaml delete mode 100644 host_vars/core-proxytest.yaml delete mode 100644 host_vars/debian-test-awx-ct.yaml delete mode 100644 host_vars/debian-test-awx-vm.yaml delete mode 100644 host_vars/debian-vn-test.yaml delete mode 100644 host_vars/docker-test.yaml delete mode 100644 host_vars/ejemplo-hostvar.yaml delete mode 100644 host_vars/freeradius-playbook.yaml delete mode 100644 host_vars/freeradiustotp.yaml delete mode 100644 host_vars/homes.yaml delete mode 100644 host_vars/hot-plug-test.yaml delete mode 100644 host_vars/iventoy-test.yaml delete mode 100644 host_vars/iventoy.yaml delete mode 100644 host_vars/k3s128test.yaml delete mode 100644 host_vars/kube-master1.yaml delete mode 100644 host_vars/kube-master2.yaml delete mode 100644 host_vars/kube-master3.yaml delete mode 100644 host_vars/kube-worker1.yaml delete mode 100644 host_vars/kube-worker2.yaml delete mode 100644 host_vars/kube-worker3.yaml delete mode 100644 host_vars/kube-worker4.yaml delete mode 100644 host_vars/kubelab-proxy1.yaml delete mode 100644 host_vars/nagios4-test.yaml delete mode 100644 host_vars/nagiosql-db.yaml delete mode 100644 host_vars/openvpn-freeradius.yaml delete mode 100644 host_vars/pbx.yaml delete mode 100644 host_vars/test-playbook.yaml delete mode 100644 host_vars/time1.yaml delete mode 100644 host_vars/time2.yaml delete mode 100644 host_vars/vm-debian12.yaml delete mode 100644 host_vars/zabbix-frontend-web.yaml delete mode 100644 host_vars/zabbix-server-db.yaml delete mode 100644 hosts2 delete mode 100644 linux-base-config-debian-ct.yaml delete mode 100644 linux-base-config-debian-physical-server.yaml delete mode 100644 linux-base-config-debian-vm.yaml delete mode 100644 linux-base-config-debian.yaml delete mode 100644 linux-config-autofs-homes.yaml delete mode 100644 linux-config-awx-user.yaml delete mode 100644 linux-config-base-debian-os.yaml delete mode 100644 linux-config-centralized-auth.yaml delete mode 100644 linux-config-fail2ban.yaml delete mode 100644 linux-config-freeradius-totp.yaml delete mode 100644 linux-config-hostname.yaml delete mode 100644 linux-config-hosts.yaml delete mode 100644 linux-config-hot-plug.yaml delete mode 100644 linux-config-install-packages.yaml delete mode 100644 linux-config-locales.yaml delete mode 100644 linux-config-motd.yaml delete mode 100644 linux-config-nagios-nrpe.yaml delete mode 100644 linux-config-nsupdate.yaml delete mode 100644 linux-config-ntp.yaml delete mode 100644 linux-config-relayhost-smtp.yaml delete mode 100644 linux-config-repo-vn.yaml delete mode 100644 linux-config-resolv.yaml delete mode 100644 linux-config-root-user.yaml delete mode 100644 linux-config-secure-grub.yaml delete mode 100644 linux-config-send-mail.yaml delete mode 100644 linux-config-server-type.yaml delete mode 100644 linux-config-sudoers.yaml delete mode 100644 linux-config-tzdata.yaml delete mode 100644 linux-config-update-and-upgrade-packages.yaml delete mode 100644 linux-config-vim-options.yaml delete mode 100644 linux-config-zabbix-agent.yaml delete mode 100644 linux-patch-exim4.yaml delete mode 100644 linux-ping.yml create mode 100644 playbooks/debian-base.yaml create mode 100644 playbooks/debian-ct.yaml create mode 100644 playbooks/debian-infra.yaml create mode 100644 playbooks/debian-upgrade.yaml create mode 100644 playbooks/debian-vm.yaml create mode 100644 playbooks/debian.yaml create mode 100644 playbooks/freeradius.yaml create mode 100644 playbooks/nsupdate.yaml create mode 100644 playbooks/ping.yml create mode 100644 playbooks/send-mail.yaml create mode 100644 playbooks/test.yaml create mode 100644 playbooks/windows-ping.yml rename windows-update_windows.yaml => playbooks/windows-update.yaml (66%) create mode 100644 roles/awx/files/awx create mode 100644 roles/awx/tasks/main.yaml create mode 100644 roles/awx/vars/main.yaml delete mode 100644 roles/config-autofs-homes/handlers/main.yaml delete mode 100644 roles/config-autofs-homes/tasks/main.yaml delete mode 100644 roles/config-autofs-homes/vars/main.yaml delete mode 100644 roles/config-awx-user/tasks/main.yaml delete mode 100644 roles/config-awx-user/vars/main.yaml delete mode 100644 roles/config-centralized-auth/handlers/main.yaml delete mode 100644 roles/config-centralized-auth/tasks/main.yaml delete mode 100644 roles/config-fail2ban/handlers/main.yaml delete mode 100644 roles/config-fail2ban/tasks/main.yaml delete mode 100644 roles/config-fail2ban/templates/jail.j2 delete mode 100644 roles/config-fail2ban/templates/jail2.j2 delete mode 100644 roles/config-fail2ban/vars/main.yaml delete mode 100644 roles/config-hostname/tasks/main.yaml delete mode 100644 roles/config-hosts/tasks/main.yaml delete mode 100644 roles/config-hosts/vars/main.yaml delete mode 100644 roles/config-hot-plug/tasks/main.yaml delete mode 100644 roles/config-hot-plug/templates/grub.j2 delete mode 100644 roles/config-hot-plug/templates/udev.j2 delete mode 100644 roles/config-hot-plug/vars/main.yaml delete mode 100644 roles/config-install-packages/tasks/main.yaml delete mode 100644 roles/config-locales/files/set_locales.sh delete mode 100644 roles/config-locales/tasks/main.yaml delete mode 100644 roles/config-motd/files/mymotd.sh delete mode 100644 roles/config-motd/tasks/main.yaml delete mode 100644 roles/config-motd/vars/main.yaml delete mode 100644 roles/config-nagios-nrpe/files/90-vn.cfg delete mode 100644 roles/config-nagios-nrpe/handlers/main.yaml delete mode 100644 roles/config-nagios-nrpe/tasks/main.yaml delete mode 100644 roles/config-nagios-nrpe/vars/main.yaml delete mode 100644 roles/config-nsupdate/meta/main.yaml delete mode 100644 roles/config-nsupdate/tasks/main.yaml delete mode 100644 roles/config-ntp/tasks/main.yaml delete mode 100644 roles/config-ntp/vars/main.yaml delete mode 100644 roles/config-relayhost-smtp/handlers/main.yaml delete mode 100644 roles/config-repo-vn/tasks/main.yaml delete mode 100644 roles/config-resolv/tasks/main.yaml delete mode 100644 roles/config-resolv/templates/resolv.j2 delete mode 100644 roles/config-resolv/vars/main.yaml delete mode 100644 roles/config-root-user/handlers/main.yaml delete mode 100644 roles/config-root-user/tasks/main.yaml delete mode 100644 roles/config-root-user/vars/main.yaml delete mode 100644 roles/config-secure-grub/handlers/main.yaml delete mode 100644 roles/config-secure-grub/tasks/main.yaml delete mode 100644 roles/config-server-type/tasks/main.yaml delete mode 100644 roles/config-server-type/vars/main.yaml delete mode 100644 roles/config-sudoers/tasks/main.yaml delete mode 100644 roles/config-tzdata/tasks/main.yaml delete mode 100644 roles/config-update-and-upgrade-packages/tasks/main.yaml delete mode 100644 roles/config-vim-options/tasks/main.yaml delete mode 100644 roles/config-vim-options/vars/main.yaml delete mode 100644 roles/config-zabbix-agent/files/zabbix-release_6.4-1+debian12_all.deb delete mode 100644 roles/config-zabbix-agent/handlers/main.yaml delete mode 100644 roles/config-zabbix-agent/tasks/main.yaml delete mode 100644 roles/config-zabbix-agent/vars/main.yaml rename roles/{config-freeradius-totp => freeradius}/files/ldap (100%) rename roles/{config-freeradius-totp => freeradius}/handlers/main.yaml (100%) rename roles/{config-freeradius-totp => freeradius}/tasks/main.yaml (100%) rename roles/{config-freeradius-totp => freeradius}/templates/clients.j2 (100%) rename roles/{config-freeradius-totp => freeradius}/templates/default.j2 (100%) rename roles/{config-freeradius-totp => freeradius}/templates/dictionary.j2 (100%) rename roles/{config-freeradius-totp => freeradius}/templates/filter.j2 (100%) rename roles/{config-freeradius-totp => freeradius}/templates/freeradiusservice.j2 (100%) rename roles/{config-freeradius-totp => freeradius}/templates/radiusd.j2 (100%) rename roles/{config-freeradius-totp => freeradius}/templates/radiusdpam.j2 (100%) rename roles/{config-freeradius-totp => freeradius}/vars/main.yaml (100%) rename roles/{config-centralized-auth => linux-auth}/files/nslcd.conf (100%) create mode 100644 roles/linux-auth/tasks/main.yaml rename roles/{config-centralized-auth => linux-auth}/vars/main.yaml (96%) rename roles/{config-autofs-homes => linux-autofs}/files/auto.homes (100%) rename roles/{config-autofs-homes => linux-autofs}/files/homes.autofs (100%) create mode 100644 roles/linux-autofs/handlers/main.yaml create mode 100644 roles/linux-autofs/tasks/main.yaml create mode 100644 roles/linux-autofs/vars/main.yaml create mode 100644 roles/linux-bacula/files/bacula-fd.conf.jd2 create mode 100644 roles/linux-bacula/tasks/main.yaml create mode 100644 roles/linux-base/tasks/main.yaml create mode 100644 roles/linux-fail2ban/handlers/main.yaml create mode 100644 roles/linux-fail2ban/tasks/main.yaml create mode 100644 roles/linux-fail2ban/templates/jail.local.j2 create mode 100644 roles/linux-fail2ban/vars/main.yaml create mode 100644 roles/linux-hostname/tasks/main.yaml rename roles/{config-hosts => linux-hostname}/templates/hosts.j2 (63%) create mode 100644 roles/linux-hostname/templates/resolv.j2 create mode 100644 roles/linux-install-packages/tasks/main.yaml create mode 100644 roles/linux-locale/tasks/main.yaml rename roles/{config-motd => linux-motd}/files/90-vn (100%) create mode 100644 roles/linux-motd/tasks/main.yaml create mode 100644 roles/linux-nrpe/files/90-vn.cfg create mode 100644 roles/linux-nrpe/handlers/main.yaml create mode 100644 roles/linux-nrpe/tasks/main.yaml rename roles/{config-ntp => linux-ntp}/files/timesync (54%) rename roles/{config-ntp => linux-ntp}/handlers/main.yaml (55%) create mode 100644 roles/linux-ntp/tasks/main.yaml create mode 100644 roles/linux-ntp/vars/main.yaml create mode 100644 roles/linux-profile/files/vn.sh create mode 100644 roles/linux-profile/tasks/main.yaml create mode 100644 roles/linux-qemu/files/80-hotplug-cpu-mem.rules create mode 100644 roles/linux-qemu/files/hotplug.cfg create mode 100644 roles/linux-qemu/tasks/main.yaml rename roles/{config-relayhost-smtp => linux-relayhost}/defaults/main.yaml (91%) create mode 100644 roles/linux-relayhost/handlers/main.yaml rename roles/{config-relayhost-smtp => linux-relayhost}/tasks/main.yaml (65%) rename roles/{config-relayhost-smtp => linux-relayhost}/vars/main.yaml (95%) create mode 100644 roles/linux-root/handlers/main.yaml create mode 100644 roles/linux-root/tasks/main.yaml create mode 100644 roles/linux-secure-grub/handlers/main.yaml create mode 100644 roles/linux-secure-grub/tasks/main.yaml rename roles/{config-secure-grub => linux-secure-grub}/vars/main.yaml (98%) create mode 100644 roles/linux-sudoers/files/vn create mode 100644 roles/linux-sudoers/tasks/main.yaml rename roles/{config-tzdata => linux-tzdata}/files/set_timezone.sh (66%) create mode 100644 roles/linux-tzdata/tasks/main.yaml create mode 100644 roles/linux-upgrade/tasks/main.yaml create mode 100644 roles/linux-vim/files/vimrc.local create mode 100644 roles/linux-vim/tasks/main.yaml create mode 100644 roles/linux-vm/tasks/main.yaml create mode 100644 roles/linux-vn-repo/tasks/main.yaml rename roles/{config-repo-vn => linux-vn-repo}/vars/main.yaml (63%) create mode 100644 roles/nsupdate/meta/main.yaml create mode 100644 roles/nsupdate/tasks/main.yaml rename roles/{config-nsupdate => nsupdate}/vars/main.yaml (96%) rename roles/{config-send-mail => send-mail}/tasks/main.yaml (63%) rename roles/{config-send-mail => send-mail}/vars/main.yaml (100%) delete mode 100644 windows-install-package.yml delete mode 100644 windows-ping-test.yml delete mode 100644 windows-restart_service.yml diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..0752a5b --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,10 @@ +[defaults] +roles_path = ./roles +inventory = ./hosts +gathering = explicit +interpreter_python = auto_silent +remote_user = root +host_key_checking = False + +[privilege_escalation] +become = True diff --git a/group_vars/all.yaml b/group_vars/all.yaml new file mode 100644 index 0000000..0f02e94 --- /dev/null +++ b/group_vars/all.yaml @@ -0,0 +1,6 @@ +resolv: + domain: verdnatura.es + search: verdnatura.es +resolvers: + - '10.0.0.4' + - '10.0.0.5' diff --git a/group_vars/backup.yaml b/group_vars/backup.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/group_vars/core.yaml b/group_vars/core.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/group_vars/devices.yaml b/group_vars/devices.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/group_vars/ilo.yaml b/group_vars/ilo.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/group_vars/kubernetes.yaml b/group_vars/kubernetes.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/group_vars/servers.yaml b/group_vars/servers.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/group_vars/swarm.yaml b/group_vars/swarm.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/group_vars/test.yaml b/group_vars/test.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/group_vars/vmware.yaml b/group_vars/vmware.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/group_vars/windows.yaml b/group_vars/windows.yaml deleted file mode 100644 index e69de29..0000000 diff --git a/host_vars/cephtest01.yaml b/host_vars/cephtest01.yaml deleted file mode 100644 index deac740..0000000 --- a/host_vars/cephtest01.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -root_user_enabled: True -#root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -hostname_enabled: True -#hostname_enabled: False -hostname: 'cephtest01' -############################################################################# - -### HOSTS ################################################################### -hosts_enabled: True -#hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: cephtest01.lab.verdnatura.es cephtest01 -############################################################################# - -### RESOLV ################################################################## -resolv_enabled: True -#resolv_enabled: False -domain_name: lab.verdnatura.es -search_name: lab.verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -update_enabled: True -#update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -packages_enabled: True -#packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -relay_host_enabled: True -#relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -centralized_auth_enabled: True -#centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -sudoers_enabled: True -#sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -vim_options_enabled: True -#vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -motd_enabled: True -#motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -#hot_plug_enabled: True -hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -locales_enabled: True -#locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -tzdata_enabled: True -#tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -repo_vn_enabled: True -#repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -#fail2ban_enabled: True -fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -nagios_nrpe_enabled: True -#nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -#server_type_enabled: True -server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -ntp_enabled: True -#ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -autofs_homes_enabled: True -#autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -zabbix_agent_enabled: True -#zabbix_agent_enabled: False -############################################################################# \ No newline at end of file diff --git a/host_vars/cephtest02.yaml b/host_vars/cephtest02.yaml deleted file mode 100644 index 8c03601..0000000 --- a/host_vars/cephtest02.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -root_user_enabled: True -#root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -hostname_enabled: True -#hostname_enabled: False -hostname: 'cephtest02' -############################################################################# - -### HOSTS ################################################################### -hosts_enabled: True -#hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: cephtest02.lab.verdnatura.es cephtest02 -############################################################################# - -### RESOLV ################################################################## -resolv_enabled: True -#resolv_enabled: False -domain_name: lab.verdnatura.es -search_name: lab.verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -update_enabled: True -#update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -packages_enabled: True -#packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -relay_host_enabled: True -#relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -centralized_auth_enabled: True -#centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -sudoers_enabled: True -#sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -vim_options_enabled: True -#vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -motd_enabled: True -#motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -#hot_plug_enabled: True -hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -locales_enabled: True -#locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -tzdata_enabled: True -#tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -repo_vn_enabled: True -#repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -#fail2ban_enabled: True -fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -nagios_nrpe_enabled: True -#nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -#server_type_enabled: True -server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -ntp_enabled: True -#ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -autofs_homes_enabled: True -#autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -zabbix_agent_enabled: True -#zabbix_agent_enabled: False -############################################################################# \ No newline at end of file diff --git a/host_vars/cephtest03.yaml b/host_vars/cephtest03.yaml deleted file mode 100644 index 7412038..0000000 --- a/host_vars/cephtest03.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -root_user_enabled: True -#root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -hostname_enabled: True -#hostname_enabled: False -hostname: 'cephtest03' -############################################################################# - -### HOSTS ################################################################### -hosts_enabled: True -#hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: cephtest03.lab.verdnatura.es cephtest03 -############################################################################# - -### RESOLV ################################################################## -resolv_enabled: True -#resolv_enabled: False -domain_name: lab.verdnatura.es -search_name: lab.verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -update_enabled: True -#update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -packages_enabled: True -#packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -relay_host_enabled: True -#relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -centralized_auth_enabled: True -#centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -sudoers_enabled: True -#sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -vim_options_enabled: True -#vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -motd_enabled: True -#motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -#hot_plug_enabled: True -hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -locales_enabled: True -#locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -tzdata_enabled: True -#tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -repo_vn_enabled: True -#repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -#fail2ban_enabled: True -fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -nagios_nrpe_enabled: True -#nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -#server_type_enabled: True -server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -ntp_enabled: True -#ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -autofs_homes_enabled: True -#autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -zabbix_agent_enabled: True -#zabbix_agent_enabled: False -############################################################################# \ No newline at end of file diff --git a/host_vars/core-proxytest.yaml b/host_vars/core-proxytest.yaml deleted file mode 100644 index 66242fd..0000000 --- a/host_vars/core-proxytest.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -bantime: "604800" -maxretry: "4" -findtime: "604800" -jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" \ No newline at end of file diff --git a/host_vars/debian-test-awx-ct.yaml b/host_vars/debian-test-awx-ct.yaml deleted file mode 100644 index 22c1e74..0000000 --- a/host_vars/debian-test-awx-ct.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -bantime: "604800" -maxretry: "4" -findtime: "604800" -jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" diff --git a/host_vars/debian-test-awx-vm.yaml b/host_vars/debian-test-awx-vm.yaml deleted file mode 100644 index 82f4a60..0000000 --- a/host_vars/debian-test-awx-vm.yaml +++ /dev/null @@ -1,43 +0,0 @@ ---- -bantime: "604800" -maxretry: "4" -findtime: "604800" -jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# EXAMPLE -# bantime: "604800" -# maxretry: "4" -# findtime: "604800" -# jails: -#- name: NAME-FILTER(list -> /etc/fail2ban/filter.d/somefilenamefilter) - (first JAIL SSH) -# enabled: true -# filter: somefilenamefilter -# logpath: /var/log/logofserviceauths -# port: ['nameofservice', 'PORTNUMBEROFSERVICE'] -# maxretry: 4 # max retry to auth -# bantime: 604800 # 1week bantime in seconds -# findtime: 604800 # 1week time finding source-host auth -# action: "%(action_mwl)s" -#- name: NAME-FILTER(list -> /etc/fail2ban/filter.d/somefilenamefilter) - (second JAIL otherService) -# enabled: true -# filter: somefilenamefilter -# logpath: /var/log/logofserviceauths -# port: ['nameofservice', 'PORTNUMBEROFSERVICE'] -# maxretry: 4 # max retry to auth -# bantime: 604800 # 1week bantime in seconds -# findtime: 604800 # 1week time finding source-host auth -# banaction: NAME-ACTION(list -> /etc/fail2ban/action.d/somefilenameaction) -# action: "%(action_mwl)s" -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# 31536000 ; year -# 18144000 ; 30days -# 604800 ; 1 week -# 86400 ; 1 day -# 3600 ; 1 hour -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \ No newline at end of file diff --git a/host_vars/debian-vn-test.yaml b/host_vars/debian-vn-test.yaml deleted file mode 100644 index 3ae0933..0000000 --- a/host_vars/debian-vn-test.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -root_user_enabled: True -#root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -hostname_enabled: True -#hostname_enabled: False -hostname: 'vn-debian-test' -############################################################################# - -### HOSTS ################################################################### -hosts_enabled: True -#hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: vn-debian-test.lab.verdnatura.es vn-debian-test -############################################################################# - -### RESOLV ################################################################## -resolv_enabled: True -#resolv_enabled: False -domain_name: lab.verdnatura.es -search_name: lab.verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -update_enabled: True -#update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -packages_enabled: True -#packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -relay_host_enabled: True -#relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -centralized_auth_enabled: True -#centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -sudoers_enabled: True -#sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -vim_options_enabled: True -#vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -motd_enabled: True -#motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -hot_plug_enabled: True -#hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -locales_enabled: True -#locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -tzdata_enabled: True -#tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -repo_vn_enabled: True -#repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -#fail2ban_enabled: True -fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -nagios_nrpe_enabled: True -#nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -server_type_enabled: True -#server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -ntp_enabled: True -#ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -autofs_homes_enabled: True -#autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -zabbix_agent_enabled: True -#zabbix_agent_enabled: False -############################################################################# diff --git a/host_vars/docker-test.yaml b/host_vars/docker-test.yaml deleted file mode 100644 index 66242fd..0000000 --- a/host_vars/docker-test.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -bantime: "604800" -maxretry: "4" -findtime: "604800" -jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" \ No newline at end of file diff --git a/host_vars/ejemplo-hostvar.yaml b/host_vars/ejemplo-hostvar.yaml deleted file mode 100644 index 1443a2c..0000000 --- a/host_vars/ejemplo-hostvar.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -#root_user_enabled: True -root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -#hostname_enabled: True -hostname_enabled: False -hostname: 'ejemplo' -############################################################################# - -### HOSTS ################################################################### -#hosts_enabled: True -hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: test-playbook.lab.dc.verdnatura.es test-playbook -############################################################################# - -### RESOLV ################################################################## -#resolv_enabled: True -resolv_enabled: False -domain_name: lab.dc.verdnatura.es -search_name: lab.dc.verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -#update_enabled: True -update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -#packages_enabled: True -packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -#relay_host_enabled: True -relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -#centralized_auth_enabled: True -centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -#sudoers_enabled: True -sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -#vim_options_enabled: True -vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -#motd_enabled: True -motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -#hot_plug_enabled: True -hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -#locales_enabled: True -locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -#tzdata_enabled: True -tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -#repo_vn_enabled: True -repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -#fail2ban_enabled: True -fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -#nagios_nrpe_enabled: True -nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -#server_type_enabled: True -server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -#ntp_enabled: True -ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -#autofs_homes_enabled: True -autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -#zabbix_agent_enabled: True -zabbix_agent_enabled: False -############################################################################# \ No newline at end of file diff --git a/host_vars/freeradius-playbook.yaml b/host_vars/freeradius-playbook.yaml deleted file mode 100644 index 600972b..0000000 --- a/host_vars/freeradius-playbook.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -root_user_enabled: True -#root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -hostname_enabled: True -#hostname_enabled: False -hostname: 'freeradius-playbook' -############################################################################# - -### HOSTS ################################################################### -hosts_enabled: True -#hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: freeradius-playbook.lab.verdnatura.es freeradius-playbook -############################################################################# - -### RESOLV ################################################################## -resolv_enabled: True -#resolv_enabled: False -domain_name: lab.verdnatura.es -search_name: lab.verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -update_enabled: True -#update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -packages_enabled: True -#packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -relay_host_enabled: True -#relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -centralized_auth_enabled: True -#centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -sudoers_enabled: True -#sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -vim_options_enabled: True -#vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -motd_enabled: True -#motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -hot_plug_enabled: True -#hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -locales_enabled: True -#locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -tzdata_enabled: True -#tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -repo_vn_enabled: True -#repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -#fail2ban_enabled: True -fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -nagios_nrpe_enabled: True -#nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -server_type_enabled: True -#server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -ntp_enabled: True -#ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -autofs_homes_enabled: True -#autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -zabbix_agent_enabled: True -#zabbix_agent_enabled: False -############################################################################# \ No newline at end of file diff --git a/host_vars/freeradiustotp.yaml b/host_vars/freeradiustotp.yaml deleted file mode 100644 index 355730f..0000000 --- a/host_vars/freeradiustotp.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -root_user_enabled: True -#root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -hostname_enabled: True -#hostname_enabled: False -hostname: 'freeradiustotp' -############################################################################# - -### HOSTS ################################################################### -hosts_enabled: True -#hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: freeradiustotp.servers.dc.verdnatura.es freeradiustotp -############################################################################# - -### RESOLV ################################################################## -resolv_enabled: True -#resolv_enabled: False -domain_name: verdnatura.es -search_name: verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -update_enabled: True -#update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -packages_enabled: True -#packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -relay_host_enabled: True -#relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -#centralized_auth_enabled: True -centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -sudoers_enabled: True -#sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -vim_options_enabled: True -#vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -motd_enabled: True -#motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -hot_plug_enabled: True -#hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -locales_enabled: True -#locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -tzdata_enabled: True -#tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -repo_vn_enabled: True -#repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -fail2ban_enabled: True -#fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -nagios_nrpe_enabled: True -#nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -server_type_enabled: True -#server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -ntp_enabled: True -#ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -#autofs_homes_enabled: True -autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -zabbix_agent_enabled: True -#zabbix_agent_enabled: False -############################################################################# \ No newline at end of file diff --git a/host_vars/homes.yaml b/host_vars/homes.yaml deleted file mode 100644 index 66242fd..0000000 --- a/host_vars/homes.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -bantime: "604800" -maxretry: "4" -findtime: "604800" -jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" \ No newline at end of file diff --git a/host_vars/hot-plug-test.yaml b/host_vars/hot-plug-test.yaml deleted file mode 100644 index 66242fd..0000000 --- a/host_vars/hot-plug-test.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -bantime: "604800" -maxretry: "4" -findtime: "604800" -jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" \ No newline at end of file diff --git a/host_vars/iventoy-test.yaml b/host_vars/iventoy-test.yaml deleted file mode 100644 index 89da23c..0000000 --- a/host_vars/iventoy-test.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -root_user_enabled: True -#root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -hostname_enabled: True -#hostname_enabled: False -hostname: 'iventoy-test' -############################################################################# - -### HOSTS ################################################################### -hosts_enabled: True -#hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: iventoy-test.lab.verdnatura.es iventoy-test -############################################################################# - -### RESOLV ################################################################## -resolv_enabled: True -#resolv_enabled: False -domain_name: lab.verdnatura.es -search_name: lab.verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -update_enabled: True -#update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -packages_enabled: True -#packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -relay_host_enabled: True -#relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -centralized_auth_enabled: True -#centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -sudoers_enabled: True -#sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -vim_options_enabled: True -#vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -motd_enabled: True -#motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -hot_plug_enabled: True -#hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -locales_enabled: True -#locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -tzdata_enabled: True -#tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -repo_vn_enabled: True -#repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -#fail2ban_enabled: True -fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -nagios_nrpe_enabled: True -#nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -server_type_enabled: True -#server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -ntp_enabled: True -#ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -autofs_homes_enabled: True -#autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -zabbix_agent_enabled: True -#zabbix_agent_enabled: False -############################################################################# \ No newline at end of file diff --git a/host_vars/iventoy.yaml b/host_vars/iventoy.yaml deleted file mode 100644 index 5d76fbc..0000000 --- a/host_vars/iventoy.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -root_user_enabled: True -#root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -hostname_enabled: True -#hostname_enabled: False -hostname: 'iventoy' -############################################################################# - -### HOSTS ################################################################### -hosts_enabled: True -#hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: iventoy.servers.dc.verdnatura.es iventoy -############################################################################# - -### RESOLV ################################################################## -resolv_enabled: True -#resolv_enabled: False -domain_name: dc.verdnatura.es -search_name: dc.verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -update_enabled: True -#update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -packages_enabled: True -#packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -relay_host_enabled: True -#relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -centralized_auth_enabled: True -#centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -sudoers_enabled: True -#sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -vim_options_enabled: True -#vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -motd_enabled: True -#motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -hot_plug_enabled: True -#hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -locales_enabled: True -#locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -tzdata_enabled: True -#tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -repo_vn_enabled: True -#repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -#fail2ban_enabled: True -fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -nagios_nrpe_enabled: True -#nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -server_type_enabled: True -#server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -ntp_enabled: True -#ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -autofs_homes_enabled: True -#autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -#zabbix_agent_enabled: True -zabbix_agent_enabled: False -############################################################################# diff --git a/host_vars/k3s128test.yaml b/host_vars/k3s128test.yaml deleted file mode 100644 index cf2be49..0000000 --- a/host_vars/k3s128test.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- -bantime: "10m" -maxretry: "10" -findtime: "10m" -jails: -- name: sshd - enabled: true - filter: sshd - logpath: /var/log/auth.log - port: ['ssh', '22'] - maxretry: 10 - bantime: 10m - findtime: 10m \ No newline at end of file diff --git a/host_vars/kube-master1.yaml b/host_vars/kube-master1.yaml deleted file mode 100644 index d84b560..0000000 --- a/host_vars/kube-master1.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -#root_user_enabled: True -root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -#hostname_enabled: True -hostname_enabled: False -hostname: 'kube-master1' -############################################################################# - -### HOSTS ################################################################### -#hosts_enabled: True -hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: test-playbook.lab.dc.verdnatura.es test-playbook -############################################################################# - -### RESOLV ################################################################## -#resolv_enabled: True -resolv_enabled: False -domain_name: lab.dc.verdnatura.es -search_name: lab.dc.verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -#update_enabled: True -update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -#packages_enabled: True -packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -#relay_host_enabled: True -relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -#centralized_auth_enabled: True -centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -#sudoers_enabled: True -sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -#vim_options_enabled: True -vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -#motd_enabled: True -motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -#hot_plug_enabled: True -hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -#locales_enabled: True -locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -#tzdata_enabled: True -tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -#repo_vn_enabled: True -repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -#fail2ban_enabled: True -fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -#nagios_nrpe_enabled: True -nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -#server_type_enabled: True -server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -#ntp_enabled: True -ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -autofs_homes_enabled: True -#autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -#zabbix_agent_enabled: True -zabbix_agent_enabled: False -############################################################################# \ No newline at end of file diff --git a/host_vars/kube-master2.yaml b/host_vars/kube-master2.yaml deleted file mode 100644 index b8e2aa3..0000000 --- a/host_vars/kube-master2.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -#root_user_enabled: True -root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -#hostname_enabled: True -hostname_enabled: False -hostname: 'kube-master2' -############################################################################# - -### HOSTS ################################################################### -#hosts_enabled: True -hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: test-playbook.lab.dc.verdnatura.es test-playbook -############################################################################# - -### RESOLV ################################################################## -#resolv_enabled: True -resolv_enabled: False -domain_name: lab.dc.verdnatura.es -search_name: lab.dc.verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -#update_enabled: True -update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -#packages_enabled: True -packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -#relay_host_enabled: True -relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -#centralized_auth_enabled: True -centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -#sudoers_enabled: True -sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -#vim_options_enabled: True -vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -#motd_enabled: True -motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -#hot_plug_enabled: True -hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -#locales_enabled: True -locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -#tzdata_enabled: True -tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -#repo_vn_enabled: True -repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -#fail2ban_enabled: True -fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -#nagios_nrpe_enabled: True -nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -#server_type_enabled: True -server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -#ntp_enabled: True -ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -autofs_homes_enabled: True -#autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -#zabbix_agent_enabled: True -zabbix_agent_enabled: False -############################################################################# \ No newline at end of file diff --git a/host_vars/kube-master3.yaml b/host_vars/kube-master3.yaml deleted file mode 100644 index 575621b..0000000 --- a/host_vars/kube-master3.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -#root_user_enabled: True -root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -#hostname_enabled: True -hostname_enabled: False -hostname: 'kube-master3' -############################################################################# - -### HOSTS ################################################################### -#hosts_enabled: True -hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: test-playbook.lab.dc.verdnatura.es test-playbook -############################################################################# - -### RESOLV ################################################################## -#resolv_enabled: True -resolv_enabled: False -domain_name: lab.dc.verdnatura.es -search_name: lab.dc.verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -#update_enabled: True -update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -#packages_enabled: True -packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -#relay_host_enabled: True -relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -#centralized_auth_enabled: True -centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -#sudoers_enabled: True -sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -#vim_options_enabled: True -vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -#motd_enabled: True -motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -#hot_plug_enabled: True -hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -#locales_enabled: True -locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -#tzdata_enabled: True -tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -#repo_vn_enabled: True -repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -#fail2ban_enabled: True -fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -#nagios_nrpe_enabled: True -nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -#server_type_enabled: True -server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -#ntp_enabled: True -ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -autofs_homes_enabled: True -#autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -#zabbix_agent_enabled: True -zabbix_agent_enabled: False -############################################################################# \ No newline at end of file diff --git a/host_vars/kube-worker1.yaml b/host_vars/kube-worker1.yaml deleted file mode 100644 index 0a9e451..0000000 --- a/host_vars/kube-worker1.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -#root_user_enabled: True -root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -#hostname_enabled: True -hostname_enabled: False -hostname: 'kube-worker1' -############################################################################# - -### HOSTS ################################################################### -#hosts_enabled: True -hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: test-playbook.lab.dc.verdnatura.es test-playbook -############################################################################# - -### RESOLV ################################################################## -#resolv_enabled: True -resolv_enabled: False -domain_name: lab.dc.verdnatura.es -search_name: lab.dc.verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -#update_enabled: True -update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -#packages_enabled: True -packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -#relay_host_enabled: True -relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -#centralized_auth_enabled: True -centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -#sudoers_enabled: True -sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -#vim_options_enabled: True -vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -#motd_enabled: True -motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -#hot_plug_enabled: True -hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -#locales_enabled: True -locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -#tzdata_enabled: True -tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -#repo_vn_enabled: True -repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -#fail2ban_enabled: True -fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -#nagios_nrpe_enabled: True -nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -#server_type_enabled: True -server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -#ntp_enabled: True -ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -autofs_homes_enabled: True -#autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -#zabbix_agent_enabled: True -zabbix_agent_enabled: False -############################################################################# \ No newline at end of file diff --git a/host_vars/kube-worker2.yaml b/host_vars/kube-worker2.yaml deleted file mode 100644 index cab639f..0000000 --- a/host_vars/kube-worker2.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -#root_user_enabled: True -root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -#hostname_enabled: True -hostname_enabled: False -hostname: 'kube-worker2' -############################################################################# - -### HOSTS ################################################################### -#hosts_enabled: True -hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: test-playbook.lab.dc.verdnatura.es test-playbook -############################################################################# - -### RESOLV ################################################################## -#resolv_enabled: True -resolv_enabled: False -domain_name: lab.dc.verdnatura.es -search_name: lab.dc.verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -#update_enabled: True -update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -#packages_enabled: True -packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -#relay_host_enabled: True -relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -#centralized_auth_enabled: True -centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -#sudoers_enabled: True -sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -#vim_options_enabled: True -vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -#motd_enabled: True -motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -#hot_plug_enabled: True -hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -#locales_enabled: True -locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -#tzdata_enabled: True -tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -#repo_vn_enabled: True -repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -#fail2ban_enabled: True -fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -#nagios_nrpe_enabled: True -nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -#server_type_enabled: True -server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -#ntp_enabled: True -ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -autofs_homes_enabled: True -#autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -#zabbix_agent_enabled: True -zabbix_agent_enabled: False -############################################################################# \ No newline at end of file diff --git a/host_vars/kube-worker3.yaml b/host_vars/kube-worker3.yaml deleted file mode 100644 index a7fe955..0000000 --- a/host_vars/kube-worker3.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -#root_user_enabled: True -root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -#hostname_enabled: True -hostname_enabled: False -hostname: 'kube-worker3' -############################################################################# - -### HOSTS ################################################################### -#hosts_enabled: True -hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: test-playbook.lab.dc.verdnatura.es test-playbook -############################################################################# - -### RESOLV ################################################################## -#resolv_enabled: True -resolv_enabled: False -domain_name: lab.dc.verdnatura.es -search_name: lab.dc.verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -#update_enabled: True -update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -#packages_enabled: True -packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -#relay_host_enabled: True -relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -#centralized_auth_enabled: True -centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -#sudoers_enabled: True -sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -#vim_options_enabled: True -vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -#motd_enabled: True -motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -#hot_plug_enabled: True -hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -#locales_enabled: True -locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -#tzdata_enabled: True -tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -#repo_vn_enabled: True -repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -#fail2ban_enabled: True -fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -#nagios_nrpe_enabled: True -nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -#server_type_enabled: True -server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -#ntp_enabled: True -ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -autofs_homes_enabled: True -#autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -#zabbix_agent_enabled: True -zabbix_agent_enabled: False -############################################################################# \ No newline at end of file diff --git a/host_vars/kube-worker4.yaml b/host_vars/kube-worker4.yaml deleted file mode 100644 index 4bd1b5a..0000000 --- a/host_vars/kube-worker4.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -#root_user_enabled: True -root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -#hostname_enabled: True -hostname_enabled: False -hostname: 'kube-worker4' -############################################################################# - -### HOSTS ################################################################### -#hosts_enabled: True -hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: test-playbook.lab.dc.verdnatura.es test-playbook -############################################################################# - -### RESOLV ################################################################## -#resolv_enabled: True -resolv_enabled: False -domain_name: lab.dc.verdnatura.es -search_name: lab.dc.verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -#update_enabled: True -update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -#packages_enabled: True -packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -#relay_host_enabled: True -relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -#centralized_auth_enabled: True -centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -#sudoers_enabled: True -sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -#vim_options_enabled: True -vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -#motd_enabled: True -motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -#hot_plug_enabled: True -hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -#locales_enabled: True -locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -#tzdata_enabled: True -tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -#repo_vn_enabled: True -repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -#fail2ban_enabled: True -fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -#nagios_nrpe_enabled: True -nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -#server_type_enabled: True -server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -#ntp_enabled: True -ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -autofs_homes_enabled: True -#autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -#zabbix_agent_enabled: True -zabbix_agent_enabled: False -############################################################################# \ No newline at end of file diff --git a/host_vars/kubelab-proxy1.yaml b/host_vars/kubelab-proxy1.yaml deleted file mode 100644 index 601577a..0000000 --- a/host_vars/kubelab-proxy1.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -root_user_enabled: True -#root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -hostname_enabled: True -#hostname_enabled: False -hostname: 'kubelab-proxy1' -############################################################################# - -### HOSTS ################################################################### -hosts_enabled: True -#hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: kubelab-proxy1.lab.verdnatura.es kubelab-proxy1 -############################################################################# - -### RESOLV ################################################################## -resolv_enabled: True -#resolv_enabled: False -domain_name: lab.verdnatura.es -search_name: lab.verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -update_enabled: True -#update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -packages_enabled: True -#packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -relay_host_enabled: True -#relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -centralized_auth_enabled: True -#centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -sudoers_enabled: True -#sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -vim_options_enabled: True -#vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -motd_enabled: True -#motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -hot_plug_enabled: True -#hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -locales_enabled: True -#locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -tzdata_enabled: True -#tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -repo_vn_enabled: True -#repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -#fail2ban_enabled: True -fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -nagios_nrpe_enabled: True -#nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -server_type_enabled: True -#server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -ntp_enabled: True -#ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -autofs_homes_enabled: True -#autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -#zabbix_agent_enabled: True -zabbix_agent_enabled: False -############################################################################# diff --git a/host_vars/nagios4-test.yaml b/host_vars/nagios4-test.yaml deleted file mode 100644 index 7fd6954..0000000 --- a/host_vars/nagios4-test.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -fail2ban_times: - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" \ No newline at end of file diff --git a/host_vars/nagiosql-db.yaml b/host_vars/nagiosql-db.yaml deleted file mode 100644 index b2bbc6e..0000000 --- a/host_vars/nagiosql-db.yaml +++ /dev/null @@ -1,137 +0,0 @@ ---- - -### ROOT-USER ############################################################### -root_user_enabled: True -#root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -hostname_enabled: True -#hostname_enabled: False -hostname: 'nagiosql-db' -############################################################################# - -### HOSTS ################################################################### -hosts_enabled: True -#hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: nagiosql-db.verdnatura.es nagiosql-db -############################################################################# - -### RESOLV ################################################################## -resolv_enabled: True -#resolv_enabled: False -domain_name: lab.dc.verdnatura.es -search_name: lab.dc.verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -update_enabled: True -#update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -packages_enabled: True -#packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -relay_host_enabled: True -#relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -centralized_auth_enabled: True -#centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -sudoers_enabled: True -#sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -# ES UN CT , NO ES NECESARIO -#secure-grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -vim_options_enabled: True -#vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -motd_enabled: True -#motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -# ES UN CT , NO ES NECESARIO -#hot-plug_enabled: True -hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -locales_enabled: True -#locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -tzdata_enabled: True -#tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -repo_vn_enabled: True -#repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -fail2ban_enabled: True -#fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -nagios_nrpe_enabled: True -#nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -# ES UN CT , NO ES NECESARIO -#server_type_enabled: True -server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -#ntp_enabled: True -ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -# NO ESTA TESTEADO -autofs_homes_enabled: True -#autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -zabbix_agent_enabled: True -#zabbix_agent_enabled: False -############################################################################# \ No newline at end of file diff --git a/host_vars/openvpn-freeradius.yaml b/host_vars/openvpn-freeradius.yaml deleted file mode 100644 index 5c04863..0000000 --- a/host_vars/openvpn-freeradius.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -root_user_enabled: True -#root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -hostname_enabled: True -#hostname_enabled: False -hostname: 'openvpn-freeradius' -############################################################################# - -### HOSTS ################################################################### -hosts_enabled: True -#hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: openvpn-freeradius.lab.verdnatura.es openvpn-freeradius -############################################################################# - -### RESOLV ################################################################## -resolv_enabled: True -#resolv_enabled: False -domain_name: lab.verdnatura.es -search_name: lab.verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -update_enabled: True -#update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -packages_enabled: True -#packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -relay_host_enabled: True -#relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -centralized_auth_enabled: True -#centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -sudoers_enabled: True -#sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -vim_options_enabled: True -#vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -motd_enabled: True -#motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -hot_plug_enabled: True -#hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -locales_enabled: True -#locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -tzdata_enabled: True -#tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -repo_vn_enabled: True -#repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -#fail2ban_enabled: True -fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -nagios_nrpe_enabled: True -#nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -server_type_enabled: True -#server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -ntp_enabled: True -#ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -autofs_homes_enabled: True -#autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -zabbix_agent_enabled: True -#zabbix_agent_enabled: False -############################################################################# \ No newline at end of file diff --git a/host_vars/pbx.yaml b/host_vars/pbx.yaml deleted file mode 100644 index abf8857..0000000 --- a/host_vars/pbx.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -#root_user_enabled: True -root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -#hostname_enabled: True -hostname_enabled: False -hostname: 'pbx' -############################################################################# - -### HOSTS ################################################################### -#hosts_enabled: True -hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: pbx pbx.verdnatura.es pbx.static.verdnatura.es pbx.servers.dc.verdnatura.es -############################################################################# - -### RESOLV ################################################################## -#resolv_enabled: True -resolv_enabled: False -domain_name: verdnatura.es -search_name: verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -#update_enabled: True -update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -#packages_enabled: True -packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -#relay_host_enabled: True -relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -#centralized_auth_enabled: True -centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -#sudoers_enabled: True -sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -#vim_options_enabled: True -vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -#motd_enabled: True -motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -#hot_plug_enabled: True -hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -#locales_enabled: True -locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -#tzdata_enabled: True -tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -#repo_vn_enabled: True -repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -#fail2ban_enabled: True -fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -#nagios_nrpe_enabled: True -nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -#server_type_enabled: True -server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -#ntp_enabled: True -ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -autofs_homes_enabled: True -#autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -#zabbix_agent_enabled: True -zabbix_agent_enabled: False -############################################################################# \ No newline at end of file diff --git a/host_vars/test-playbook.yaml b/host_vars/test-playbook.yaml deleted file mode 100644 index 0a9d3a4..0000000 --- a/host_vars/test-playbook.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -#root-user_enabled: True -root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -#hostname_enabled: True -hostname_enabled: False -hostname: 'test-playbook' -############################################################################# - -### HOSTS ################################################################### -#hosts_enabled: True -hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: test-playbook.lab.dc.verdnatura.es test-playbook -############################################################################# - -### RESOLV ################################################################## -resolv_enabled: True -#resolv_enabled: False -domain_name: lab.dc.verdnatura.es -search_name: lab.dc.verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -#update_enabled: True -update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -#packages_enabled: True -packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -#relay-host_enabled: True -relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -#centralized-auth_enabled: True -centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -#sudoers_enabled: True -sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure-grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -#vim-options_enabled: True -vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -#motd_enabled: True -motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -#hot-plug_enabled: True -hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -#locales_enabled: True -locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -#tzdata_enabled: True -tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -#repo-vn_enabled: True -repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -#fail2ban_enabled: True -fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -#nagios-nrpe_enabled: True -nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -#server-type_enabled: True -server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -#ntp_enabled: True -ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -#autofs-homes_enabled: True -autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -zabbix_agent_enabled: True -#zabbix_agent_enabled: False -############################################################################# \ No newline at end of file diff --git a/host_vars/time1.yaml b/host_vars/time1.yaml deleted file mode 100644 index 3fdb187..0000000 --- a/host_vars/time1.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -#root_user_enabled: True -root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -#hostname_enabled: True -hostname_enabled: False -hostname: 'time1' -############################################################################# - -### HOSTS ################################################################### -#hosts_enabled: True -hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 10.0.1.87 - name: time1.verdnatura.es time1 -############################################################################# - -### RESOLV ################################################################## -#resolv_enabled: True -resolv_enabled: False -domain_name: verdnatura.es -search_name: verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -#update_enabled: True -update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -#packages_enabled: True -packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -#relay_host_enabled: True -relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -#centralized_auth_enabled: True -centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -#sudoers_enabled: True -sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -#vim_options_enabled: True -vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -#motd_enabled: True -motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -#hot_plug_enabled: True -hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -#locales_enabled: True -locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -#tzdata_enabled: True -tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -#repo_vn_enabled: True -repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -#fail2ban_enabled: True -fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -#nagios_nrpe_enabled: True -nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -#server_type_enabled: True -server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -#ntp_enabled: True -ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -autofs_homes_enabled: True -#autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -#zabbix_agent_enabled: True -zabbix_agent_enabled: False -############################################################################# \ No newline at end of file diff --git a/host_vars/time2.yaml b/host_vars/time2.yaml deleted file mode 100644 index 0167743..0000000 --- a/host_vars/time2.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -#root_user_enabled: True -root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -#hostname_enabled: True -hostname_enabled: False -hostname: 'time2' -############################################################################# - -### HOSTS ################################################################### -#hosts_enabled: True -hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: test-playbook.lab.dc.verdnatura.es test-playbook -############################################################################# - -### RESOLV ################################################################## -#resolv_enabled: True -resolv_enabled: False -domain_name: lab.dc.verdnatura.es -search_name: lab.dc.verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -#update_enabled: True -update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -#packages_enabled: True -packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -#relay_host_enabled: True -relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -#centralized_auth_enabled: True -centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -#sudoers_enabled: True -sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -#vim_options_enabled: True -vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -#motd_enabled: True -motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -#hot_plug_enabled: True -hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -#locales_enabled: True -locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -#tzdata_enabled: True -tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -#repo_vn_enabled: True -repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -#fail2ban_enabled: True -fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -#nagios_nrpe_enabled: True -nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -#server_type_enabled: True -server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -#ntp_enabled: True -ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -autofs_homes_enabled: True -#autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -#zabbix_agent_enabled: True -zabbix_agent_enabled: False -############################################################################# \ No newline at end of file diff --git a/host_vars/vm-debian12.yaml b/host_vars/vm-debian12.yaml deleted file mode 100644 index 0927886..0000000 --- a/host_vars/vm-debian12.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -root_user_enabled: True -#root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -hostname_enabled: True -#hostname_enabled: False -hostname: 'vm-debian12' -############################################################################# - -### HOSTS ################################################################### -hosts_enabled: True -#hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: vm-debian12.lab.verdnatura.es vm-debian12 -############################################################################# - -### RESOLV ################################################################## -resolv_enabled: True -#resolv_enabled: False -domain_name: lab.verdnatura.es -search_name: lab.verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -update_enabled: True -#update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -packages_enabled: True -#packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -relay_host_enabled: True -#relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -centralized_auth_enabled: True -#centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -sudoers_enabled: True -#sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -vim_options_enabled: True -#vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -motd_enabled: True -#motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -hot_plug_enabled: True -#hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -locales_enabled: True -#locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -tzdata_enabled: True -#tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -repo_vn_enabled: True -#repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -#fail2ban_enabled: True -fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -nagios_nrpe_enabled: True -#nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -server_type_enabled: True -#server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -ntp_enabled: True -#ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -autofs_homes_enabled: True -#autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -#zabbix_agent_enabled: True -zabbix_agent_enabled: False -############################################################################# diff --git a/host_vars/zabbix-frontend-web.yaml b/host_vars/zabbix-frontend-web.yaml deleted file mode 100644 index 3d66cbe..0000000 --- a/host_vars/zabbix-frontend-web.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -root_user_enabled: True -#root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -hostname_enabled: True -#hostname_enabled: False -hostname: 'zabbix-frontend-web' -############################################################################# - -### HOSTS ################################################################### -hosts_enabled: True -#hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: zabbix-frontend-web.lab.dc.verdnatura.es zabbix-frontend-web -############################################################################# - -### RESOLV ################################################################## -resolv_enabled: True -#resolv_enabled: False -domain_name: lab.dc.verdnatura.es -search_name: lab.dc.verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -update_enabled: True -#update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -packages_enabled: True -#packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -relay_host_enabled: True -#relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -centralized_auth_enabled: True -#centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -sudoers_enabled: True -#sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -vim_options_enabled: True -#vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -motd_enabled: True -#motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -hot_plug_enabled: True -#hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -locales_enabled: True -#locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -tzdata_enabled: True -#tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -repo_vn_enabled: True -#repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -fail2ban_enabled: True -#fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -#nagios_nrpe_enabled: True -nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -server_type_enabled: True -#server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -ntp_enabled: True -#ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -autofs_homes_enabled: True -#autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -#zabbix_agent_enabled: True -zabbix_agent_enabled: False -############################################################################# \ No newline at end of file diff --git a/host_vars/zabbix-server-db.yaml b/host_vars/zabbix-server-db.yaml deleted file mode 100644 index 017e1a9..0000000 --- a/host_vars/zabbix-server-db.yaml +++ /dev/null @@ -1,133 +0,0 @@ ---- - -### ROOT-USER ############################################################### -root_user_enabled: True -#root_user_enabled: False -############################################################################# - -### HOSTNAME ################################################################ -hostname_enabled: True -#hostname_enabled: False -hostname: 'zabbix-server-db' -############################################################################# - -### HOSTS ################################################################### -hosts_enabled: True -#hosts_enabled: False -hosts: - - ip: 127.0.0.1 - name: localhost - - ip: 127.0.1.1 - name: zabbix-server-db.lab.dc.verdnatura.es zabbix-server-db -############################################################################# - -### RESOLV ################################################################## -resolv_enabled: True -#resolv_enabled: False -domain_name: lab.dc.verdnatura.es -search_name: lab.dc.verdnatura.es -resolvs: - - ip: 10.0.0.4 - - ip: 10.0.0.5 -############################################################################# - -### UPDATE ################################################################## -update_enabled: True -#update_enabled: False -############################################################################# - -### INSTALL PACKAGES ######################################################## -packages_enabled: True -#packages_enabled: False -############################################################################# - -### RELAY HOST SMTP ######################################################### -relay_host_enabled: True -#relay_host_enabled: False -############################################################################# - -### CENTRALIZED AUTH ######################################################## -centralized_auth_enabled: True -#centralized_auth_enabled: False -############################################################################# - -### SUDOERS ################################################################# -sudoers_enabled: True -#sudoers_enabled: False -############################################################################# - -### SECURE GRUB ############################################################# -#secure_grub_enabled: True -secure_grub_enabled: False -############################################################################# - -### VIM OPTIONS ############################################################# -vim_options_enabled: True -#vim_options_enabled: False -############################################################################# - -### MOTD #################################################################### -motd_enabled: True -#motd_enabled: False -############################################################################# - -### HOT PLUG ################################################################ -hot_plug_enabled: True -#hot_plug_enabled: False -############################################################################# - -### LOCALES ################################################################# -locales_enabled: True -#locales_enabled: False -############################################################################# - -### TZDATA ################################################################## -tzdata_enabled: True -#tzdata_enabled: False -############################################################################# - -### REPO VN ################################################################# -repo_vn_enabled: True -#repo_vn_enabled: False -############################################################################# - -### FAIL2BAN ################################################################ -fail2ban_enabled: True -#fail2ban_enabled: False -fail2ban_times: - - bantime: "604800" - maxretry: "4" - findtime: "604800" -fail2ban_jails: - - name: sshd - enabled: true - port: ['22'] - filter: sshd - logpath: "%(sshd_log)s" - backend: "%(sshd_backend)s" -############################################################################# - -### NAGIOS NRPE ############################################################# -#nagios_nrpe_enabled: True -nagios_nrpe_enabled: False -############################################################################# - -### SERVER TYPE ############################################################# -server_type_enabled: True -#server_type_enabled: False -############################################################################# - -### NTP ##################################################################### -ntp_enabled: True -#ntp_enabled: False -############################################################################# - -### AUTOFS HOMES ############################################################ -autofs_homes_enabled: True -#autofs_homes_enabled: False -############################################################################# - -### ZABBIX AGENT ############################################################ -#zabbix_agent_enabled: True -zabbix_agent_enabled: False -############################################################################# \ No newline at end of file diff --git a/hosts b/hosts index 0db6381..1dff883 100644 --- a/hosts +++ b/hosts @@ -1,3 +1,34 @@ +[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-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] + +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 @@ -45,10 +76,6 @@ 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 -[devices] - -nas2 ansible_host=nas2.servers.dc.verdnatura.es - [windows] a3 ansible_host=a3.outsource.dc.verdnatura.es @@ -67,35 +94,20 @@ docuware ansible_host=docuware.outsource.dc.verdnatura.es [backup] vm-backup ansible_host=vm-backup.backup.dc.verdnatura.es -kube-backup ansible_host=kube-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 -[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 - - -[pve-ilo] - -pve01-ilo ansible_host=pve01-ilo.core.dc.verdnatura.es -pve02-ilo ansible_host=pve02-ilo.core.dc.verdnatura.es -pve03-ilo ansible_host=pve03-ilo.core.dc.verdnatura.es -pve04-ilo ansible_host=pve04-ilo.core.dc.verdnatura.es -pve05-ilo ansible_host=pve05-ilo.core.dc.verdnatura.es - -[kube-master] +[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 -[kube-worker] +[kubeWorker] kube-worker1 ansible_host=kube-worker1.servers.dc.verdnatura.es kube-worker2 ansible_host=kube-worker2.servers.dc.verdnatura.es @@ -103,21 +115,21 @@ 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] +[kubeProxy] kube-proxy1 ansible_host=kube-proxy1.servers.dc.verdnatura.es kube-proxy2 ansible_host=kube-proxy2.servers.dc.verdnatura.es -[kube-backup] +[kubeBackup] kube-helm ansible_host=kube-helm.servers.dc.verdnatura.es [kube:children] -kube-master -kube-worker -kube-proxy -kube-backup +kubeMaster +kubeWorker +kubeProxy +kubeBackup [test] diff --git a/hosts2 b/hosts2 deleted file mode 100644 index 0b1312e..0000000 --- a/hosts2 +++ /dev/null @@ -1,71 +0,0 @@ -[pcscomerciales] - -pc120 ansible_host=pc120.algemesi.verdnatura.es -pc213 ansible_host=pc213.algemesi.verdnatura.es -pc227 ansible_host=pc227.algemesi.verdnatura.es -pc235 ansible_host=pc235.algemesi.verdnatura.es -pc237 ansible_host=pc237.algemesi.verdnatura.es -pc243 ansible_host=pc243.algemesi.verdnatura.es -pc278 ansible_host=pc278.algemesi.verdnatura.es -pc279 ansible_host=pc279.algemesi.verdnatura.es -pc281 ansible_host=pc281.algemesi.verdnatura.es -pc289 ansible_host=pc289.algemesi.verdnatura.es -pc290 ansible_host=pc290.algemesi.verdnatura.es -pc291 ansible_host=pc291.algemesi.verdnatura.es -pc300 ansible_host=pc300.algemesi.verdnatura.es -pc301 ansible_host=pc301.algemesi.verdnatura.es -pc302 ansible_host=pc302.algemesi.verdnatura.es -pc304 ansible_host=pc304.algemesi.verdnatura.es -pc305 ansible_host=pc305.algemesi.verdnatura.es -pc308 ansible_host=pc308.algemesi.verdnatura.es -pc311 ansible_host=pc311.algemesi.verdnatura.es -pc312 ansible_host=pc312.algemesi.verdnatura.es -pc313 ansible_host=pc313.algemesi.verdnatura.es -pc318 ansible_host=pc318.algemesi.verdnatura.es -pc328 ansible_host=pc328.algemesi.verdnatura.es -pc342 ansible_host=pc342.algemesi.verdnatura.es -pc344 ansible_host=pc344.algemesi.verdnatura.es -pc350 ansible_host=pc350.algemesi.verdnatura.es -pc356 ansible_host=pc356.algemesi.verdnatura.es -pc358 ansible_host=pc358.algemesi.verdnatura.es -pc367 ansible_host=pc367.algemesi.verdnatura.es -pc371 ansible_host=pc371.algemesi.verdnatura.es -pc372 ansible_host=pc372.algemesi.verdnatura.es -pc373 ansible_host=pc373.algemesi.verdnatura.es -pc377 ansible_host=pc377.algemesi.verdnatura.es -pc378 ansible_host=pc378.algemesi.verdnatura.es -pc381 ansible_host=pc381.algemesi.verdnatura.es -pc382 ansible_host=pc382.algemesi.verdnatura.es -pc383 ansible_host=pc383.algemesi.verdnatura.es -pc385 ansible_host=pc385.algemesi.verdnatura.es -pc386 ansible_host=pc386.algemesi.verdnatura.es -pc387 ansible_host=pc387.algemesi.verdnatura.es -pc388 ansible_host=pc388.algemesi.verdnatura.es -pc389 ansible_host=pc389.algemesi.verdnatura.es -pc390 ansible_host=pc390.algemesi.verdnatura.es -pc391 ansible_host=pc391.algemesi.verdnatura.es -pc392 ansible_host=pc392.algemesi.verdnatura.es -pc393 ansible_host=pc393.algemesi.verdnatura.es -pc396 ansible_host=pc396.algemesi.verdnatura.es -pc397 ansible_host=pc397.algemesi.verdnatura.es -pc409 ansible_host=pc409.algemesi.verdnatura.es -pc413 ansible_host=pc413.algemesi.verdnatura.es -pc415 ansible_host=pc415.algemesi.verdnatura.es -pc417 ansible_host=pc417.algemesi.verdnatura.es -pc426 ansible_host=pc426.algemesi.verdnatura.es -pc429 ansible_host=pc429.algemesi.verdnatura.es -pc431 ansible_host=pc431.algemesi.verdnatura.es -pc432 ansible_host=pc432.algemesi.verdnatura.es -pc440 ansible_host=pc440.algemesi.verdnatura.es -pc456 ansible_host=pc456.algemesi.verdnatura.es -pc457 ansible_host=pc457.algemesi.verdnatura.es -pc458 ansible_host=pc458.algemesi.verdnatura.es -pc459 ansible_host=pc459.algemesi.verdnatura.es -pc461 ansible_host=pc461.algemesi.verdnatura.es -pc463 ansible_host=pc463.algemesi.verdnatura.es -pc465 ansible_host=pc465.algemesi.verdnatura.es -pc466 ansible_host=pc466.algemesi.verdnatura.es -pc467 ansible_host=pc467.algemesi.verdnatura.es -pc468 ansible_host=pc468.algemesi.verdnatura.es -pc473 ansible_host=pc473.algemesi.verdnatura.es -pc476 ansible_host=pc476.algemesi.verdnatura.es diff --git a/linux-base-config-debian-ct.yaml b/linux-base-config-debian-ct.yaml deleted file mode 100644 index 4d9e0e9..0000000 --- a/linux-base-config-debian-ct.yaml +++ /dev/null @@ -1,162 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: yes - - tasks: - -# - name: "[CONFIG AWX-USER] Create awx user and config ssh-key" -# import_role: -# name: config-awx-user -# tags: config-awx-user_config - - - name: "[CONFIG ROOT USER] Configure SSH root user" - import_role: - name: config-root-user - when: root_user_enabled is defined and root_user_enabled - tags: config-root-user_config - - - name: "[CONFIG HOSTNAME] Configure hostname" - import_role: - name: config-hostname - when: hostname_enabled is defined and hostname_enabled - tags: config-hostname_config - - - name: "[CONFIG HOSTS FILE] Configure hosts file" - import_role: - name: config-hosts - when: hosts_enabled is defined and hosts_enabled - tags: config-hosts_config_config - - - name: "[CONFIG RESOLV FILE] Configure resolv file" - import_role: - name: config-resolv - when: resolv_enabled is defined and resolv_enabled - tags: config-resolv_config - -# - name: "[CONFIG BASE DEBIAN OS] Configure debian os" -# import_role: -# name: config-base-debian-os -# tags: config-base-debian-os_config - - - name: "[CONFIG UPDATE] Config update" - import_role: - name: config-update-and-upgrade-packages - when: update_enabled is defined and update_enabled - tags: config-update-and-upgrade-packages_config - - - name: "[CONFIG INSTALL PACKAGES] Install packages" - import_role: - name: config-install-packages - when: packages_enabled is defined and packages_enabled - tags: config-install-packages_config - - - name: "[CONFIG RELAYHOST SMTP] Config relayhost smtp" - import_role: - name: config-relayhost-smtp - when: relay_host_enabled is defined and relay_host_enabled - tags: config-relayhost-smtp_config - - - name: "[CONFIG CENTRALIZED AUTH] Config centralized auth" - import_role: - name: config-centralized-auth - when: centralized_auth_enabled is defined and centralized_auth_enabled - tags: config-centralized-auth_config - - - name: "[CONFIG SUDOERS] Config sudoers" - import_role: - name: config-sudoers - when: sudoers_enabled is defined and sudoers_enabled - tags: config-sudoers_config - -# - name: "[CONFIG SECURE GRUB] configure secure grub" -# import_role: -# name: config-secure-grub -# when: secure_grub_enabled is defined and secure_grub_enabled -# tags: config-secure-grub_config - - - name: "[CONFIG VIM OPTIONS] Config vim options" - import_role: - name: config-vim-options - when: vim_options_enabled is defined and vim_options_enabled - tags: config-vim-options_config - - - name: "[CONFIG MOTD] Config motd" - import_role: - name: config-motd - when: motd_enabled is defined and motd_enabled - tags: config-motd_config - -# - name: "[CONFIG HOT PLUG] Install and configure hot plug" -# import_role: -# name: config-hot-plug -# when: hot_plug_enabled is defined and hot_plug_enabled -# tags: config-hot-plug_config - - - name: "[CONFIG LOCALES] Set locales" - import_role: - name: config-locales - when: locales_enabled is defined and locales_enabled - tags: config-locales_config - - - name: "[CONFIG TZDATA] Set timezone" - import_role: - name: config-tzdata - when: tzdata_enabled is defined and tzdata_enabled - tags: config-tzdata_config - - - name: "[CONFIG REPO VN] Add-repos-vn" - import_role: - name: config-repo-vn - when: repo_vn_enabled is defined and repo_vn_enabled - tags: config-repo-vn_config - - - name: "[CONFIG FAIL2BAN] Install and configure fail2ban service" - import_role: - name: config-fail2ban - when: fail2ban_enabled is defined and fail2ban_enabled - tags: config-fail2ban_config - - - name: "[CONFIG NAGIOS NRPE] Install and configure nagios nrpe service" - import_role: - name: config-nagios-nrpe - when: nagios_nrpe_enabled is defined and nagios_nrpe_enabled - tags: config-nagios-nrpe_config - -# - name: "[CONFIG SERVER TYPE] Install guest side" -# import_role: -# name: config-server-type -# when: server_type_enabled is defined and server_type_enabled -# tags: config-server-type_config - -# NO HACE FALTA , PROXMOX CT utiliza ntp client de proxmox -# - name: "[CONFIG NTP] Install and configure ntp" -# import_role: -# name: config-ntp -# when: ntp_enabled is defined and ntp_enabled -# tags: config-ntp_config - -# - name: "[CONFIG AUTOFS HOMES] Install and configure AUTOFS HOMES" -# import_role: -# name: config-autofs-homes -# when: autofs_homes_enabled is defined and autofs_homes_enabled -# tags: config-autofs-homes_config - - - name: "[CONFIG ZABBIX AGENT] Install and configure ZABBIX AGENT" - import_role: - name: config-zabbix-agent - when: zabbix_agent_enabled is defined and zabbix_agent_enabled - tags: config-zabbix-agent_config - -#handlers: -# - include_tasks: roles/{{ item }}/handlers/main.yaml -# with_items: -# - config-awx-user -# - config-root-user -# - config-base-debian-os -# - config-repo-vn -# - config-fail2ban # or hacer -# - config-nagios-nrpe # or hacer -# - config-server-type \ No newline at end of file diff --git a/linux-base-config-debian-physical-server.yaml b/linux-base-config-debian-physical-server.yaml deleted file mode 100644 index 00fb2d0..0000000 --- a/linux-base-config-debian-physical-server.yaml +++ /dev/null @@ -1,76 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: yes - - tasks: - -# - name: "[CONFIG AWX-USER] Create awx user and config ssh-key" -# import_role: -# name: config-awx-user -# tags: config-awx-user_config - -# - name: "[CONFIG ROOT USER] Configure SSH root user" -# import_role: -# name: config-root-user -# tags: config-root-user_config - - - name: "[CONFIG BASE DEBIAN OS] Configure debian os" - import_role: - name: config-base-debian-os -# tags: config-base-debian-os_config - - - name: "[CONFIG LOCALES] Set locales" - import_role: - name: config-locales - - - name: "[CONFIG TZDATA] Set timezone" - import_role: - name: config-tzdata - - - name: "[CONFIG REPO VN] Add-repos-vn" - import_role: - name: config-repo-vn -# tags: config-repo-vn_config - - - name: "[CONFIG FAIL2BAN] Install and configure fail2ban service" - import_role: - name: config-fail2ban -# tags: config-fail2ban_config - - - name: "[CONFIG NAGIOS NRPE] Install and configure nagios nrpe service" - import_role: - name: config-nagios-nrpe -# tags: config-nagios-nrpe_config - -# - name: "[CONFIG SERVER TYPE] Install guest side" -# import_role: -# name: config-server-type -# tags: config-server-type_config - - - name: "[CONFIG NTP] Install and configure ntp" - import_role: - name: config-ntp -# tags: config-ntp_config - - - name: "[CONFIG AUTOFS HOMES] Install and configure AUTOFS HOMES" - import_role: - name: config-autofs-homes - - - name: "[CONFIG ZABBIX AGENT] Install and configure ZABBIX AGENT" - import_role: - name: config-zabbix-agent -# tags: config-zabbix-agent_config - -#handlers: -# - include_tasks: roles/{{ item }}/handlers/main.yaml -# with_items: -# - config-awx-user -# - config-root-user -# - config-base-debian-os -# - config-repo-vn -# - config-fail2ban # or hacer -# - config-nagios-nrpe # or hacer -# - config-server-type \ No newline at end of file diff --git a/linux-base-config-debian-vm.yaml b/linux-base-config-debian-vm.yaml deleted file mode 100644 index cf5fa01..0000000 --- a/linux-base-config-debian-vm.yaml +++ /dev/null @@ -1,156 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: yes - - tasks: - -# - name: "[CONFIG AWX-USER] Create awx user and config ssh-key" -# import_role: -# name: config-awx-user -# tags: config-awx-user_config - - - name: "[CONFIG ROOT USER] Configure SSH root user" - import_role: - name: config-root-user - when: root_user_enabled is defined and root_user_enabled - tags: config-root-user_config - - - name: "[CONFIG HOSTNAME] Configure hostname" - import_role: - name: config-hostname - when: hostname_enabled is defined and hostname_enabled - tags: config-hostname_config - - - name: "[CONFIG HOSTS FILE] Configure hosts file" - import_role: - name: config-hosts - when: hosts_enabled is defined and hosts_enabled - tags: config-hosts_config_config - - - name: "[CONFIG RESOLV FILE] Configure resolv file" - import_role: - name: config-resolv - when: resolv_enabled is defined and resolv_enabled - tags: config-resolv_config - - - name: "[CONFIG UPDATE] Config update" - import_role: - name: config-update-and-upgrade-packages - when: update_enabled is defined and update_enabled - tags: config-update-and-upgrade-packages_config - - - name: "[CONFIG INSTALL PACKAGES] Install packages" - import_role: - name: config-install-packages - when: packages_enabled is defined and packages_enabled - tags: config-install-packages_config - - - name: "[CONFIG RELAYHOST SMTP] Config relayhost smtp" - import_role: - name: config-relayhost-smtp - when: relay_host_enabled is defined and relay_host_enabled - tags: config-relayhost-smtp_config - - - name: "[CONFIG CENTRALIZED AUTH] Config centralized auth" - import_role: - name: config-centralized-auth - when: centralized_auth_enabled is defined and centralized_auth_enabled - tags: config-centralized-auth_config - - - name: "[CONFIG SUDOERS] Config sudoers" - import_role: - name: config-sudoers - when: sudoers_enabled is defined and sudoers_enabled - tags: config-sudoers_config - - - name: "[CONFIG SECURE GRUB] configure secure grub" - import_role: - name: config-secure-grub - when: secure_grub_enabled is defined and secure_grub_enabled - tags: config-secure-grub_config - - - name: "[CONFIG VIM OPTIONS] Config vim options" - import_role: - name: config-vim-options - when: vim_options_enabled is defined and vim_options_enabled - tags: config-vim-options_config - - - name: "[CONFIG MOTD] Config motd" - import_role: - name: config-motd - when: motd_enabled is defined and motd_enabled - tags: config-motd_config - - - name: "[CONFIG HOT PLUG] Install and configure hot plug" - import_role: - name: config-hot-plug - when: hot_plug_enabled is defined and hot_plug_enabled - tags: config-hot-plug_config - - - name: "[CONFIG LOCALES] Set locales" - import_role: - name: config-locales - when: locales_enabled is defined and locales_enabled - tags: config-locales_config - - - name: "[CONFIG TZDATA] Set timezone" - import_role: - name: config-tzdata - when: tzdata_enabled is defined and tzdata_enabled - tags: config-tzdata_config - - - name: "[CONFIG REPO VN] Add-repos-vn" - import_role: - name: config-repo-vn - when: repo_vn_enabled is defined and repo_vn_enabled - tags: config-repo-vn_config - - - name: "[CONFIG FAIL2BAN] Install and configure fail2ban service" - import_role: - name: config-fail2ban - when: fail2ban_enabled is defined and fail2ban_enabled - tags: config-fail2ban_config - - - name: "[CONFIG NAGIOS NRPE] Install and configure nagios nrpe service" - import_role: - name: config-nagios-nrpe - when: nagios_nrpe_enabled is defined and nagios_nrpe_enabled - tags: config-nagios-nrpe_config - - - name: "[CONFIG SERVER TYPE] Install guest side" - import_role: - name: config-server-type - when: server_type_enabled is defined and server_type_enabled - tags: config-server-type_config - - - name: "[CONFIG NTP] Install and configure ntp" - import_role: - name: config-ntp - when: ntp_enabled is defined and ntp_enabled - tags: config-ntp_config - - - name: "[CONFIG AUTOFS HOMES] Install and configure AUTOFS HOMES" - import_role: - name: config-autofs-homes - when: autofs_homes_enabled is defined and autofs_homes_enabled - tags: config-autofs-homes_config - - - name: "[CONFIG ZABBIX AGENT] Install and configure ZABBIX AGENT" - import_role: - name: config-zabbix-agent - when: zabbix_agent_enabled is defined and zabbix_agent_enabled - tags: config-zabbix-agent_config - -#handlers: -# - include_tasks: roles/{{ item }}/handlers/main.yaml -# with_items: -# - config-awx-user -# - config-root-user -# - config-base-debian-os -# - config-repo-vn -# - config-fail2ban # or hacer -# - config-nagios-nrpe # or hacer -# - config-server-type \ No newline at end of file diff --git a/linux-base-config-debian.yaml b/linux-base-config-debian.yaml deleted file mode 100644 index a18b450..0000000 --- a/linux-base-config-debian.yaml +++ /dev/null @@ -1,72 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: yes - - tasks: - -# - name: "[CONFIG AWX-USER] Create awx user and config ssh-key" -# import_role: -# name: config-awx-user -# tags: config-awx-user_config - - - name: "[CONFIG ROOT USER] Configure SSH root user" - import_role: - name: config-root-user - tags: config-root-user_config - - - name: "[CONFIG BASE DEBIAN OS] Configure debian os" - import_role: - name: config-base-debian-os - tags: config-base-debian-os_config - - - name: "[CONFIG LOCALES] Set locales" - import_role: - name: config-locales - - - name: "[CONFIG TZDATA] Set timezone" - import_role: - name: config-tzdata - - - name: "[CONFIG REPO VN] Add-repos-vn" - import_role: - name: config-repo-vn - tags: config-repo-vn_config - - - name: "[CONFIG FAIL2BAN] Install and configure fail2ban service" - import_role: - name: config-fail2ban - tags: config-fail2ban_config - - - name: "[CONFIG NAGIOS NRPE] Install and configure nagios nrpe service" - import_role: - name: config-nagios-nrpe - tags: config-nagios-nrpe_config - - - name: "[CONFIG SERVER TYPE] Install guest side" - import_role: - name: config-server-type - tags: config-server-type_config - - - name: "[CONFIG NTP] Install and configure ntp" - import_role: - name: config-ntp - tags: config-ntp_config - - - name: "[CONFIG ZABBIX AGENT] Install and configure ZABBIX AGENT" - import_role: - name: config-zabbix-agent - tags: config-zabbix-agent_config - -#handlers: -# - include_tasks: roles/{{ item }}/handlers/main.yaml -# with_items: -# - config-awx-user -# - config-root-user -# - config-base-debian-os -# - config-repo-vn -# - config-fail2ban # or hacer -# - config-nagios-nrpe # or hacer -# - config-server-type \ No newline at end of file diff --git a/linux-config-autofs-homes.yaml b/linux-config-autofs-homes.yaml deleted file mode 100644 index 94c5b06..0000000 --- a/linux-config-autofs-homes.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: no - - tasks: - - - name: "[CONFIG AUTOFS HOMES] Comprobando si es necesario configurar AUTOFS HOMES" - debug: - msg: "No es necesario configurar AUTOFS HOMES en la máquina" - when: autofs_homes_enabled is not defined or not autofs_homes_enabled - - - name: "[CONFIG AUTOFS HOMES] Install and configure AUTOFS HOMES" - import_role: - name: config-autofs-homes - when: autofs_homes_enabled is defined and autofs_homes_enabled \ No newline at end of file diff --git a/linux-config-awx-user.yaml b/linux-config-awx-user.yaml deleted file mode 100644 index 06e80b0..0000000 --- a/linux-config-awx-user.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: no - - tasks: - - - name: "[CREATE AWX-USER] Create awx user and config ssh-key" - import_role: - name: config-awx-user \ No newline at end of file diff --git a/linux-config-base-debian-os.yaml b/linux-config-base-debian-os.yaml deleted file mode 100644 index 2899cbe..0000000 --- a/linux-config-base-debian-os.yaml +++ /dev/null @@ -1,20 +0,0 @@ ---- - -#- hosts: '{{ ip_addr }}' -# become: yes -# become_method: sudo -# gather_facts: yes - -# tasks: - -# - name: "[CONFIG BASE DEBIAN OS] Configure debian os" -# import_role: -# name: config-base-debian-os - -# - name: "[CONFIG LOCALES] Set locales" -# import_role: -# name: config-locales - -# - name: "[CONFIG TZDATA] Set timezone" -# import_role: -# name: config-tzdata \ No newline at end of file diff --git a/linux-config-centralized-auth.yaml b/linux-config-centralized-auth.yaml deleted file mode 100644 index ca3600d..0000000 --- a/linux-config-centralized-auth.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: yes - - tasks: - - - name: "[CONFIG CENTRALIZED AUTH] Comprobando si es necesario configurar centralized auth" - debug: - msg: "No es necesario configurar centralized auth en la máquina" - when: centralized_auth_enabled is not defined or not centralized_auth_enabled - - - name: "[CONFIG CENTRALIZED AUTH] Config centralized auth" - import_role: - name: config-centralized-auth - when: centralized_auth_enabled is defined and centralized_auth_enabled \ No newline at end of file diff --git a/linux-config-fail2ban.yaml b/linux-config-fail2ban.yaml deleted file mode 100644 index 469d244..0000000 --- a/linux-config-fail2ban.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: yes - - tasks: - - - name: "[CONFIG FAIL2BAN] Comprobando si es necesario configurar fail2ban " - debug: - msg: "No es necesario configurar fail2ban en la máquina" - when: fail2ban_enabled is not defined or not fail2ban_enabled - - - name: "[CONFIG FAIL2BAN] Install and configure fail2ban service" - import_role: - name: config-fail2ban - when: fail2ban_enabled is defined and fail2ban_enabled diff --git a/linux-config-freeradius-totp.yaml b/linux-config-freeradius-totp.yaml deleted file mode 100644 index 05439d4..0000000 --- a/linux-config-freeradius-totp.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: no - - tasks: - - - name: "[CONFIG FREERADIUS TOTOP] Install and configure FREERADIUS TOTOP" - import_role: - name: config-freeradius-totp \ No newline at end of file diff --git a/linux-config-hostname.yaml b/linux-config-hostname.yaml deleted file mode 100644 index d2d8fc6..0000000 --- a/linux-config-hostname.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: yes - - tasks: - - - name: "[CONFIG HOSTNAME] Comprobando si es necesario configurar hostname " - debug: - msg: "No es necesario configurar hostname en la máquina" - when: hostname_enabled is not defined or not hostname_enabled - - - name: "[CONFIG HOSTNAME] Configure hostname" - import_role: - name: config-hostname - when: hostname_enabled is defined and hostname_enabled diff --git a/linux-config-hosts.yaml b/linux-config-hosts.yaml deleted file mode 100644 index 14ed116..0000000 --- a/linux-config-hosts.yaml +++ /dev/null @@ -1,19 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: yes - - tasks: - - - name: "[CONFIG HOSTS FILE] Comprobando si es necesario configurar hosts file " - debug: - msg: "No es necesario configurar hosts file en la máquina" - when: hosts_enabled is not defined or not hosts_enabled - - - name: "[CONFIG HOSTS FILE] Configure hosts file" - import_role: - name: config-hosts - when: hosts_enabled is defined and hosts_enabled - diff --git a/linux-config-hot-plug.yaml b/linux-config-hot-plug.yaml deleted file mode 100644 index ccfd01f..0000000 --- a/linux-config-hot-plug.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: yes - - tasks: - - - name: "[CONFIG HOT PLUG] Comprobando si es necesario configurar hot plug" - debug: - msg: "No es necesario configurar hot plug en la máquina" - when: hot_plug_enabled is not defined or not hot_plug_enabled - - - name: "[CONFIG HOT PLUG] Install and configure hot plug" - import_role: - name: config-hot-plug - when: hot_plug_enabled is defined and hot_plug_enabled diff --git a/linux-config-install-packages.yaml b/linux-config-install-packages.yaml deleted file mode 100644 index 905d74c..0000000 --- a/linux-config-install-packages.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: yes - - tasks: - - - name: "[CONFIG INSTALL PACKAGES] Comprobando si es necesario instalar paqueteria" - debug: - msg: "No es necesario instalar paqueteria en la máquina" - when: packages_enabled is not defined or not packages_enabled - - - name: "[CONFIG INSTALL PACKAGES] Install packages" - import_role: - name: config-install-packages - when: packages_enabled is defined and packages_enabled \ No newline at end of file diff --git a/linux-config-locales.yaml b/linux-config-locales.yaml deleted file mode 100644 index a16f686..0000000 --- a/linux-config-locales.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: yes - - tasks: - - - name: "[CONFIG LOCALES] Comprobando si es necesario configurar locales" - debug: - msg: "No es necesario configurar locales en la máquina" - when: locales_enabled is not defined or not locales_enabled - - - name: "[CONFIG LOCALES] Set locales" - import_role: - name: config-locales - when: locales_enabled is defined and locales_enabled \ No newline at end of file diff --git a/linux-config-motd.yaml b/linux-config-motd.yaml deleted file mode 100644 index 12a37fe..0000000 --- a/linux-config-motd.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: yes - - tasks: - - - name: "[CONFIG MOTD] Comprobando si es necesario configurar motd" - debug: - msg: "No es necesario configurar motd en la máquina" - when: motd_enabled is not defined or not motd_enabled - - - name: "[CONFIG MOTD] Config motd" - import_role: - name: config-motd - when: motd_enabled is defined and motd_enabled \ No newline at end of file diff --git a/linux-config-nagios-nrpe.yaml b/linux-config-nagios-nrpe.yaml deleted file mode 100644 index 6f699d1..0000000 --- a/linux-config-nagios-nrpe.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: no - - tasks: - - name: "[CONFIG NAGIOS NRPE] Install and configure nagios nrpe service" - import_role: - name: config-nagios-nrpe - when: nagios_nrpe_enabled is defined and nagios_nrpe_enabled diff --git a/linux-config-nsupdate.yaml b/linux-config-nsupdate.yaml deleted file mode 100644 index bb224cc..0000000 --- a/linux-config-nsupdate.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- - -- hosts: ns1 - become: yes - become_method: sudo - gather_facts: no - - tasks: - - - name: "[CONFIG NSUPDATE] configure zone with NSUPDATE" - import_role: - name: config-nsupdate \ No newline at end of file diff --git a/linux-config-ntp.yaml b/linux-config-ntp.yaml deleted file mode 100644 index f8feaad..0000000 --- a/linux-config-ntp.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: yes - - tasks: - - - name: "[CONFIG NTP] Comprobando si es necesario configurar ntp" - debug: - msg: "No es necesario configurar ntp en la máquina" - when: ntp_enabled is not defined or not ntp_enabled - - - name: "[CONFIG NTP] Install and configure ntp" - import_role: - name: config-ntp - when: ntp_enabled is defined and ntp_enabled diff --git a/linux-config-relayhost-smtp.yaml b/linux-config-relayhost-smtp.yaml deleted file mode 100644 index 6fc7eaa..0000000 --- a/linux-config-relayhost-smtp.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: yes - - tasks: - - - name: "[CONFIG RELAYHOST SMTP] Comprobando si es necesario configurar relayhost smtp" - debug: - msg: "No es necesario configurar relayhost smtp en la máquina" - when: relay_host_enabled is not defined or not relay_host_enabled - - - name: "[CONFIG RELAYHOST SMTP] Config relayhost smtp" - import_role: - name: config-relayhost-smtp - when: relay_host_enabled is defined and relay_host_enabled \ No newline at end of file diff --git a/linux-config-repo-vn.yaml b/linux-config-repo-vn.yaml deleted file mode 100644 index 7038a22..0000000 --- a/linux-config-repo-vn.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: no - - tasks: - - - name: "[CONFIG REPO VN] Comprobando si es necesario configurar repositorios" - debug: - msg: "No es necesario configurar repositorios en la máquina" - when: repo_vn_enabled is not defined or not repo_vn_enabled - - - name: "[CONFIG REPO VN] Add-repos-vn" - import_role: - name: config-repo-vn - when: repo_vn_enabled is defined and repo_vn_enabled diff --git a/linux-config-resolv.yaml b/linux-config-resolv.yaml deleted file mode 100644 index c087f33..0000000 --- a/linux-config-resolv.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: yes - - tasks: - - - name: "[CONFIG RESOLV FILE] Comprobando si es necesario configurar resolv file " - debug: - msg: "No es necesario configurar resolv file en la máquina" - when: resolv_enabled is not defined or not resolv_enabled - - - name: "[CONFIG RESOLV FILE] Configure resolv file" - import_role: - name: config-resolv - when: resolv_enabled is defined and resolv_enabled diff --git a/linux-config-root-user.yaml b/linux-config-root-user.yaml deleted file mode 100644 index 41165b9..0000000 --- a/linux-config-root-user.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: no - - tasks: - - - name: "[CONFIG ROOT USER] Comprobando si es necesario configurar SSH root user" - debug: - msg: "No es necesario configurar SSH root user en la máquina" - when: root_user_enabled is not defined or not root_user_enabled - - - name: "[CONFIG ROOT USER] Configure SSH root user" - import_role: - name: config-root-user - when: root_user_enabled is defined and root_user_enabled diff --git a/linux-config-secure-grub.yaml b/linux-config-secure-grub.yaml deleted file mode 100644 index e422168..0000000 --- a/linux-config-secure-grub.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: yes - - tasks: - - - name: "[CONFIG SECURE GRUB] Comprobando si es necesario configurar secure grub" - debug: - msg: "No es necesario configurar secure grub en la máquina" - when: secure_grub_enabled is not defined or not secure_grub_enabled - - - name: "[CONFIG SECURE GRUB] configure secure grub" - import_role: - name: config-secure-grub - when: secure_grub_enabled is defined and secure_grub_enabled diff --git a/linux-config-send-mail.yaml b/linux-config-send-mail.yaml deleted file mode 100644 index 7080807..0000000 --- a/linux-config-send-mail.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- - -- hosts: localhost - become: no - become_method: sudo - gather_facts: yes - - tasks: - - - name: "[CONFIG SEND MAIL] Send Mail" - import_role: - name: config-send-mail \ No newline at end of file diff --git a/linux-config-server-type.yaml b/linux-config-server-type.yaml deleted file mode 100644 index 84609b0..0000000 --- a/linux-config-server-type.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: no - - tasks: - - - name: "[CONFIG SERVER TYPE] Comprobando si es necesario instalar guest side" - debug: - msg: "No es necesario instalar guest side en la máquina" - when: server_type_enabled is not defined or not server_type_enabled - - - name: "[CONFIG SERVER TYPE] Install guest side" - import_role: - name: config-server-type - when: server_type_enabled is defined and server_type_enabled diff --git a/linux-config-sudoers.yaml b/linux-config-sudoers.yaml deleted file mode 100644 index dbc1a7f..0000000 --- a/linux-config-sudoers.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: yes - - tasks: - - - name: "[CONFIG SUDOERS] Comprobando si es necesario configurar sudoers" - debug: - msg: "No es necesario configurar sudoers en la máquina" - when: sudoers_enabled is not defined or not sudoers_enabled - - - name: "[CONFIG SUDOERS] Config sudoers" - import_role: - name: config-sudoers - when: sudoers_enabled is defined and sudoers_enabled \ No newline at end of file diff --git a/linux-config-tzdata.yaml b/linux-config-tzdata.yaml deleted file mode 100644 index 2b5b49f..0000000 --- a/linux-config-tzdata.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: yes - - tasks: - - - name: "[CONFIG TZDATA] Comprobando si es necesario configurar timezone" - debug: - msg: "No es necesario configurar timezone en la máquina" - when: tzdata_enabled is not defined or not tzdata_enabled - - - name: "[CONFIG TZDATA] Set timezone" - import_role: - name: config-tzdata - when: tzdata_enabled is defined and tzdata_enabled \ No newline at end of file diff --git a/linux-config-update-and-upgrade-packages.yaml b/linux-config-update-and-upgrade-packages.yaml deleted file mode 100644 index 69adfce..0000000 --- a/linux-config-update-and-upgrade-packages.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: yes - - tasks: - - - name: "[CONFIG UPDATE] Comprobando si es necesario realizar update " - debug: - msg: "No es necesario realizar update en la máquina" - when: update_enabled is not defined or not update_enabled - - - name: "[CONFIG UPDATE] Config update" - import_role: - name: config-update-and-upgrade-packages - when: update_enabled is defined and update_enabled \ No newline at end of file diff --git a/linux-config-vim-options.yaml b/linux-config-vim-options.yaml deleted file mode 100644 index c77eb46..0000000 --- a/linux-config-vim-options.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: yes - - tasks: - - - name: "[CONFIG VIM OPTIONS] Comprobando si es necesario configurar vim options" - debug: - msg: "No es necesario configurar vim options en la máquina" - when: vim_options_enabled is not defined or not vim_options_enabled - - - name: "[CONFIG VIM OPTIONS] Config vim options" - import_role: - name: config-vim-options - when: vim_options_enabled is defined and vim_options_enabled \ No newline at end of file diff --git a/linux-config-zabbix-agent.yaml b/linux-config-zabbix-agent.yaml deleted file mode 100644 index 4897a86..0000000 --- a/linux-config-zabbix-agent.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: no - - tasks: - - - name: "[CONFIG ZABBIX AGENT] Comprobando si es necesario configurar ZABBIX AGENT" - debug: - msg: "No es necesario configurar ZABBIX AGENT en la máquina" - when: zabbix_agent_enabled is not defined or not zabbix_agent_enabled - - - name: "[CONFIG ZABBIX AGENT] Install and configure ZABBIX AGENT" - import_role: - name: config-zabbix-agent - when: zabbix_agent_enabled is defined and zabbix_agent_enabled \ No newline at end of file diff --git a/linux-patch-exim4.yaml b/linux-patch-exim4.yaml deleted file mode 100644 index 1d240b9..0000000 --- a/linux-patch-exim4.yaml +++ /dev/null @@ -1,27 +0,0 @@ ---- - -- hosts: '{{ ip_addr }}' - become: yes - become_method: sudo - gather_facts: yes - - tasks: - -# step1 - run apt-get update - - name: update index of all packages - ansible.builtin.apt: - update_cache: true - force_apt_get: true - -# step2 - run apt-get update - - name: update all packages to their latest version - ansible.builtin.apt: - name: "exim4" - state: latest - force_apt_get: true - -# step3 - run apt autoremove - - name: autoremove packages unused dependency packages - ansible.builtin.apt: - autoremove: true - force_apt_get: true \ No newline at end of file diff --git a/linux-ping.yml b/linux-ping.yml deleted file mode 100644 index 9b684d9..0000000 --- a/linux-ping.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- - -- hosts: '{{ hosts_servers }}' - gather_facts: true - tasks: - - ping: \ No newline at end of file diff --git a/playbooks/debian-base.yaml b/playbooks/debian-base.yaml new file mode 100644 index 0000000..2807e6d --- /dev/null +++ b/playbooks/debian-base.yaml @@ -0,0 +1,20 @@ +- hosts: all + tasks: + - name: Set locales + import_role: + name: config-locales + - name: Set timezone + import_role: + name: config-tzdata + - name: Install and configure fail2ban service + import_role: + name: config-fail2ban + tags: config-fail2ban_config + - name: Install guest side + import_role: + name: config-server-type + tags: config-server-type_config + - name: Install and configure ntp + import_role: + name: config-ntp + tags: config-ntp_config diff --git a/playbooks/debian-ct.yaml b/playbooks/debian-ct.yaml new file mode 100644 index 0000000..6b0c442 --- /dev/null +++ b/playbooks/debian-ct.yaml @@ -0,0 +1,27 @@ +- hosts: all + + - name: Config relayhost smtp + import_role: + name: config-relayhost-smtp + when: relay_host_enabled is defined and relay_host_enabled + tags: config-relayhost-smtp_config + - name: Config centralized auth + import_role: + name: config-centralized-auth + when: centralized_auth_enabled is defined and centralized_auth_enabled + tags: config-centralized-auth_config + - name: Set locales + import_role: + name: config-locales + when: locales_enabled is defined and locales_enabled + tags: config-locales_config + - name: Set timezone + import_role: + name: config-tzdata + when: tzdata_enabled is defined and tzdata_enabled + tags: config-tzdata_config + - name: Install and configure fail2ban service + import_role: + name: config-fail2ban + when: fail2ban_enabled is defined and fail2ban_enabled + tags: config-fail2ban_config diff --git a/playbooks/debian-infra.yaml b/playbooks/debian-infra.yaml new file mode 100644 index 0000000..40ebf56 --- /dev/null +++ b/playbooks/debian-infra.yaml @@ -0,0 +1,23 @@ +- hosts: all + tasks: + - name: Configure debian os + import_role: + name: config-base-debian-os + - name: Set locales + import_role: + name: config-locales + - name: Set timezone + import_role: + name: config-tzdata + - name: Add-repos-vn + import_role: + name: config-repo-vn + - name: Install and configure fail2ban service + import_role: + name: config-fail2ban + - name: Install and configure nagios nrpe service + import_role: + name: config-nagios-nrpe + - name: Install and configure ntp + import_role: + name: config-ntp diff --git a/playbooks/debian-upgrade.yaml b/playbooks/debian-upgrade.yaml new file mode 100644 index 0000000..de568cd --- /dev/null +++ b/playbooks/debian-upgrade.yaml @@ -0,0 +1,5 @@ +- hosts: all + tasks: + - name: Upgrade system + import_role: + name: linux-upgrade diff --git a/playbooks/debian-vm.yaml b/playbooks/debian-vm.yaml new file mode 100644 index 0000000..0e6ff3e --- /dev/null +++ b/playbooks/debian-vm.yaml @@ -0,0 +1,57 @@ +- hosts: all + tasks: + - name: Install packages + import_role: + name: config-install-packages + when: packages_enabled is defined and packages_enabled + tags: config-install-packages_config + - name: Config relayhost smtp + import_role: + name: config-relayhost-smtp + when: relay_host_enabled is defined and relay_host_enabled + tags: config-relayhost-smtp_config + - name: Config centralized auth + import_role: + name: config-centralized-auth + when: centralized_auth_enabled is defined and centralized_auth_enabled + tags: config-centralized-auth_config + - name: configure secure grub + import_role: + name: config-secure-grub + when: secure_grub_enabled is defined and secure_grub_enabled + tags: config-secure-grub_config + - name: Install and configure hot plug + import_role: + name: config-hot-plug + when: hot_plug_enabled is defined and hot_plug_enabled + tags: config-hot-plug_config + - name: Set locales + import_role: + name: config-locales + when: locales_enabled is defined and locales_enabled + tags: config-locales_config + - name: Set timezone + import_role: + name: config-tzdata + when: tzdata_enabled is defined and tzdata_enabled + tags: config-tzdata_config + - name: Install and configure fail2ban service + import_role: + name: config-fail2ban + when: fail2ban_enabled is defined and fail2ban_enabled + tags: config-fail2ban_config + - name: Install guest side + import_role: + name: config-server-type + when: server_type_enabled is defined and server_type_enabled + tags: config-server-type_config + - name: Install and configure ntp + import_role: + name: config-ntp + when: ntp_enabled is defined and ntp_enabled + tags: config-ntp_config + - name: Install and configure AUTOFS HOMES + import_role: + name: config-autofs-homes + when: autofs_homes_enabled is defined and autofs_homes_enabled + tags: config-autofs-homes_config diff --git a/playbooks/debian.yaml b/playbooks/debian.yaml new file mode 100644 index 0000000..0db3d8a --- /dev/null +++ b/playbooks/debian.yaml @@ -0,0 +1,5 @@ +- hosts: all + tasks: + - name: Configure base system + import_role: + name: linux-base diff --git a/playbooks/freeradius.yaml b/playbooks/freeradius.yaml new file mode 100644 index 0000000..2783ef1 --- /dev/null +++ b/playbooks/freeradius.yaml @@ -0,0 +1,5 @@ +- hosts: all + tasks: + - name: Install and configure Freeradius with TOTP + import_role: + name: freeradius \ No newline at end of file diff --git a/playbooks/nsupdate.yaml b/playbooks/nsupdate.yaml new file mode 100644 index 0000000..454bb43 --- /dev/null +++ b/playbooks/nsupdate.yaml @@ -0,0 +1,5 @@ +- hosts: ns1 + tasks: + - name: Configure zone with nsupdate + import_role: + name: nsupdate \ No newline at end of file diff --git a/playbooks/ping.yml b/playbooks/ping.yml new file mode 100644 index 0000000..55c6a68 --- /dev/null +++ b/playbooks/ping.yml @@ -0,0 +1,3 @@ +- hosts: all + tasks: + - ping: \ No newline at end of file diff --git a/playbooks/send-mail.yaml b/playbooks/send-mail.yaml new file mode 100644 index 0000000..64aad1e --- /dev/null +++ b/playbooks/send-mail.yaml @@ -0,0 +1,7 @@ +- hosts: localhost + become: no + become_method: sudo + tasks: + - name: Send mail + import_role: + name: config-send-mail diff --git a/playbooks/test.yaml b/playbooks/test.yaml new file mode 100644 index 0000000..99e65fd --- /dev/null +++ b/playbooks/test.yaml @@ -0,0 +1,5 @@ +- hosts: all + tasks: + - name: Test role + import_role: + name: linux-fail2ban diff --git a/playbooks/windows-ping.yml b/playbooks/windows-ping.yml new file mode 100644 index 0000000..2a141f4 --- /dev/null +++ b/playbooks/windows-ping.yml @@ -0,0 +1,5 @@ +- name: Ping Windows hosts + hosts: windows + tasks: + - name: Ping Windows hosts + ansible.windows.win_ping: \ No newline at end of file diff --git a/windows-update_windows.yaml b/playbooks/windows-update.yaml similarity index 66% rename from windows-update_windows.yaml rename to playbooks/windows-update.yaml index 3fe6c9b..301bf77 100644 --- a/windows-update_windows.yaml +++ b/playbooks/windows-update.yaml @@ -2,14 +2,12 @@ ignore_unreachable: yes serial: 1 tasks: - # Check if there are missing updates - block: - - name: Check for missing updates. + - name: Check if there are missing updates win_updates: state=searched register: update_count - #Install missing updates only if at least one is missing - block: - - name: Install missing updates. + - name: Install missing updates only if at least one is missing win_updates: category_names: '*' #- Application @@ -23,8 +21,8 @@ #- UpdateRollups #- CriticalUpdates #- SecurityUpdates - log_path: C:\Win_Template_Patch.log - register: update_result + log_path: C:\Win_Template_Patch.log + register: update_result - name: Reboot, if needed. win_reboot: when: update_result.reboot_required diff --git a/roles/awx/files/awx b/roles/awx/files/awx new file mode 100644 index 0000000..7070021 --- /dev/null +++ b/roles/awx/files/awx @@ -0,0 +1 @@ +awx-user ALL=(ALL) NOPASSWD:ALL diff --git a/roles/awx/tasks/main.yaml b/roles/awx/tasks/main.yaml new file mode 100644 index 0000000..9ccdbe0 --- /dev/null +++ b/roles/awx/tasks/main.yaml @@ -0,0 +1,23 @@ +- name: Create AWX user + user: + name: awx-user + password: '*' + shell: /bin/bash + groups: sudo + state: present + comment: ssh user +- name: Adding SSH public key + authorized_key: + user: awx-user + key: "{{ awx_pub_key }}" +- name: Install sudo package + apt: + name: sudo + state: present +- name: Add user to sudoers + copy: + src: awx + dest: /etc/sudoers.d/ + mode: u=rw,g=r + owner: root + group: root diff --git a/roles/awx/vars/main.yaml b/roles/awx/vars/main.yaml new file mode 100644 index 0000000..b8d6bad --- /dev/null +++ b/roles/awx/vars/main.yaml @@ -0,0 +1 @@ +awx_pub_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDjeIZVyppFK/dqOUa1PxgSeRVWk7MFmANYvSs+VHHnD4/BE//K8AxlxnyLl4e6jAcBFoIu1JLxbRKdOhx+Zgkq5OmEzp/XKzfEvnEU5CP+W2+5MwfkUQ3TetJsOoHiP/qYWPqqqfDFqNM1xs9am5Frv9BVu5pFiSO9oS14xVAlUOwnONQnRtAbuBOmMldpzxmuFY+Rs3G2MmokcOYrs5Z3TdCOG9bDGg8erzWklLW+aRYdXqMEZpwIZPcOFy6JXEyZ/9IpCLBN58IMr0RypFbgWb2Vo05iTI5j99Pzn//FgAhe6BXRyHSGOJ29hmKugt9sIY1N/H6aYqtTVR5EEIngY1XHtFywU1+qtYHMs8PB9Hl87zUkla0+S5Zn8q92y7DQFsOZ9ND6syEzWhiCP1ic3Wo76TVbuNoTW/XvgZnemx1epuOqDj9S7iGTSHMvvSop8z5hU2EQiVkgRPl4cM2fi0vF513ivq5IbCgg2VfXUOLM5E5y0TI7lzBriTtCuIk= awx@awx.verdnatura.es diff --git a/roles/config-autofs-homes/handlers/main.yaml b/roles/config-autofs-homes/handlers/main.yaml deleted file mode 100644 index 14d5537..0000000 --- a/roles/config-autofs-homes/handlers/main.yaml +++ /dev/null @@ -1,13 +0,0 @@ ---- - -# restart nslcd service to apply changes -- name: restart nslcd - service: - name: "{{ nslcd_daemon }}" - state: restarted - -# restart autofs service to apply changes -- name: restart autofs - service: - name: "{{ autofs_daemon }}" - state: restarted \ No newline at end of file diff --git a/roles/config-autofs-homes/tasks/main.yaml b/roles/config-autofs-homes/tasks/main.yaml deleted file mode 100644 index f6a35f2..0000000 --- a/roles/config-autofs-homes/tasks/main.yaml +++ /dev/null @@ -1,70 +0,0 @@ ---- - -- name: "[CONFIG AUTOFS HOMES] Comprobando si es necesario configurar AUTOFS HOMES" - meta: end_host - when: autofs_homes_enabled is not defined or not autofs_homes_enabled - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# install packages nfs-common , autofs , libnfs-utils , autofs-ldap -- name: install packages for autofs - apt: - name: "{{ item }}" - state: present - with_items: - - nfs-common - - autofs - - libnfs-utils - - autofs-ldap -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# create directory /mnt/homes for mount -- name: create directory /mnt/homes - ansible.builtin.file: - path: "{{ path_mnt_homes }}" - state: directory - mode: '0755' -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# add line to /etc/nsswitch.conf -- name: add line to file /etc/nsswitch.conf - lineinfile: - path: "{{ path_nsswitch }}" - line: "automount: files" - notify: restart nslcd -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# add files configured to autofs -# paso 1 -- name: add file homes.autofs configured to autofs - copy: - src: homes.autofs - dest: "{{ path_home_autofs }}" - owner: root - group: root - mode: '0644' -# paso 2 -- name: add file /etc/auto.homes configured to the systemd - copy: - src: auto.homes - dest: "{{ path_auto_homes }}" - owner: root - group: root - mode: '0644' - notify: restart autofs -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# enabled autofs -- name: service should start on boot - service: - name: "{{ autofs_daemon }}" - enabled: yes -# enabled nslcd -- name: service should start on boot - service: - name: "{{ nslcd_daemon }}" - enabled: yes -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \ No newline at end of file diff --git a/roles/config-autofs-homes/vars/main.yaml b/roles/config-autofs-homes/vars/main.yaml deleted file mode 100644 index 26768e7..0000000 --- a/roles/config-autofs-homes/vars/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ ---- -nslcd_daemon: nslcd -autofs_daemon: autofs -path_auto_homes: /etc/auto.homes -path_home_autofs: /etc/auto.master.d/homes.autofs -path_nsswitch: /etc/nsswitch.conf -path_mnt_homes: /mnt/homes \ No newline at end of file diff --git a/roles/config-awx-user/tasks/main.yaml b/roles/config-awx-user/tasks/main.yaml deleted file mode 100644 index 5812a8f..0000000 --- a/roles/config-awx-user/tasks/main.yaml +++ /dev/null @@ -1,46 +0,0 @@ ---- - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# create user awx-user on debian os -- name: Create a ssh user awx-user in the system - user: - name: awx-user - password: '*' - shell: /bin/bash - groups: sudo - state: present - comment: ssh user -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# add ssh-key pub to user awx-user -- name: Adding ssh-pub-key to user awx-user - authorized_key: - user: awx-user - key: "{{ key_to_add }}" -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# install sudo package -- name: Install sudo package - apt: - name: sudo - state: present -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# add awx-user to sudoers -- name: Add awx-user to sudoers - file: - path: /etc/sudoers.d/awx-user - state: touch - mode: u=rw,g=r,o=r -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# add a line to /etc/sudoers.d/awx-user file -- name: add a line to /etc/sudoers.d/awx-user file - lineinfile: - path: /etc/sudoers.d/awx-user - line: awx-user ALL=(ALL) NOPASSWD:ALL -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \ No newline at end of file diff --git a/roles/config-awx-user/vars/main.yaml b/roles/config-awx-user/vars/main.yaml deleted file mode 100644 index 89acff0..0000000 --- a/roles/config-awx-user/vars/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ -# variables -key_to_add: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDjeIZVyppFK/dqOUa1PxgSeRVWk7MFmANYvSs+VHHnD4/BE//K8AxlxnyLl4e6jAcBFoIu1JLxbRKdOhx+Zgkq5OmEzp/XKzfEvnEU5CP+W2+5MwfkUQ3TetJsOoHiP/qYWPqqqfDFqNM1xs9am5Frv9BVu5pFiSO9oS14xVAlUOwnONQnRtAbuBOmMldpzxmuFY+Rs3G2MmokcOYrs5Z3TdCOG9bDGg8erzWklLW+aRYdXqMEZpwIZPcOFy6JXEyZ/9IpCLBN58IMr0RypFbgWb2Vo05iTI5j99Pzn//FgAhe6BXRyHSGOJ29hmKugt9sIY1N/H6aYqtTVR5EEIngY1XHtFywU1+qtYHMs8PB9Hl87zUkla0+S5Zn8q92y7DQFsOZ9ND6syEzWhiCP1ic3Wo76TVbuNoTW/XvgZnemx1epuOqDj9S7iGTSHMvvSop8z5hU2EQiVkgRPl4cM2fi0vF513ivq5IbCgg2VfXUOLM5E5y0TI7lzBriTtCuIk= awx@awx.verdnatura.es \ No newline at end of file diff --git a/roles/config-centralized-auth/handlers/main.yaml b/roles/config-centralized-auth/handlers/main.yaml deleted file mode 100644 index 6a83f82..0000000 --- a/roles/config-centralized-auth/handlers/main.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -# restart nslcd service to apply changes -- name: restart nslcd - service: - name: "{{ nslcd_daemon }}" - state: restarted \ No newline at end of file diff --git a/roles/config-centralized-auth/tasks/main.yaml b/roles/config-centralized-auth/tasks/main.yaml deleted file mode 100644 index a866766..0000000 --- a/roles/config-centralized-auth/tasks/main.yaml +++ /dev/null @@ -1,52 +0,0 @@ - -- name: "[CONFIG CENTRALIZED AUTH] Comprobando si es necesario configurar centralized auth" - meta: end_host - when: centralized_auth_enabled is not defined or not centralized_auth_enabled - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# configure centralized authentication [nslcd] -# paso1 - Copy -- name: copy file nslcd.conf - copy: - src: nslcd.conf - dest: /etc/nslcd.conf - owner: root - group: nslcd - mode: '0640' - backup: yes -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# paso2 - lineinfile password with vault -- name: add password with ansible vault to file nslcd.conf - lineinfile: - dest: /etc/nslcd.conf - regexp: "{{item.regexp}}" - line: "{{item.line}}" - state: present - with_items: - - regexp: "^bindpw" - line: "bindpw {{ bindpw_password }}" -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# paso3 - editar lineas fichero /etc/nsswitch.conf -- name: edit file /etc/nsswitch.conf - lineinfile: - dest: /etc/nsswitch.conf - regexp: "{{item.regexp}}" - line: "{{item.line}}" - state: present - with_items: - - regexp: "^passwd:" - line: "passwd: files systemd ldap" - - regexp: "^group:" - line: "group: files systemd ldap" -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# paso4 - reconfigure PAM to use LDAP -- name: reconfigure PAM to use LDAP - shell: pam-auth-update --enable ldap - notify: restart nslcd -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# service should start on boot. -- name: service should start on boot - service: - name: "{{ nslcd_daemon }}" - enabled: yes -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \ No newline at end of file diff --git a/roles/config-fail2ban/handlers/main.yaml b/roles/config-fail2ban/handlers/main.yaml deleted file mode 100644 index 171e080..0000000 --- a/roles/config-fail2ban/handlers/main.yaml +++ /dev/null @@ -1,10 +0,0 @@ -# restart fail2ban service to apply changes -- name: restart fail2ban - service: - name: "{{ fail2ban_daemon }}" - state: restarted -# restart nftables service -- name: restart nftables - service: - name: "{{ nftables_daemon }}" - state: restarted \ No newline at end of file diff --git a/roles/config-fail2ban/tasks/main.yaml b/roles/config-fail2ban/tasks/main.yaml deleted file mode 100644 index d0a5b0c..0000000 --- a/roles/config-fail2ban/tasks/main.yaml +++ /dev/null @@ -1,49 +0,0 @@ -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# Install and configure FAIL2BAN -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -- name: "[CONFIG FAIL2BAN] Comprobando si es necesario configurar fail2ban" - meta: end_host - when: fail2ban_enabled is not defined or not fail2ban_enabled - -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# comprobe if fail2ban is installed if not then install fail2ban -# Gather the package facts -# - name: Gather the package facts -# package_facts: -# manager: auto -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# install packages if is not in the system -- name: install fail2ban package if is not in the system - apt: - name: fail2ban - state: present -# when: "'fail2ban' not in ansible_facts.packages" # ansible comprobes if is ok its installed -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# configure fail2ban -# template a file to /etc/fail2ban/jail.local -- name: template a file to /etc/fail2ban/jail.local - template: - src: jail2.j2 - dest: "{{ path_jail_local }}" - owner: root - group: root - mode: '0644' - backup: true - notify: restart fail2ban -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# service fail2ban should start on boot. -- name: service should start on boot - service: - name: "{{ fail2ban_daemon }}" - enabled: yes -# service nftables should start on boot. -- name: service nftables should start on boot - service: - name: "{{ nftables_daemon }}" - enabled: true - notify: restart nftables -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/roles/config-fail2ban/templates/jail.j2 b/roles/config-fail2ban/templates/jail.j2 deleted file mode 100644 index 69a8295..0000000 --- a/roles/config-fail2ban/templates/jail.j2 +++ /dev/null @@ -1,38 +0,0 @@ - -#+++++++++++++++++++++++++++++++++++++ -# PLS , DONT EDIT THIS FILE , THIS FILE IS DEPLOYER WITH ANSIBLE TEMPLATES , IF U WANT SOME CHANGES OR ADD NEW POLICIES -# EDIT THE FILE config-fail2ban.yaml IN GITEA REPO vn-ansible > linux > base-config-debian , AND ADD MORE VARS -#+++++++++++++++++++++++++++++++++++++ - -#+++++++++++++++++++++++++++++++++++++ -[DEFAULT] -# Add any default configuration options here -bantime = {{ bantime }} -maxretry = {{ maxretry }} -findtime = {{ findtime }} -destemail = sysadmin@verdnatura.es -sender = root@{{ ansible_nodename }}.verdnatura.es -banaction = nftables-multiport -banaction_allports = nftables-allports -action = %(action_mwl)s -#+++++++++++++++++++++++++++++++++++++ - -# 31536000 ; year -# 18144000 ; 30days -# 604800 ; 1 week -# 86400 ; 1 day -# 3600 ; 1 hour - -{% for jail in jails %} -#+++++++++++++++++++++++++++++++++++++ -[{{ jail.name }}] -enabled = {{ jail.enabled }} -filter = {{ jail.filter }} -logpath = {{ jail.logpath }} -port = {{ jail.port | join(' ') }} -maxretry = {{ jail.maxretry }} -bantime = {{ jail.bantime }} -findtime = {{ jail.findtime }} -action = {{ jail.action }} -{% endfor %} -#+++++++++++++++++++++++++++++++++++++ diff --git a/roles/config-fail2ban/templates/jail2.j2 b/roles/config-fail2ban/templates/jail2.j2 deleted file mode 100644 index 44aac55..0000000 --- a/roles/config-fail2ban/templates/jail2.j2 +++ /dev/null @@ -1,91 +0,0 @@ -#+++++++++++++++++++++++++++++++++++++ -# PLS , DONT EDIT THIS FILE , THIS FILE IS DEPLOYER WITH ANSIBLE TEMPLATES , IF U WANT SOME CHANGES OR ADD NEW POLICIES -# EDIT THE FILE config-fail2ban.yaml IN GITEA REPO vn-ansible > linux > base-config-debian , AND ADD MORE VARS -#+++++++++++++++++++++++++++++++++++++ - -# Custom fail2ban conf - -#+++++++++++++++++++++++++++++++++++++ - -# 31536000 ; year -# 18144000 ; 30days -# 604800 ; 1 week -# 86400 ; 1 day -# 3600 ; 1 hour - -#+++++++++++++++++++++++++++++++++++++ - -[INCLUDES] - -# -# INCLUDES -# - -before = paths-debian.conf - -#+++++++++++++++++++++++++++++++++++++ - -# The DEFAULT allows a global definition of the options. They can be overridden -# in each jail afterwards. - -[DEFAULT] - -# -# OPTIONS CONF DEFAULT -# - -# ignorecommand = -{% if fail2ban_times is defined %} -{% for time in fail2ban_times %} -bantime = {{ time.bantime | default('604800')}} -findtime = {{ time.findtime | default('604800')}} -maxretry = {{ time.maxretry | default('4')}} -{% endfor %} -{% endif %} -maxmatches = %(maxretry)s -backend = auto -usedns = warn -logencoding = auto -enabled = false -mode = normal -filter = %(__name__)s[mode=%(mode)s] -destemail = sysadmin@verdnatura.es -sender = root@ -mta = mail -protocol = tcp -chain = -port = 0:65535 -fail2ban_agent = Fail2Ban/%(fail2ban_version)s -banaction = nftables-multiport -banaction_allports = nftables-allports -action_ = %(banaction)s[port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"] -action_mw = %(action_)s - %(mta)s-whois[sender="%(sender)s", dest="%(destemail)s", protocol="%(protocol)s", chain="%(chain)s"] -action_mwl = %(action_)s - %(mta)s-whois-lines[sender="%(sender)s", dest="%(destemail)s", logpath="%(logpath)s", chain="%(chain)s"] -action_xarf = %(action_)s - xarf-login-attack[service=%(__name__)s, sender="%(sender)s", logpath="%(logpath)s", port="%(port)s"] -action_cf_mwl = cloudflare[cfuser="%(cfemail)s", cftoken="%(cfapikey)s"] - %(mta)s-whois-lines[sender="%(sender)s", dest="%(destemail)s", logpath="%(logpath)s", chain="%(chain)s"] -action_blocklist_de = blocklist_de[email="%(sender)s", service="%(__name__)s", apikey="%(blocklist_de_apikey)s", agent="%(fail2ban_agent)s"] -action_abuseipdb = abuseipdb -action = %(action_mwl)s - -#+++++++++++++++++++++++++++++++++++++ - -# -# JAILS -# - -{% if fail2ban_jails is defined %} -{% for jail in fail2ban_jails %} -#+++++++++++++++++++++++++++++++++++++ -[{{ jail.name }}] -enabled = {{ jail.enabled }} -port = {{ jail.port | join(' ') }} -filter = {{ jail.filter }} -logpath = {{ jail.logpath }} -backend = {{ jail.backend }} -{% endfor %} -{% endif %} -#+++++++++++++++++++++++++++++++++++++ diff --git a/roles/config-fail2ban/vars/main.yaml b/roles/config-fail2ban/vars/main.yaml deleted file mode 100644 index 4fae26c..0000000 --- a/roles/config-fail2ban/vars/main.yaml +++ /dev/null @@ -1,5 +0,0 @@ ---- -# vars file -path_jail_local: /etc/fail2ban/jail.local -fail2ban_daemon: fail2ban -nftables_daemon: nftables \ No newline at end of file diff --git a/roles/config-hostname/tasks/main.yaml b/roles/config-hostname/tasks/main.yaml deleted file mode 100644 index 5b9e277..0000000 --- a/roles/config-hostname/tasks/main.yaml +++ /dev/null @@ -1,18 +0,0 @@ -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# Configure HOSTNAME and HOSTS with new HOSTNAME -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -- name: "[CONFIG HOSTNAME] Comprobando si es necesario configurar hostname " - meta: end_host - when: hostname_enabled is not defined or not hostname_enabled - -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# Configure HOSTNAME /etc/hostname -- name: Set a hostname specifying strategy in /etc/hostname - ansible.builtin.hostname: - name: "{{ hostname }}" - use: debian -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# https://docs.ansible.com/ansible/latest/collections/ansible/builtin/hostname_module.html#ansible-collections-ansible-builtin-hostname-module -# https://docs.ansible.com/ansible/latest/collections/ansible/builtin/replace_module.html#ansible-collections-ansible-builtin-replace-module -# https://docs.ansible.com/ansible/latest/collections/ansible/builtin/lineinfile_module.html#ansible-collections-ansible-builtin-lineinfile-module diff --git a/roles/config-hosts/tasks/main.yaml b/roles/config-hosts/tasks/main.yaml deleted file mode 100644 index be4c05b..0000000 --- a/roles/config-hosts/tasks/main.yaml +++ /dev/null @@ -1,15 +0,0 @@ - -- name: "[CONFIG HOSTS FILE] Comprobando si es necesario configurar hosts file " - meta: end_host - when: hosts_enabled is not defined or not hosts_enabled - -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- name: Replace old /etc/hosts with new /etc/hosts - template: - src: hosts.j2 - dest: "{{ path_hosts }}" - owner: root - group: root - mode: '0644' - backup: true -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/roles/config-hosts/vars/main.yaml b/roles/config-hosts/vars/main.yaml deleted file mode 100644 index cb9dd71..0000000 --- a/roles/config-hosts/vars/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -# vars file -path_hosts: /etc/hosts \ No newline at end of file diff --git a/roles/config-hot-plug/tasks/main.yaml b/roles/config-hot-plug/tasks/main.yaml deleted file mode 100644 index 2a249d7..0000000 --- a/roles/config-hot-plug/tasks/main.yaml +++ /dev/null @@ -1,35 +0,0 @@ - -- name: "[CONFIG HOT PLUG] Comprobando si es necesario configurar hot plug" - meta: end_host - when: hot_plug_enabled is not defined or not hot_plug_enabled - -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# Install and configure HOT-PLUG -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# configure /usr/lib/udev/rules.d/80-hotplug-cpu-mem.rules -- name: configure /usr/lib/udev/rules.d/80-hotplug-cpu-mem.rules file - template: - src: udev.j2 - dest: "{{ path_hot_plug_udev }}" - owner: root - group: root - mode: '0644' -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# configure /etc/default/grub.d/hotplug.cfg -- name: configure /etc/default/grub.d/hotplug.cfg file - template: - src: grub.j2 - dest: "{{ path_hot_plug_grub }}" - owner: root - group: root - mode: '0644' -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- name: Execute the command update-grub in remote shell - ansible.builtin.shell: update-grub -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/roles/config-hot-plug/templates/grub.j2 b/roles/config-hot-plug/templates/grub.j2 deleted file mode 100644 index 897c720..0000000 --- a/roles/config-hot-plug/templates/grub.j2 +++ /dev/null @@ -1 +0,0 @@ -{{ line_hot_plug_grub }} diff --git a/roles/config-hot-plug/templates/udev.j2 b/roles/config-hot-plug/templates/udev.j2 deleted file mode 100644 index 71cd77d..0000000 --- a/roles/config-hot-plug/templates/udev.j2 +++ /dev/null @@ -1 +0,0 @@ -{{ line_hot_plug_udev }} diff --git a/roles/config-hot-plug/vars/main.yaml b/roles/config-hot-plug/vars/main.yaml deleted file mode 100644 index 82e527d..0000000 --- a/roles/config-hot-plug/vars/main.yaml +++ /dev/null @@ -1,5 +0,0 @@ -# vars file -path_hot_plug_udev: /usr/lib/udev/rules.d/80-hotplug-cpu-mem.rules -line_hot_plug_udev: 'SUBSYSTEM=="cpu", ACTION=="add", TEST=="online", ATTR{online}=="0", ATTR{online}="1"' -path_hot_plug_grub: /etc/default/grub.d/hotplug.cfg -line_hot_plug_grub: 'GRUB_CMDLINE_LINUX_DEFAULT="quiet memhp_default_state=online security=none"' diff --git a/roles/config-install-packages/tasks/main.yaml b/roles/config-install-packages/tasks/main.yaml deleted file mode 100644 index 7bce21e..0000000 --- a/roles/config-install-packages/tasks/main.yaml +++ /dev/null @@ -1,31 +0,0 @@ -- name: "[CONFIG INSTALL PACKAGES] Comprobando si es necesario instalar paqueteria" - meta: end_host - when: packages_enabled is not defined or not packages_enabled - -# install packages -- name: install some packages - apt: - name: "{{ item }}" - state: present - with_items: - - vim - - htop - - psmisc - - aptitude - - ncat - - nslcd - - exim4 - - usrmerge - - figlet - - rsyslog -# - iptables - - mlocate - - bind9-dnsutils - - task-spanish - - locales-all - - tree - - ncdu - - cloud-guest-utils - - net-tools - - curl - - btop diff --git a/roles/config-locales/files/set_locales.sh b/roles/config-locales/files/set_locales.sh deleted file mode 100644 index ce3df38..0000000 --- a/roles/config-locales/files/set_locales.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -echo -e "es_ES.UTF-8 UTF-8\nen_US.UTF-8 UTF-8" > /etc/locale.gen -locale-gen -update-locale LANG=en_US.UTF-8 \ No newline at end of file diff --git a/roles/config-locales/tasks/main.yaml b/roles/config-locales/tasks/main.yaml deleted file mode 100644 index 1ac5675..0000000 --- a/roles/config-locales/tasks/main.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- - -- name: "[CONFIG LOCALES] Comprobando si es necesario configurar locales" - meta: end_host - when: locales_enabled is not defined or not locales_enabled - -- name: execute script set_locales.sh - script: set_locales.sh \ No newline at end of file diff --git a/roles/config-motd/files/mymotd.sh b/roles/config-motd/files/mymotd.sh deleted file mode 100644 index f2693f2..0000000 --- a/roles/config-motd/files/mymotd.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/bash -GREEN="\033[0;32m" -WHITE="\033[0;37m" -RED='\033[0;31m' -RESET="\033[0m" -#LAST_LOGIN_USER=$(lastlog | tail -n 1 | awk '{print $1}') -LAST_LOGIN_USER=$(last |head -n +2 | tail -n 1 | awk '{ print $1 }') -#LAST_LOGIN_TIME_HOUR=$(lastlog | tail -n 1 | awk '{print $4" "$5" "$6" "$7}') -LAST_LOGIN_TIME_HOUR=$(last |head -n +2 | tail -n 1 | awk '{ print $4" "$5" "$6" "$7" "$8" "$9 }') -#LAST_LOGIN_IP_FROM_USER=$(lastlog | tail -n 1 | awk '{print $3}') -LAST_LOGIN_IP_FROM_USER=$(last |head -n +2 | tail -n 1 | awk '{ print $3 }') -UPTIME_SYSTEM=$(uptime -p | tr -d ',') -NUMBER_USERS_CONNECTED=$(uptime | awk '{print $5" "$6}' | tr -d ",") -LIST_USERS_CONNECTED=$(w | tail -n +2) -KERNEL=$(uname -r) -PACKAGES=$(dpkg -l | tail -n +6 | wc -l) -SHELL=$(dpkg -l | grep bash | head -n 1 | awk '{ print $2 }') -BASH_VERSION_NUMBER=$(echo $BASH_VERSION | cut -c -6) -IP_LIST=$(for i in $(ip a | grep inet | grep -v "::" | awk {'print $2'}); do echo -e "ip -> $i"; done) -source /etc/os-release -echo -e "****************************************************************************" -echo -e "${WHITE} _${RESET}" -echo -e "${WHITE} | |${RESET}${GREEN} _${RESET}" -echo -e "${WHITE} _ _ ____ ____ _ | |${RESET}${GREEN} ____ ____| |_ _ _ ____ ____${RESET}" -echo -e "${WHITE}| | | / _ )/ ___) || |${RESET}${GREEN}| _ \ / _ | _) | | |/ ___) _ |${RESET}" -echo -e "${WHITE} \ V ( (/ /| | ( (_| |${RESET}${GREEN}| | | ( ( | | |_| |_| | | ( ( | |${RESET}" -echo -e "${WHITE} \_/ \____)_| \____|${RESET}${GREEN}|_| |_|\_||_|\___)____|_| \_||_|${RESET}" -echo -e "" -echo -e "${RED}Host:${RESET} $HOSTNAME" -echo -e "${RED}OS:${RESET} $PRETTY_NAME" -echo -e "${RED}IP:${RESET}\n$IP_LIST" -echo -e "${RED}Kernel:${RESET} $KERNEL" -echo -e "${RED}Packages:${RESET} $PACKAGES" -echo -e "${RED}Shell:${RESET} $SHELL $BASH_VERSION_NUMBER" -echo -e "${RED}Last Login:${RESET}\nUser -> $LAST_LOGIN_USER\nTime -> $LAST_LOGIN_TIME_HOUR\nIP -> $LAST_LOGIN_IP_FROM_USER" -echo -e "${RED}Uptime system:${RESET}\n$UPTIME_SYSTEM" -#echo -e "${RED}Number of Users connected to the system:${RESET}\n$NUMBER_USERS_CONNECTED" -echo -e "${RED}Users connected to the system:${RESET}\n$LIST_USERS_CONNECTED" -echo -e "" -echo -e "****************************************************************************" diff --git a/roles/config-motd/tasks/main.yaml b/roles/config-motd/tasks/main.yaml deleted file mode 100644 index 2a0067b..0000000 --- a/roles/config-motd/tasks/main.yaml +++ /dev/null @@ -1,9 +0,0 @@ -# Add message to MOTD -- name: add motd message - copy: - src: 90-vn - dest: "{{ path_motd_path }}" - mode: '755' - owner: root - group: root -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/roles/config-motd/vars/main.yaml b/roles/config-motd/vars/main.yaml deleted file mode 100644 index 0adf9d1..0000000 --- a/roles/config-motd/vars/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -path_motd_path: /etc/update-motd.d/ \ No newline at end of file diff --git a/roles/config-nagios-nrpe/files/90-vn.cfg b/roles/config-nagios-nrpe/files/90-vn.cfg deleted file mode 100644 index 9ffab3e..0000000 --- a/roles/config-nagios-nrpe/files/90-vn.cfg +++ /dev/null @@ -1,11 +0,0 @@ -allowed_hosts=nagios.verdnatura.es - -command[check_disk_root]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p / -command[check_disk_var]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /var -command[check_disk_usr]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /usr -command[check_disk_home]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /home -command[check_disk_tmp]=/usr/lib/nagios/plugins/check_disk -w 20% -c 10% -p /tmp -command[check_dummy]=/usr/lib/nagios/plugins/check_dummy 0 -command[check_swap]=/usr/lib/nagios/plugins/check_swap -w 40% -c 20% -command[check_load]=/usr/lib/nagios/plugins/check_load -r -w 3.5,3.25,3 -c 4.5,4.25,4 -command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 400 -c 500 diff --git a/roles/config-nagios-nrpe/handlers/main.yaml b/roles/config-nagios-nrpe/handlers/main.yaml deleted file mode 100644 index 1547691..0000000 --- a/roles/config-nagios-nrpe/handlers/main.yaml +++ /dev/null @@ -1,5 +0,0 @@ -# restart nagios-nrpe service to apply changes -- name: restart nagios-nrpe - service: - name: "{{ nagios_nrpe_daemon }}" - state: restarted \ No newline at end of file diff --git a/roles/config-nagios-nrpe/tasks/main.yaml b/roles/config-nagios-nrpe/tasks/main.yaml deleted file mode 100644 index 38b71dd..0000000 --- a/roles/config-nagios-nrpe/tasks/main.yaml +++ /dev/null @@ -1,45 +0,0 @@ -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# Install and configure NAGIOS-NRPE -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -#- name: "[CONFIG NAGIOS NRPE] Comprobando si es necesario configurar nagios nrpe service " -# meta: end_host -# when: nagios_nrpe_enabled is not defined or not nagios_nrpe_enabled - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# paso1 -# install packages for nagios-nrpe -- name: Install packages for nagios-nrpe (nagios-nrpe-server, nagios-nrpe-plugin) - apt: - name: "{{ item }}" - state: present - loop: - - nagios-nrpe-server - - nagios-nrpe-plugin -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# paso2 -# copy file 90-vn.cfg to /etc/nagios/nrpe.d/ -- name: copy file 90-vn.cfg to /etc/nagios/nrpe.d/ - copy: - src: 90-vn.cfg - dest: /etc/nagios/nrpe.d/90-vn.cfg - owner: root - group: root - mode: '0644' -# backup: yes # NO BACKUPS -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# paso3 -# create file 99-local.cfg to /etc/nagios/nrpe.d/ -- name: create 99-local.cfg to /etc/nagios/nrpe.d/ - file: - path: "{{ local_path }}" - state: touch - mode: '0644' - notify: restart nagios-nrpe -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# service should start on boot. -- name: service should start on boot - service: - name: "{{ nagios_nrpe_daemon }}" - enabled: yes -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \ No newline at end of file diff --git a/roles/config-nagios-nrpe/vars/main.yaml b/roles/config-nagios-nrpe/vars/main.yaml deleted file mode 100644 index e59530e..0000000 --- a/roles/config-nagios-nrpe/vars/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ -# vars file -local_path: /etc/nagios/nrpe.d/99-local.cfg -nagios_nrpe_daemon: nagios-nrpe-server \ No newline at end of file diff --git a/roles/config-nsupdate/meta/main.yaml b/roles/config-nsupdate/meta/main.yaml deleted file mode 100644 index feddb6a..0000000 --- a/roles/config-nsupdate/meta/main.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -# myrole/meta/main.yml -collections: - - community.general \ No newline at end of file diff --git a/roles/config-nsupdate/tasks/main.yaml b/roles/config-nsupdate/tasks/main.yaml deleted file mode 100644 index 4dd3190..0000000 --- a/roles/config-nsupdate/tasks/main.yaml +++ /dev/null @@ -1,19 +0,0 @@ -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# Configure zones on bind9 with NSUPDATE -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# Add and update DNS records on bind9 with NSUPDATE -- name: Add or modify DNS records A to some IP - community.general.nsupdate: - key_name: "rndc-key" - key_secret: "{{ bind9secretkey_password }}" - key_algorithm: "hmac-md5" - server: "ns1.verdnatura.es" - zone: "{{ zone_record }}" - record: "{{ name_record }}" - ttl: "{{ ttl_record }}" - type: "{{ type_record }}" - value: "{{ value_record }}" - state: "{{ state_record }}" -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/roles/config-ntp/tasks/main.yaml b/roles/config-ntp/tasks/main.yaml deleted file mode 100644 index 12a74d1..0000000 --- a/roles/config-ntp/tasks/main.yaml +++ /dev/null @@ -1,53 +0,0 @@ -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# Install and configure NTP -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -- name: "[CONFIG NTP] Comprobando si es necesario configurar ntp" - meta: end_host - when: ntp_enabled is not defined or not ntp_enabled - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# SE OMITE , SE REALIZA CON systemd-timesyncd.service -# paso1 -# install package ntpdate -#- name: install package ntpdate -# apt: -# name: "{{ ntpdate_package }}" -# state: present -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# paso2 -# copy timesync file to crontab.hourly -#- name: copy file timesync to /etc/cron.hourly/timesync -# copy: -# src: timesync -# dest: "{{ timesync_path }}" -# owner: root -# group: root -# mode: '0644' -# backup: yes # NO backups -# notify: restart crontab hourly -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -# retocar fichero /etc/systemd/timesyncd.conf -- name: retocar fichero /etc/systemd/timesyncd.conf - lineinfile: - path: /etc/systemd/timesyncd.conf - regexp: '^#NTP' - line: "NTP=time1.verdnatura.es time2.verdnatura.es" - owner: root - group: root - mode: '0644' -- name: retocar fichero /etc/systemd/timesyncd.conf - lineinfile: - path: /etc/systemd/timesyncd.conf - regexp: '^#?FallbackNTP=' - line: "FallbackNTP=ntp.roa.es" - owner: root - group: root - mode: '0644' - notify: restart systemd-timesyncd -# service should start on boot. -- name: service should start on boot - service: - name: "{{ timesyncd_daemon }}" - enabled: yes \ No newline at end of file diff --git a/roles/config-ntp/vars/main.yaml b/roles/config-ntp/vars/main.yaml deleted file mode 100644 index 5b626b1..0000000 --- a/roles/config-ntp/vars/main.yaml +++ /dev/null @@ -1,4 +0,0 @@ -# vars file -ntpdate_package: ntpdate -timesync_path: /etc/cron.hourly/timesync -timesyncd_daemon: systemd-timesyncd \ No newline at end of file diff --git a/roles/config-relayhost-smtp/handlers/main.yaml b/roles/config-relayhost-smtp/handlers/main.yaml deleted file mode 100644 index c9f53d9..0000000 --- a/roles/config-relayhost-smtp/handlers/main.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- -# restart exim4 service to apply changes -- name: restart exim4 - service: - name: "{{ exim_daemon }}" - state: restarted \ No newline at end of file diff --git a/roles/config-repo-vn/tasks/main.yaml b/roles/config-repo-vn/tasks/main.yaml deleted file mode 100644 index e05543a..0000000 --- a/roles/config-repo-vn/tasks/main.yaml +++ /dev/null @@ -1,45 +0,0 @@ - -- name: "[CONFIG REPO VN] Comprobando si es necesario configurar repositorios" - meta: end_host - when: repo_vn_enabled is not defined or not repo_vn_enabled - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# SE OBVIA , ACTUALMENTE SE INSTALA PACKAGE DEB INSTALA gpg.key + REPOS -# descargar http://apt.verdnatura.es/pool/main/v/vn-host/vn-host_2.0.2_all.deb e instalar (manualmente wget + dpkg -i package) -# paso0 - añadir clave gpg -# paso1 - Add specified repository into sources list -#- name: Add specified repository into sources list -# apt_repository: -# repo: deb http://apt.verdnatura.es/ bookworm main -# state: present -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# paso2 - Add source repository into sources list -#- name: Add source repository into sources list -# apt_repository: -# repo: deb-src http://apt.verdnatura.es/ bookworm main -# state: present -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# Download deb package -- name: Download vn-host_2.0.2_all.deb package - get_url: - url: "{{ repo_url }}" - dest: "{{ path_package }}" - mode: '0644' -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# Install deb package -- name: Install a .deb package - apt: - deb: "{{ path_package }}" -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# Delete deb package file from tmp -- name: Delete deb package file from tmp - file: - path: "{{ path_package }}" - state: absent -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \ No newline at end of file diff --git a/roles/config-resolv/tasks/main.yaml b/roles/config-resolv/tasks/main.yaml deleted file mode 100644 index ff5ad0e..0000000 --- a/roles/config-resolv/tasks/main.yaml +++ /dev/null @@ -1,15 +0,0 @@ - -- name: "[CONFIG RESOLV FILE] Comprobando si es necesario configurar resolv file " - meta: end_host - when: resolv_enabled is not defined or not resolv_enabled - -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -- name: Replace old /etc/resolv.conf with new /etc/resolv.conf - template: - src: resolv.j2 - dest: "{{ path_resolv }}" - owner: root - group: root - mode: '0644' - backup: true -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/roles/config-resolv/templates/resolv.j2 b/roles/config-resolv/templates/resolv.j2 deleted file mode 100644 index 8eb2aee..0000000 --- a/roles/config-resolv/templates/resolv.j2 +++ /dev/null @@ -1,7 +0,0 @@ -domain {{ domain_name | default('verdnatura.es') }} -search {{ search_name | default('verdnatura.es') }} -{% if resolvs is defined %} -{% for resolv in resolvs %} -nameserver {{resolv.ip}} -{% endfor %} -{% endif %} \ No newline at end of file diff --git a/roles/config-resolv/vars/main.yaml b/roles/config-resolv/vars/main.yaml deleted file mode 100644 index 8e4edcf..0000000 --- a/roles/config-resolv/vars/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ ---- -# vars file -path_resolv: /etc/resolv.conf \ No newline at end of file diff --git a/roles/config-root-user/handlers/main.yaml b/roles/config-root-user/handlers/main.yaml deleted file mode 100644 index c80b75b..0000000 --- a/roles/config-root-user/handlers/main.yaml +++ /dev/null @@ -1,5 +0,0 @@ -# restart ssh service to apply changes -- name: Restart ssh service - service: - name: "{{ ssh_daemon }}" - state: restarted \ No newline at end of file diff --git a/roles/config-root-user/tasks/main.yaml b/roles/config-root-user/tasks/main.yaml deleted file mode 100644 index 6ad341d..0000000 --- a/roles/config-root-user/tasks/main.yaml +++ /dev/null @@ -1,103 +0,0 @@ ---- - -- name: "[CONFIG ROOT USER] Comprobando si es necesario configurar SSH root user" - meta: end_host - when: root_user_enabled is not defined or not root_user_enabled - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# delete default user , only on VM -- name: delete default user , only on VM - user: - name: "{{ name_user }}" - state: absent - remove: yes -# tags: -# - delete-user -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# change root password -- name: change root password - user: - name: root - password: "{{ ssh_password | password_hash('sha512') }}" -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# DISABLE to MAINTAIN AUTHORIZED KEYS FILE -# delete root ssh pub key in Authorized_keys -#- name: delete ssh pub key in /root/.ssh/authorized_keys -# file: -# path: "{{ root_authorized_keys }}" -# state: absent -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# config sshd_config file , no root password -#- name: change sshd_config to no root password -# lineinfile: -# path: "{{ path_sshd_config_file }}" -# regexp: "PermitRootLogin yes" -# line: "#PermitRootLogin prohibit-password" -# state: present -# notify: Restart ssh service -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# service should start on boot. -- name: service should start on boot - service: - name: "{{ ssh_daemon }}" - enabled: yes -#- name: change sshd_config to no root password -# copy: -# src: "{{ source_path_ssh }}" -# dest: "{{ dest_path_ssh }}" -# remote_src: yes -# owner: root -# group: root -# mode: '0644' -# delete file sshd_config.orig -#- name: delete /etc/ssh/sshd_config.orig file -# file: -# path: "{{ source_path_ssh }}" -# state: absent -# notify: Restart ssh service -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# changes .BASHRC file of root user -# step1 - uncomment lines -- name: uncomment this lines - lineinfile: - dest: "{{ path_bashrc_root }}" - regexp: "{{item.regexp}}" - line: "{{item.line}}" - state: present - with_items: - - regexp: "^# export LS_OPTIONS" - line: "{{ export_LS_OPTIONS }}" - - regexp: "^# eval" - line: "{{ eval_dircolors }}" - - regexp: "^# alias ls='ls $LS_OPTIONS'" - line: "{{ alias_ls }}" - - regexp: "^# alias ll='ls $LS_OPTIONS -l'" - line: "{{ alias_ll }}" - - regexp: "# alias la='ls $LS_OPTIONS -la'" - line: "{{ alias_la }}" -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# step2 - add block lines -- name: add block lines - blockinfile: - path: "{{ path_bashrc_root }}" - block: | - ### 4Loooong memories - HISTSIZE=10000 - HISTFILESIZE=20000 - ### 4security - TMOUT=3600 - ### write auto label - # If this is an xterm set the title to user@host:dir - case "$TERM" in - xterm*|rxvt*) - PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" - ;; - *) - ;; - esac - source /etc/profile.d/bash_completion.sh -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \ No newline at end of file diff --git a/roles/config-root-user/vars/main.yaml b/roles/config-root-user/vars/main.yaml deleted file mode 100644 index a06d938..0000000 --- a/roles/config-root-user/vars/main.yaml +++ /dev/null @@ -1,10 +0,0 @@ ---- -ssh_daemon: ssh -path_sshd_config_file: /etc/ssh/sshd_config -path_bashrc_root: /root/.bashrc -root_authorized_keys: /root/.ssh/authorized_keys -export_LS_OPTIONS: export LS_OPTIONS='--color=auto' -eval_dircolors: eval "$(dircolors)" -alias_ls: alias ls='ls $LS_OPTIONS' -alias_ll: alias ll='ls $LS_OPTIONS -l' -alias_la: alias la='ls $LS_OPTIONS -la' diff --git a/roles/config-secure-grub/handlers/main.yaml b/roles/config-secure-grub/handlers/main.yaml deleted file mode 100644 index 8a93e00..0000000 --- a/roles/config-secure-grub/handlers/main.yaml +++ /dev/null @@ -1,4 +0,0 @@ ---- -# update grub -- name: grub register - command: update-grub \ No newline at end of file diff --git a/roles/config-secure-grub/tasks/main.yaml b/roles/config-secure-grub/tasks/main.yaml deleted file mode 100644 index 3b832cd..0000000 --- a/roles/config-secure-grub/tasks/main.yaml +++ /dev/null @@ -1,18 +0,0 @@ - -- name: "[CONFIG SECURE GRUB] Comprobando si es necesario configurar secure grub" - meta: end_host - when: secure_grub_enabled is not defined or not secure_grub_enabled - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# Secure GRUB edition with password -# paso1 - Proteger grub -- name: GRUB password boot protection - blockinfile: - path: /etc/grub.d/40_custom - block: | - set superusers="{{ user_grub }}" - password_pbkdf2 {{ user_grub }} {{ code_grub }} - notify: grub register -# tags: -# - grub-password -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/roles/config-server-type/tasks/main.yaml b/roles/config-server-type/tasks/main.yaml deleted file mode 100644 index 30bb5f3..0000000 --- a/roles/config-server-type/tasks/main.yaml +++ /dev/null @@ -1,26 +0,0 @@ - -- name: "[CONFIG SERVER TYPE] Comprobando si es necesario instalar guest side" - meta: end_host - when: server_type_enabled is not defined or not server_type_enabled - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# paso1 - Install guest-side qemu-system agent -- name: Install guest-side qemu-system agent - apt: - name: "{{ qemu_guest_package }}" - state: present -# tags: -# - install-qemu-guest -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -# or - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# paso1 - Install open-vm-tools for VMware -#- name: Install open-vm-tools -# apt: -# name: "{{ vm_tools_package }}" -# state: present -# tags: -# - install-vmware-tools -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \ No newline at end of file diff --git a/roles/config-server-type/vars/main.yaml b/roles/config-server-type/vars/main.yaml deleted file mode 100644 index c082595..0000000 --- a/roles/config-server-type/vars/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ -# vars -qemu_guest_package: qemu-guest-agent -vm_tools_package: open-vm-tools \ No newline at end of file diff --git a/roles/config-sudoers/tasks/main.yaml b/roles/config-sudoers/tasks/main.yaml deleted file mode 100644 index 8714cc5..0000000 --- a/roles/config-sudoers/tasks/main.yaml +++ /dev/null @@ -1,20 +0,0 @@ - -- name: "[CONFIG SUDOERS] Comprobando si es necesario configurar sudoers" - meta: end_host - when: sudoers_enabled is not defined or not sudoers_enabled - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# configure sudo for sysadmin group -# paso1 - add sysadmin group to sudoers -- name: Add sysadmin group to sudoers - file: - path: /etc/sudoers.d/vn - state: touch - mode: u=rw,g=r,o=r -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# paso2 - add a line to /etc/sudoers.d/vn file -- name: add a line to /etc/sudoers.d/vn file - lineinfile: - path: "/etc/sudoers.d/vn" - line: "%sysadmin ALL=(ALL) NOPASSWD: ALL" -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/roles/config-tzdata/tasks/main.yaml b/roles/config-tzdata/tasks/main.yaml deleted file mode 100644 index b74162e..0000000 --- a/roles/config-tzdata/tasks/main.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- - -- name: "[CONFIG TZDATA] Comprobando si es necesario configurar timezone" - meta: end_host - when: tzdata_enabled is not defined or not tzdata_enabled - -#- name: copy script set_timezone.sh to tmp -# copy: -# src: set_timezone.sh -# dest: /tmp/set_timezone.sh -# owner: root -# group: root -# mode: '0744' - -- name: execute script set_timezone.sh - script: set_timezone.sh - -#- name: delete script set_timezone.sh on tmp directory -# file: -# path: /tmp/set_timezone.sh -# state: absent \ No newline at end of file diff --git a/roles/config-update-and-upgrade-packages/tasks/main.yaml b/roles/config-update-and-upgrade-packages/tasks/main.yaml deleted file mode 100644 index 60e4e67..0000000 --- a/roles/config-update-and-upgrade-packages/tasks/main.yaml +++ /dev/null @@ -1,34 +0,0 @@ ---- - -- name: "[CONFIG UPDATE] Comprobando si es necesario realizar update " - meta: end_host - when: update_enabled is not defined or not update_enabled - -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# step1 - run apt-get update -- name: update index of all packages - ansible.builtin.apt: - update_cache: true - force_apt_get: true -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# step2 - run apt-get update -- name: update all packages to their latest version - ansible.builtin.apt: - name: "*" - state: latest - force_apt_get: true -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# step3 - run apt-get full-upgrade -- name: upgrade the OS (apt-get full-upgrade) - ansible.builtin.apt: - upgrade: full - force_apt_get: true -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# step4 - run apt autoremove -- name: autoremove packages unused dependency packages - ansible.builtin.apt: - autoremove: true - force_apt_get: true -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/roles/config-vim-options/tasks/main.yaml b/roles/config-vim-options/tasks/main.yaml deleted file mode 100644 index 1da32f2..0000000 --- a/roles/config-vim-options/tasks/main.yaml +++ /dev/null @@ -1,26 +0,0 @@ - -- name: "[CONFIG VIM OPTIONS] Comprobando si es necesario configurar vim options" - meta: end_host - when: vim_options_enabled is not defined or not vim_options_enabled - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# Enable VIM options -# step1 - create file vimrc.local -- name: create file vimrc.local - file: - path: "{{ path_vimrclocal }}" - state: touch - mode: '0644' -# step2 - add some options to the file -- name: add some options to vimrc.local - lineinfile: - path: "{{ path_vimrclocal }}" - line: "{{item.line}}" - state: present - with_items: - - line: syntax on - - line: set showcmd - - line: set showmatch - - line: set ignorecase - - line: set smartcase -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/roles/config-vim-options/vars/main.yaml b/roles/config-vim-options/vars/main.yaml deleted file mode 100644 index 62496d7..0000000 --- a/roles/config-vim-options/vars/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ ---- -path_vimrclocal: /etc/vim/vimrc.local \ No newline at end of file diff --git a/roles/config-zabbix-agent/files/zabbix-release_6.4-1+debian12_all.deb b/roles/config-zabbix-agent/files/zabbix-release_6.4-1+debian12_all.deb deleted file mode 100644 index 2db90199fbc6750391a54c9ea7f5759c0049a426..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3540 zcmbu?XE+;q6kv6 zW)-ESRjO3}z4v#Y|8t-F=Ktb;pYxn|=e+v7I0tmg5$Ws>1-ihUJRE(bojiOTks-pu z!tzSWD)K7wN^)|-!hh>;{^{~^a!NOD2n+wM|A_-oK}HVf?CXO@`g+Nr9g#A@q5pYa zN#UP;!om)~KgyvNRsaCaCb{u0O-~gK#t=kx1@KSOI>g;qL@Cr@TL2eB2Y)yfu1DYj zG=#H{C{k?4_4>qCV~`IxBFN<+>PJDB@6MnZVyT}=T}Y1-3AYKZwygl|e3QyC(Tm+) z7s@Z%V?tDoU&x=H0++Af=uC9B&kog$#Fc(+Lx_k*odyw?B!XmPh&c4?h2=LYT zQV4hayUfGGq;`nu_hM8v0Bc{>GrHObbKi;0tmvvWI!myt9UT+1Oz>+{7=34fi)~4U z6~B+l&9$@*c|R^aJ3gER``{q4KOaV0G07;NLP}IbU*?i{E(E8LWD*bP20$Een=?=` zkIVLE+=k7pVlqFfrhH*nd4k~H$<-Y9Cj=qM#E>!FhL2*)dWmZidZI`jYWGV|jG*=U zJci>_I&OaKYVEs*M+-w{h9V)SwuQ|+3@UCcUv*K~lAaC?oAuM7w!&`RYtiemxd5H($uOz$ z6P=xw3z_`1ghs{}XS=feVwS-yKgebahw&*{D!B`_RBu@md^n(=P{AgXZj2H2Ki>Y- zJ&xB~riGX2Z)da8haReN{3R1wbl$m1&~*Y(;r}`U0P+Tw+Up10PO1Nk6OE;nizC|c z-$?%o{!h*oloeF|f&PD;e&WCsQvDn1+BmzziU9>^`~Psd1J<3tV~L1N&(uca_32x=I24E8f}IVuTG-T|}H=m+9+741DC7sUXwoRb?x}J4tK- zYP8B;E6+jdsJo!ueO1j8In>{kzx+33c1MC4uF_fQ`6$l{%TDhpGVi6u z05~r)3}X#CmDMcNnk+I-rR_Z8wF_mY02~QHuVYBQRiw#jnjv0}EU3}ay@FZg;NG3o zTAR+34NWhpk0M5Qne?iX@n+#w7AEVj$`q77NWzStfAp92XoVtAV033WMnAJ*>~elR zpL)GOBdopq(BIOOSo;>g8wr)VSSyd-h!8Ybk~OGXsF z@;caYk9F2AqkT+88}fA^H2&T~uz+V&*od9_BU@#Q#bR%}qRaY%&dnFOSc9&=-OXVW zc1quYetDC^wfL3Uc*sR<7HjYZFi|CqdiR*Uy#sc{I=*q^GHvUy{hOIPsWbz8w`m_iQrV z90c2_m7n%tt~of?(h$Va2lV8Xd@vx3xa0xPA(dS9@NSaGwCIkB4+XOwj8gS4|H3x; z@y+hzg41mH}Opx#lzaOg`2mQ}@f_7M9!xS`C&tZmt*zxBpQ< z1L8xlyom+-GF?V`GlGG^K(&fHd1MJ+eoxO;2)JjIm^ zW8AVk<|nGUdc_?Gn;wzDoU9>CnA*=OLV_8`D?A17nv<%kT{rk=$1#(68rErG`ys@} z4jImE72}0h5FgrmqRvieKZoUJB`yJmz~_WfYnSG%_hGe{X!;*WA`Q+ zW(smFr^fexMy$o*+26^JPCi!(jR&#Qn05|Z#9Fl`OmxWeSCb3oyvY-CEtpvCX%&YVzH*+^A#s$jK9MR&b3&@kfYDY?aRfvX~z^lPd$w@ z(x39%x}5xYn3yT@ax;qRsm@Inzf)mcJe7o;&`SO)R%2}-HBw{p4Ig!-P-34)&4sK( z&~pBBU94G#R;jn9Ou+AwY$C`w|t1vKNSpMeeo_I$?ad<= zhBVbWS9Fvt{cmtmzPBWQFXJd?S!9JktR~omi71|xL*CVAp(5MGV6A20)d@NG`9p7o zZVkuP3(OZ~sQac|lKRT~fK;2LyYZ;kJK@EngoC>|-?L4})-S4J2Z{J(++Z6wxVt2U ze~$rbJ#S33-f#VsrcCaD+XvSucqQOd_t6S-9`0^l5BT}oLkA-cd1fwc>kMdRtht@2 znmDq!_Glt6W7md#T0Dy0-y)PE0y1@nb8yr)(n1<=vlG2n;H`mX7wx$*&g$5w2I8e^ zPcjUPV#sNBQ3~cP%25x-3Zlt^B9d(bt?V?PA8rKDw*APK2>Z$aJWFPFuXNpo#tnHt zUUAzP^|`aj^RmLLt;@{tS`a&uS#oLb^VKcg%40mP^5_gm9S zpgU+QK5R{c(o&Wm?&JOlqLf$|>ss5V%ECdVuG=+RcC)g{N08@geO!5Av0&k=T2y<9 zGJ^BYp!-J*WP2w_tOLLZ$wEF?X!r^+NYFLY0y>wIugv2q_oJjOdV&Z(& zi{t!CY)Gpo78TD$Z|6bA()y$BU~nY)#xYIPnRFOyz#yOgH~5D0056I0L#4zv@%*5A zda=lZ=9#$gyPzG#%ET%DjYiYwTqy&%2M=d(iA?Q;jZm|e8c#x`)fV6P;&tE4g~tBf zWNVL<@)a9Hy(&F$ +banaction = nftables-multiport +action = %(action_)s + +#+++++++++++++++ Jails + +[sshd] +enabled = true +port = 0:65535 +filter = sshd +logpath = %(sshd_log)s diff --git a/roles/linux-fail2ban/vars/main.yaml b/roles/linux-fail2ban/vars/main.yaml new file mode 100644 index 0000000..dc675b0 --- /dev/null +++ b/roles/linux-fail2ban/vars/main.yaml @@ -0,0 +1,5 @@ +fail2ban: + email: sysamdmin@verdnatura.es + bantime: 600 + maxretry: 4 + ignore: 127.0.0.0/8 10.0.0.0/16 diff --git a/roles/linux-hostname/tasks/main.yaml b/roles/linux-hostname/tasks/main.yaml new file mode 100644 index 0000000..773e7d6 --- /dev/null +++ b/roles/linux-hostname/tasks/main.yaml @@ -0,0 +1,23 @@ +# https://docs.ansible.com/ansible/latest/collections/ansible/builtin/hostname_module.html#ansible-collections-ansible-builtin-hostname-module + +- name: Set the hostname in /etc/hostname + ansible.builtin.hostname: + name: "{{ hostname }}" + use: debian +- name: Replace /etc/hosts + template: + src: hosts.j2 + dest: "/etc/hosts" + owner: root + group: root + mode: '0644' + backup: true +- name: Replace /etc/resolv.conf + template: + src: resolv.j2 + dest: "/etc/resolv.conf" + owner: root + group: root + mode: '0644' + backup: true + when: resolv_enabled diff --git a/roles/config-hosts/templates/hosts.j2 b/roles/linux-hostname/templates/hosts.j2 similarity index 63% rename from roles/config-hosts/templates/hosts.j2 rename to roles/linux-hostname/templates/hosts.j2 index 9b828be..d071be4 100644 --- a/roles/config-hosts/templates/hosts.j2 +++ b/roles/linux-hostname/templates/hosts.j2 @@ -1,5 +1,5 @@ {% if hosts is defined %} {% for host in hosts %} -{{host.ip}} {{host.name}} +{{host.ip}} {{hostname}} {% endfor %} {% endif %} \ No newline at end of file diff --git a/roles/linux-hostname/templates/resolv.j2 b/roles/linux-hostname/templates/resolv.j2 new file mode 100644 index 0000000..b137dc2 --- /dev/null +++ b/roles/linux-hostname/templates/resolv.j2 @@ -0,0 +1,7 @@ +domain {{ resolv.domain }} +search {{ resolv.search }} +{% if resolvers is defined %} +{% for resolver in resolvers %} +nameserver {{resolver}} +{% endfor %} +{% endif %} \ No newline at end of file diff --git a/roles/linux-install-packages/tasks/main.yaml b/roles/linux-install-packages/tasks/main.yaml new file mode 100644 index 0000000..3784a65 --- /dev/null +++ b/roles/linux-install-packages/tasks/main.yaml @@ -0,0 +1,10 @@ +- name: Install base packages + apt: + name: "{{ item }}" + state: present + with_items: + - htop + - psmisc + - bash-completion + - screen + - aptitude diff --git a/roles/linux-locale/tasks/main.yaml b/roles/linux-locale/tasks/main.yaml new file mode 100644 index 0000000..593a7cc --- /dev/null +++ b/roles/linux-locale/tasks/main.yaml @@ -0,0 +1,15 @@ +- name: Enable locale languages + lineinfile: + dest: "/etc/locale.gen" + regexp: "{{item.regexp}}" + line: "{{item.line}}" + state: present + with_items: + - regexp: "^# es_ES.UTF-8 UTF-8" + line: "es_ES.UTF-8 UTF-8" + - regexp: "^# en_US.UTF-8 UTF-8" + line: "en_US.UTF-8 UTF-8" +- name: Generate locale + command: locale-gen +- name: Update locale + command: update-locale LANG=en_US.UTF-8 \ No newline at end of file diff --git a/roles/config-motd/files/90-vn b/roles/linux-motd/files/90-vn similarity index 100% rename from roles/config-motd/files/90-vn rename to roles/linux-motd/files/90-vn diff --git a/roles/linux-motd/tasks/main.yaml b/roles/linux-motd/tasks/main.yaml new file mode 100644 index 0000000..7a7ec8f --- /dev/null +++ b/roles/linux-motd/tasks/main.yaml @@ -0,0 +1,7 @@ +- name: Copy MOTD configuration file + copy: + src: 90-vn + dest: "/etc/update-motd.d/" + mode: '755' + owner: root + group: root diff --git a/roles/linux-nrpe/files/90-vn.cfg b/roles/linux-nrpe/files/90-vn.cfg new file mode 100644 index 0000000..ba31809 --- /dev/null +++ b/roles/linux-nrpe/files/90-vn.cfg @@ -0,0 +1,12 @@ +allowed_hosts=nagios.verdnatura.es + +command[check_disk_root]=/usr/lib/nagios/plugins/check_disk -w 10% -c 5% -p / +command[check_disk_var]=/usr/lib/nagios/plugins/check_disk -w 10% -c 5% -p /var +command[check_disk_usr]=/usr/lib/nagios/plugins/check_disk -w 10% -c 5% -p /usr +command[check_disk_home]=/usr/lib/nagios/plugins/check_disk -w 10% -c 5% -p /home +command[check_disk_tmp]=/usr/lib/nagios/plugins/check_disk -w 10% -c 5% -p /tmp +command[check_dummy]=/usr/lib/nagios/plugins/check_dummy 0 +command[check_swap]=/usr/lib/nagios/plugins/check_swap -w 40% -c 20% -n OK +command[check_load]=/usr/lib/nagios/plugins/check_load -r -w 3.5,3.25,3 -c 4.5,4.25,4 +command[check_total_procs]=/usr/lib/nagios/plugins/check_procs -w 400 -c 500 +command[check_memory]=/usr/lib/nagios/plugins/check_memory --available -m -w 20%: -c 10%: diff --git a/roles/linux-nrpe/handlers/main.yaml b/roles/linux-nrpe/handlers/main.yaml new file mode 100644 index 0000000..0399734 --- /dev/null +++ b/roles/linux-nrpe/handlers/main.yaml @@ -0,0 +1,4 @@ +- name: restart-nrpe + service: + name: nagios-nrpe-server + state: restarted diff --git a/roles/linux-nrpe/tasks/main.yaml b/roles/linux-nrpe/tasks/main.yaml new file mode 100644 index 0000000..25b4c1d --- /dev/null +++ b/roles/linux-nrpe/tasks/main.yaml @@ -0,0 +1,22 @@ +- name: Install packages + apt: + name: "{{ item }}" + state: present + loop: + - nagios-nrpe-server + - nagios-plugins-contrib +- name: Set generic configuration + copy: + src: 90-vn.cfg + dest: /etc/nagios/nrpe.d/90-vn.cfg + owner: root + group: root + mode: '0644' + notify: restart-nrpe +- name: Create local configuration file + file: + path: /etc/nagios/nrpe.d/99-local.cfg + state: touch + owner: nagios + group: nagios + mode: '0640' diff --git a/roles/config-ntp/files/timesync b/roles/linux-ntp/files/timesync similarity index 54% rename from roles/config-ntp/files/timesync rename to roles/linux-ntp/files/timesync index af2e3d1..3c79241 100644 --- a/roles/config-ntp/files/timesync +++ b/roles/linux-ntp/files/timesync @@ -1,7 +1,4 @@ #!/bin/sh -# PLS do NOT delete timesyncing from VM virtuals -# it is necessary for critical cluster services -# nada test -x /usr/sbin/ntpdate || exit 0 /usr/sbin/ntpdate time1.verdnatura.es diff --git a/roles/config-ntp/handlers/main.yaml b/roles/linux-ntp/handlers/main.yaml similarity index 55% rename from roles/config-ntp/handlers/main.yaml rename to roles/linux-ntp/handlers/main.yaml index a089d46..52a882c 100644 --- a/roles/config-ntp/handlers/main.yaml +++ b/roles/linux-ntp/handlers/main.yaml @@ -1,4 +1,3 @@ -# restart crontab service to apply changes - name: restart systemd-timesyncd service: name: "{{ timesyncd_daemon }}" diff --git a/roles/linux-ntp/tasks/main.yaml b/roles/linux-ntp/tasks/main.yaml new file mode 100644 index 0000000..082e776 --- /dev/null +++ b/roles/linux-ntp/tasks/main.yaml @@ -0,0 +1,24 @@ +- name: Checking if configuration is needed + meta: end_host + when: ntp_enabled is not defined or not ntp_enabled +- name: Configure /etc/systemd/timesyncd.conf + lineinfile: + path: /etc/systemd/timesyncd.conf + regexp: '^#NTP' + line: "NTP=time1.verdnatura.es time2.verdnatura.es" + owner: root + group: root + mode: '0644' +- name: Configure /etc/systemd/timesyncd.conf + lineinfile: + path: /etc/systemd/timesyncd.conf + regexp: '^#?FallbackNTP=' + line: "FallbackNTP=ntp.roa.es" + owner: root + group: root + mode: '0644' + notify: restart systemd-timesyncd +- name: Service should start on boot + service: + name: "{{ timesyncd_daemon }}" + enabled: yes diff --git a/roles/linux-ntp/vars/main.yaml b/roles/linux-ntp/vars/main.yaml new file mode 100644 index 0000000..5dd02ed --- /dev/null +++ b/roles/linux-ntp/vars/main.yaml @@ -0,0 +1 @@ +timesyncd_daemon: systemd-timesyncd diff --git a/roles/linux-profile/files/vn.sh b/roles/linux-profile/files/vn.sh new file mode 100644 index 0000000..d8f3cf6 --- /dev/null +++ b/roles/linux-profile/files/vn.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +# Prompt + +FQDN=$(hostname --fqdn) + +if [[ $FQDN == *.verdnatura.es ]]; then + SHORT_HOST=${FQDN%.verdnatura.es} + + case "$SHORT_HOST" in + *.dc) + ENVIRONMENT="\[\033[01;31m\]PRO\[\033[00m\]" + ;; + *.lab) + ENVIRONMENT="\[\033[01;35m\]LAB\[\033[00m\]" + ;; + *) + ENVIRONMENT="\[\033[01;32m\]VN\[\033[00m\]" + ;; + esac + + PS1="\u@$SHORT_HOST[$ENVIRONMENT]:\w" + + if [ "$(id -u)" -eq 0 ]; then + PS1="$PS1# " + else + PS1="$PS1\$ " + fi +fi + +# History + +HISTSIZE=10000 +HISTFILESIZE=50000 +HISTTIMEFORMAT="%Y-%m-%d %H:%M:%S " + +# Security + +TMOUT=3600 diff --git a/roles/linux-profile/tasks/main.yaml b/roles/linux-profile/tasks/main.yaml new file mode 100644 index 0000000..d6ca52e --- /dev/null +++ b/roles/linux-profile/tasks/main.yaml @@ -0,0 +1,7 @@ +- name: Copy profile configuration file + copy: + src: vn.sh + dest: "/etc/profile.d/" + mode: '644' + owner: root + group: root diff --git a/roles/linux-qemu/files/80-hotplug-cpu-mem.rules b/roles/linux-qemu/files/80-hotplug-cpu-mem.rules new file mode 100644 index 0000000..38c16f9 --- /dev/null +++ b/roles/linux-qemu/files/80-hotplug-cpu-mem.rules @@ -0,0 +1 @@ +SUBSYSTEM=="cpu", ACTION=="add", TEST=="online", ATTR{online}=="0", ATTR{online}="1" diff --git a/roles/linux-qemu/files/hotplug.cfg b/roles/linux-qemu/files/hotplug.cfg new file mode 100644 index 0000000..85e1612 --- /dev/null +++ b/roles/linux-qemu/files/hotplug.cfg @@ -0,0 +1 @@ +GRUB_CMDLINE_LINUX_DEFAULT="quiet memhp_default_state=online security=none" diff --git a/roles/linux-qemu/tasks/main.yaml b/roles/linux-qemu/tasks/main.yaml new file mode 100644 index 0000000..1d295d3 --- /dev/null +++ b/roles/linux-qemu/tasks/main.yaml @@ -0,0 +1,20 @@ +- name: Install QEMU guest agent + apt: + name: qemu-guest-agent + state: present +- name: Configure udev hotplug rules + copy: + src: 80-hotplug-cpu-mem.rules + dest: /usr/lib/udev/rules.d/ + mode: u=rw,g=r,o=r + owner: root + group: root +- name: Configure GRUB for hotplug + copy: + src: hotplug.cfg + dest: /etc/default/grub.d/ + mode: u=rw,g=r,o=r + owner: root + group: root +- name: Generate GRUB configuration + command: update-grub diff --git a/roles/config-relayhost-smtp/defaults/main.yaml b/roles/linux-relayhost/defaults/main.yaml similarity index 91% rename from roles/config-relayhost-smtp/defaults/main.yaml rename to roles/linux-relayhost/defaults/main.yaml index 1df9485..ed9eef3 100644 --- a/roles/config-relayhost-smtp/defaults/main.yaml +++ b/roles/linux-relayhost/defaults/main.yaml @@ -1,4 +1,3 @@ ---- exim_dc_eximconfig_configtype: satellite dc_other_hostnames: "{{ ansible_nodename }}" dc_local_interfaces: 127.0.0.1 @@ -11,4 +10,4 @@ CFILEMODE: 644 dc_use_split_config: false dc_hide_mailname: true dc_mailname_in_oh: true -dc_localdelivery: mail_spool \ No newline at end of file +dc_localdelivery: mail_spool diff --git a/roles/linux-relayhost/handlers/main.yaml b/roles/linux-relayhost/handlers/main.yaml new file mode 100644 index 0000000..21e507a --- /dev/null +++ b/roles/linux-relayhost/handlers/main.yaml @@ -0,0 +1,4 @@ +- name: restart-exim + service: + name: exim4 + state: restarted \ No newline at end of file diff --git a/roles/config-relayhost-smtp/tasks/main.yaml b/roles/linux-relayhost/tasks/main.yaml similarity index 65% rename from roles/config-relayhost-smtp/tasks/main.yaml rename to roles/linux-relayhost/tasks/main.yaml index 1afb8b9..13d0ed9 100644 --- a/roles/config-relayhost-smtp/tasks/main.yaml +++ b/roles/linux-relayhost/tasks/main.yaml @@ -1,11 +1,8 @@ - -- name: "[CONFIG RELAYHOST SMTP] Comprobando si es necesario configurar relayhost smtp" - meta: end_host - when: relay_host_enabled is not defined or not relay_host_enabled - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# Reconfigure relayhost smtp to smtp.verdnatura.es -- name: reconfigure relayhost to smtp.verdnatura.es +- name: Install packages + apt: + name: exim4 + state: present +- name: Reconfigure relayhost lineinfile: dest: "{{ exim_configuration_file }}" regexp: "{{ item.regexp }}" @@ -39,18 +36,8 @@ line: "dc_mailname_in_oh='{{ dc_mailname_in_oh }}'" - regexp: '^dc_localdelivery' line: "dc_localdelivery='{{ dc_localdelivery }}'" - notify: restart exim4 + notify: restart-exim register: exim4_config -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# service should start on boot. -- name: service should start on boot - service: - name: "{{ exim_daemon }}" - enabled: yes -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# Send mail to verify relay-host -- name: sending mail to verify exim4 config works +- name: Sending mail to verify exim4 config works shell: echo "Verify send email from host {{ ansible_nodename }}.verdnatura.es with mailx , bye." | mailx -s "test mail verify exim4 for the host {{ ansible_nodename }}.verdnatura.es" -c rubenb@verdnatura.es,nada@verdnatura.es,juan@verdnatura.es,davidl@verdnatura.es sysadmin@verdnatura.es when: exim4_config.changed -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/roles/config-relayhost-smtp/vars/main.yaml b/roles/linux-relayhost/vars/main.yaml similarity index 95% rename from roles/config-relayhost-smtp/vars/main.yaml rename to roles/linux-relayhost/vars/main.yaml index 82108ac..1764954 100644 --- a/roles/config-relayhost-smtp/vars/main.yaml +++ b/roles/linux-relayhost/vars/main.yaml @@ -1,3 +1,2 @@ ---- exim_configuration_file: /etc/exim4/update-exim4.conf.conf exim_daemon: exim4 diff --git a/roles/linux-root/handlers/main.yaml b/roles/linux-root/handlers/main.yaml new file mode 100644 index 0000000..4ca2b3a --- /dev/null +++ b/roles/linux-root/handlers/main.yaml @@ -0,0 +1,4 @@ +- name: Restart SSH service + service: + name: ssh + state: restarted \ No newline at end of file diff --git a/roles/linux-root/tasks/main.yaml b/roles/linux-root/tasks/main.yaml new file mode 100644 index 0000000..ad4407d --- /dev/null +++ b/roles/linux-root/tasks/main.yaml @@ -0,0 +1,26 @@ +- name: Delete default user + user: + name: "{{ name_user }}" + state: absent + remove: yes +- name: Change root password + user: + name: root + password: "{{ ssh_password | password_hash('sha512') }}" +- name: Configure bashrc + lineinfile: + dest: "/root/.bashrc" + regexp: "{{item.regexp}}" + line: "{{item.line}}" + state: present + with_items: + - regexp: "^# export LS_OPTIONS" + line: "export LS_OPTIONS='--color=auto" + - regexp: "^# eval" + line: 'eval "$(dircolors)"' + - regexp: "^# alias ls='ls $LS_OPTIONS'" + line: "alias ls='ls $LS_OPTIONS'" + - regexp: "^# alias ll='ls $LS_OPTIONS -l'" + line: "alias ll='ls $LS_OPTIONS -l'" + - regexp: "# alias la='ls $LS_OPTIONS -la'" + line: "alias la='ls $LS_OPTIONS -la'" diff --git a/roles/linux-secure-grub/handlers/main.yaml b/roles/linux-secure-grub/handlers/main.yaml new file mode 100644 index 0000000..9f3d6e6 --- /dev/null +++ b/roles/linux-secure-grub/handlers/main.yaml @@ -0,0 +1,2 @@ +- name: grub-register + command: update-grub \ No newline at end of file diff --git a/roles/linux-secure-grub/tasks/main.yaml b/roles/linux-secure-grub/tasks/main.yaml new file mode 100644 index 0000000..d2876e3 --- /dev/null +++ b/roles/linux-secure-grub/tasks/main.yaml @@ -0,0 +1,9 @@ +- name: GRUB password boot protection + blockinfile: + path: /etc/grub.d/40_custom + block: | + set superusers="{{ user_grub }}" + password_pbkdf2 {{ user_grub }} {{ code_grub }} + notify: grub-register + when: secure_grub_enabled + diff --git a/roles/config-secure-grub/vars/main.yaml b/roles/linux-secure-grub/vars/main.yaml similarity index 98% rename from roles/config-secure-grub/vars/main.yaml rename to roles/linux-secure-grub/vars/main.yaml index 52c9b80..d61c32d 100644 --- a/roles/config-secure-grub/vars/main.yaml +++ b/roles/linux-secure-grub/vars/main.yaml @@ -1,3 +1,2 @@ ---- user_grub: admin code_grub: grub.pbkdf2.sha512.10000.C91C8756466E7DB535C77DB7FBDBF3D33A39A0712DE3A9AFD38BE2229139E86F23C4E007E6B76DDFDBBE4B2B32764B4EFFECF208C70BA9FECC6BB3FF68A6BA05.8EA3857B795AF29FF5C6E003E31EC4D79B84813175C7A56A8A12F3F30A19B501D7127C0307277FB37073EE0246BCFDA9BD4EDDC3A1EE8176D25CD37B7FB07AF7 diff --git a/roles/linux-sudoers/files/vn b/roles/linux-sudoers/files/vn new file mode 100644 index 0000000..d9faa7f --- /dev/null +++ b/roles/linux-sudoers/files/vn @@ -0,0 +1 @@ +%sysadmin ALL=(ALL) NOPASSWD: ALL diff --git a/roles/linux-sudoers/tasks/main.yaml b/roles/linux-sudoers/tasks/main.yaml new file mode 100644 index 0000000..54ec054 --- /dev/null +++ b/roles/linux-sudoers/tasks/main.yaml @@ -0,0 +1,7 @@ +- name: Copy sudoers configuration file + copy: + src: vn + dest: "/etc/sudoers.d/" + mode: u=rw,g=r + owner: root + group: root diff --git a/roles/config-tzdata/files/set_timezone.sh b/roles/linux-tzdata/files/set_timezone.sh similarity index 66% rename from roles/config-tzdata/files/set_timezone.sh rename to roles/linux-tzdata/files/set_timezone.sh index 7333a40..9e17f1c 100644 --- a/roles/config-tzdata/files/set_timezone.sh +++ b/roles/linux-tzdata/files/set_timezone.sh @@ -1,10 +1,8 @@ #!/bin/bash -#echo "Europe" > /etc/timezone -#ln -sf /usr/share/zoneinfo/Europe/Madrid /etc/localtime echo 'tzdata tzdata/Areas select Europe' | debconf-set-selections echo 'tzdata tzdata/Zones/Europe select Madrid' | debconf-set-selections echo 'tzdata tzdata/Zones/Etc select UTC' | debconf-set-selections rm /etc/timezone rm /etc/localtime -dpkg-reconfigure -f noninteractive tzdata \ No newline at end of file +dpkg-reconfigure -f noninteractive tzdata diff --git a/roles/linux-tzdata/tasks/main.yaml b/roles/linux-tzdata/tasks/main.yaml new file mode 100644 index 0000000..60872cf --- /dev/null +++ b/roles/linux-tzdata/tasks/main.yaml @@ -0,0 +1,2 @@ +- name: Configure the time zone + script: set_timezone.sh diff --git a/roles/linux-upgrade/tasks/main.yaml b/roles/linux-upgrade/tasks/main.yaml new file mode 100644 index 0000000..0674f4b --- /dev/null +++ b/roles/linux-upgrade/tasks/main.yaml @@ -0,0 +1,20 @@ +- name: Checking if it's necessary to update + meta: end_host + when: update_enabled is not defined or not update_enabled +- name: update index of all packages + ansible.builtin.apt: + update_cache: true + force_apt_get: true +- name: update all packages to their latest version + ansible.builtin.apt: + name: "*" + state: latest + force_apt_get: true +- name: upgrade the OS (apt-get full-upgrade) + ansible.builtin.apt: + upgrade: full + force_apt_get: true +- name: autoremove packages unused dependency packages + ansible.builtin.apt: + autoremove: true + force_apt_get: true diff --git a/roles/linux-vim/files/vimrc.local b/roles/linux-vim/files/vimrc.local new file mode 100644 index 0000000..005d05c --- /dev/null +++ b/roles/linux-vim/files/vimrc.local @@ -0,0 +1,5 @@ +syntax on +set showcmd +set showmatch +set ignorecase +set smartcase diff --git a/roles/linux-vim/tasks/main.yaml b/roles/linux-vim/tasks/main.yaml new file mode 100644 index 0000000..aa5ed3c --- /dev/null +++ b/roles/linux-vim/tasks/main.yaml @@ -0,0 +1,11 @@ +- name: Install packages + apt: + name: vim + state: present +- name: Copy vim configuration file + copy: + src: vimrc.local + dest: "/etc/vim/" + mode: '644' + owner: root + group: root \ No newline at end of file diff --git a/roles/linux-vm/tasks/main.yaml b/roles/linux-vm/tasks/main.yaml new file mode 100644 index 0000000..54ed27f --- /dev/null +++ b/roles/linux-vm/tasks/main.yaml @@ -0,0 +1,10 @@ +- include_role: + name: linux-motd +- include_role: + name: linux-profile +- include_role: + name: linux-sudoers +- include_role: + name: linux-vim +- include_role: + name: linux-locale \ No newline at end of file diff --git a/roles/linux-vn-repo/tasks/main.yaml b/roles/linux-vn-repo/tasks/main.yaml new file mode 100644 index 0000000..d515adf --- /dev/null +++ b/roles/linux-vn-repo/tasks/main.yaml @@ -0,0 +1,12 @@ +- name: Download vn-host Debian package + get_url: + url: "{{ repo_url }}" + dest: "{{ package_path }}" + mode: '0644' +- name: Install package + apt: + deb: "{{ package_path }}" +- name: Delete package + file: + path: "{{ package_path }}" + state: absent diff --git a/roles/config-repo-vn/vars/main.yaml b/roles/linux-vn-repo/vars/main.yaml similarity index 63% rename from roles/config-repo-vn/vars/main.yaml rename to roles/linux-vn-repo/vars/main.yaml index 2e5bad2..a66fb2a 100644 --- a/roles/config-repo-vn/vars/main.yaml +++ b/roles/linux-vn-repo/vars/main.yaml @@ -1,3 +1,2 @@ ---- repo_url: http://apt.verdnatura.es/pool/main/v/vn-host/vn-host_2.0.2_all.deb -path_package: /tmp/vn-host_2.0.2_all.deb \ No newline at end of file +package_path: /tmp/vn-host_2.0.2_all.deb diff --git a/roles/nsupdate/meta/main.yaml b/roles/nsupdate/meta/main.yaml new file mode 100644 index 0000000..70b7565 --- /dev/null +++ b/roles/nsupdate/meta/main.yaml @@ -0,0 +1,2 @@ +collections: + - community.general \ No newline at end of file diff --git a/roles/nsupdate/tasks/main.yaml b/roles/nsupdate/tasks/main.yaml new file mode 100644 index 0000000..f4e541c --- /dev/null +++ b/roles/nsupdate/tasks/main.yaml @@ -0,0 +1,12 @@ +- name: Add or modify DNS records A to some IP + community.general.nsupdate: + key_name: "rndc-key" + key_secret: "{{ bind9secretkey_password }}" + key_algorithm: "hmac-md5" + server: "ns1.verdnatura.es" + zone: "{{ zone_record }}" + record: "{{ name_record }}" + ttl: "{{ ttl_record }}" + type: "{{ type_record }}" + value: "{{ value_record }}" + state: "{{ state_record }}" diff --git a/roles/config-nsupdate/vars/main.yaml b/roles/nsupdate/vars/main.yaml similarity index 96% rename from roles/config-nsupdate/vars/main.yaml rename to roles/nsupdate/vars/main.yaml index a11cf20..1960e50 100644 --- a/roles/config-nsupdate/vars/main.yaml +++ b/roles/nsupdate/vars/main.yaml @@ -1,5 +1,3 @@ ---- -# vars file bind9secretkey_password: !vault | $ANSIBLE_VAULT;1.1;AES256 36386562613235363931396632656535383336313537636431643338353438313231623839313031 diff --git a/roles/config-send-mail/tasks/main.yaml b/roles/send-mail/tasks/main.yaml similarity index 63% rename from roles/config-send-mail/tasks/main.yaml rename to roles/send-mail/tasks/main.yaml index cef3c10..a7e7d0c 100644 --- a/roles/config-send-mail/tasks/main.yaml +++ b/roles/send-mail/tasks/main.yaml @@ -1,7 +1,3 @@ ---- -# roles/config-send-mail/tasks/main.yaml - -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - name: Sending an e-mail using Verdnatura SMTP servers community.general.mail: host: smtp.verdnatura.es @@ -12,4 +8,3 @@ subject: Ansible-test body: System {{ ansible_hostname }} has been send successfully mail. delegate_to: localhost -#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/roles/config-send-mail/vars/main.yaml b/roles/send-mail/vars/main.yaml similarity index 100% rename from roles/config-send-mail/vars/main.yaml rename to roles/send-mail/vars/main.yaml diff --git a/windows-install-package.yml b/windows-install-package.yml deleted file mode 100644 index c9e0d28..0000000 --- a/windows-install-package.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -- name: Installing Apache MSI - hosts: W2019 - - tasks: - - name: Download the Apache installer - win_get_url: - url: https://archive.apache.org/dist/httpd/binaries/win32/httpd-2.2.25-win32-x86-no_ssl.msi - dest: C:\ansible_examples\httpd-2.2.25-win32-x86-no_ssl.msi - - - name: Install MSI - win_package: - path: C:\ansible_examples\httpd-2.2.25-win32-x86-no_ssl.msi - state: present \ No newline at end of file diff --git a/windows-ping-test.yml b/windows-ping-test.yml deleted file mode 100644 index 544b237..0000000 --- a/windows-ping-test.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -- name: Ping Windows hosts - hosts: W2019 - tasks: - - name: Ping Windows hosts using win_ping module - ansible.windows.win_ping: \ No newline at end of file diff --git a/windows-restart_service.yml b/windows-restart_service.yml deleted file mode 100644 index 4ea40c3..0000000 --- a/windows-restart_service.yml +++ /dev/null @@ -1,7 +0,0 @@ ---- -- hosts: W2019 - tasks: - - name: Stop service WSearch - win_service: - name: wuauserv - state: stopped \ No newline at end of file -- 2.40.1 From cdeb3098dcf70e6daa10168e96620adb5458c1db Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 23 Sep 2024 16:32:28 +0200 Subject: [PATCH 02/20] refs #8025 Merge roles --- ansible.cfg | 2 +- collections/README.md | 21 ++++---- collections/requirements.yml | 1 - group_vars/all.yaml | 1 + playbooks/debian-base.yaml | 20 ------- playbooks/debian-ct.yaml | 27 ---------- playbooks/debian-infra.yaml | 23 -------- playbooks/debian-vm.yaml | 57 -------------------- playbooks/debian.yaml | 15 ++++-- playbooks/{ping.yml => ping.yaml} | 0 playbooks/print-facts.yaml | 11 ++++ roles/awx/vars/main.yaml | 1 - roles/linux-autofs/tasks/main.yaml | 3 -- roles/linux-base/tasks/main.yaml | 18 +++++-- roles/linux-guest/tasks/main.yaml | 5 ++ roles/linux-install-packages/tasks/main.yaml | 10 ---- roles/linux-ntp/handlers/main.yaml | 2 +- roles/linux-ntp/tasks/main.yaml | 5 +- roles/linux-ntp/vars/main.yaml | 1 - roles/linux-qemu/tasks/main.yaml | 5 ++ roles/linux-relayhost/tasks/main.yaml | 2 +- roles/linux-relayhost/vars/main.yaml | 2 - roles/linux-sudoers/tasks/main.yaml | 4 ++ roles/linux-vm/tasks/main.yaml | 10 ---- 24 files changed, 68 insertions(+), 178 deletions(-) delete mode 100644 playbooks/debian-base.yaml delete mode 100644 playbooks/debian-ct.yaml delete mode 100644 playbooks/debian-infra.yaml delete mode 100644 playbooks/debian-vm.yaml rename playbooks/{ping.yml => ping.yaml} (100%) create mode 100644 playbooks/print-facts.yaml delete mode 100644 roles/awx/vars/main.yaml create mode 100644 roles/linux-guest/tasks/main.yaml delete mode 100644 roles/linux-install-packages/tasks/main.yaml delete mode 100644 roles/linux-ntp/vars/main.yaml delete mode 100644 roles/linux-relayhost/vars/main.yaml delete mode 100644 roles/linux-vm/tasks/main.yaml diff --git a/ansible.cfg b/ansible.cfg index 0752a5b..f917a56 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -1,7 +1,7 @@ [defaults] roles_path = ./roles inventory = ./hosts -gathering = explicit +gathering = smart interpreter_python = auto_silent remote_user = root host_key_checking = False diff --git a/collections/README.md b/collections/README.md index 5f0beeb..d3ea311 100644 --- a/collections/README.md +++ b/collections/README.md @@ -1,31 +1,32 @@ # Collections -The porpouse of collections is get more modules and plugins to use in ansible. +The purpose of collections is get more modules and plugins to use in ansible. Collections are supported by Ansible community. # Install collections -In AWX-operator container , execute: +In *awx-operator* container, execute: ``` ansible-galaxy collection install -r requirements.yml ``` Where `requirements.yml` we need to specify the list of collections that we want to install: - ``` collections: - name: community.general - ``` -# Collection index: -[Index-Ansible-collections](https://docs.ansible.com/ansible/latest/collections/index.html) +# Collection index + +* https://docs.ansible.com/ansible/latest/collections/index.html # List collections -[Listing-collections](https://docs.ansible.com/ansible/latest/collections_guide/collections_listing.html) To list installed collections, run `ansible-galaxy collection list` (inside awx operator container) - -# Install multiple collections with a requirements file -[Install-multiple](https://docs.ansible.com/ansible/devel/collections_guide/collections_installing.html#install-multiple-collections-with-a-requirements-file) + +* https://docs.ansible.com/ansible/latest/collections_guide/collections_listing.html + +# Install multiple collections + +* https://docs.ansible.com/ansible/devel/collections_guide/collections_installing.html#install-multiple-collections-with-a-requirements-file diff --git a/collections/requirements.yml b/collections/requirements.yml index 1c297cd..a745157 100644 --- a/collections/requirements.yml +++ b/collections/requirements.yml @@ -1,4 +1,3 @@ ---- collections: - name: community.general version: '>=9.0.0' diff --git a/group_vars/all.yaml b/group_vars/all.yaml index 0f02e94..9414cf6 100644 --- a/group_vars/all.yaml +++ b/group_vars/all.yaml @@ -1,3 +1,4 @@ +awx_pub_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDjeIZVyppFK/dqOUa1PxgSeRVWk7MFmANYvSs+VHHnD4/BE//K8AxlxnyLl4e6jAcBFoIu1JLxbRKdOhx+Zgkq5OmEzp/XKzfEvnEU5CP+W2+5MwfkUQ3TetJsOoHiP/qYWPqqqfDFqNM1xs9am5Frv9BVu5pFiSO9oS14xVAlUOwnONQnRtAbuBOmMldpzxmuFY+Rs3G2MmokcOYrs5Z3TdCOG9bDGg8erzWklLW+aRYdXqMEZpwIZPcOFy6JXEyZ/9IpCLBN58IMr0RypFbgWb2Vo05iTI5j99Pzn//FgAhe6BXRyHSGOJ29hmKugt9sIY1N/H6aYqtTVR5EEIngY1XHtFywU1+qtYHMs8PB9Hl87zUkla0+S5Zn8q92y7DQFsOZ9ND6syEzWhiCP1ic3Wo76TVbuNoTW/XvgZnemx1epuOqDj9S7iGTSHMvvSop8z5hU2EQiVkgRPl4cM2fi0vF513ivq5IbCgg2VfXUOLM5E5y0TI7lzBriTtCuIk= awx@awx.verdnatura.es resolv: domain: verdnatura.es search: verdnatura.es diff --git a/playbooks/debian-base.yaml b/playbooks/debian-base.yaml deleted file mode 100644 index 2807e6d..0000000 --- a/playbooks/debian-base.yaml +++ /dev/null @@ -1,20 +0,0 @@ -- hosts: all - tasks: - - name: Set locales - import_role: - name: config-locales - - name: Set timezone - import_role: - name: config-tzdata - - name: Install and configure fail2ban service - import_role: - name: config-fail2ban - tags: config-fail2ban_config - - name: Install guest side - import_role: - name: config-server-type - tags: config-server-type_config - - name: Install and configure ntp - import_role: - name: config-ntp - tags: config-ntp_config diff --git a/playbooks/debian-ct.yaml b/playbooks/debian-ct.yaml deleted file mode 100644 index 6b0c442..0000000 --- a/playbooks/debian-ct.yaml +++ /dev/null @@ -1,27 +0,0 @@ -- hosts: all - - - name: Config relayhost smtp - import_role: - name: config-relayhost-smtp - when: relay_host_enabled is defined and relay_host_enabled - tags: config-relayhost-smtp_config - - name: Config centralized auth - import_role: - name: config-centralized-auth - when: centralized_auth_enabled is defined and centralized_auth_enabled - tags: config-centralized-auth_config - - name: Set locales - import_role: - name: config-locales - when: locales_enabled is defined and locales_enabled - tags: config-locales_config - - name: Set timezone - import_role: - name: config-tzdata - when: tzdata_enabled is defined and tzdata_enabled - tags: config-tzdata_config - - name: Install and configure fail2ban service - import_role: - name: config-fail2ban - when: fail2ban_enabled is defined and fail2ban_enabled - tags: config-fail2ban_config diff --git a/playbooks/debian-infra.yaml b/playbooks/debian-infra.yaml deleted file mode 100644 index 40ebf56..0000000 --- a/playbooks/debian-infra.yaml +++ /dev/null @@ -1,23 +0,0 @@ -- hosts: all - tasks: - - name: Configure debian os - import_role: - name: config-base-debian-os - - name: Set locales - import_role: - name: config-locales - - name: Set timezone - import_role: - name: config-tzdata - - name: Add-repos-vn - import_role: - name: config-repo-vn - - name: Install and configure fail2ban service - import_role: - name: config-fail2ban - - name: Install and configure nagios nrpe service - import_role: - name: config-nagios-nrpe - - name: Install and configure ntp - import_role: - name: config-ntp diff --git a/playbooks/debian-vm.yaml b/playbooks/debian-vm.yaml deleted file mode 100644 index 0e6ff3e..0000000 --- a/playbooks/debian-vm.yaml +++ /dev/null @@ -1,57 +0,0 @@ -- hosts: all - tasks: - - name: Install packages - import_role: - name: config-install-packages - when: packages_enabled is defined and packages_enabled - tags: config-install-packages_config - - name: Config relayhost smtp - import_role: - name: config-relayhost-smtp - when: relay_host_enabled is defined and relay_host_enabled - tags: config-relayhost-smtp_config - - name: Config centralized auth - import_role: - name: config-centralized-auth - when: centralized_auth_enabled is defined and centralized_auth_enabled - tags: config-centralized-auth_config - - name: configure secure grub - import_role: - name: config-secure-grub - when: secure_grub_enabled is defined and secure_grub_enabled - tags: config-secure-grub_config - - name: Install and configure hot plug - import_role: - name: config-hot-plug - when: hot_plug_enabled is defined and hot_plug_enabled - tags: config-hot-plug_config - - name: Set locales - import_role: - name: config-locales - when: locales_enabled is defined and locales_enabled - tags: config-locales_config - - name: Set timezone - import_role: - name: config-tzdata - when: tzdata_enabled is defined and tzdata_enabled - tags: config-tzdata_config - - name: Install and configure fail2ban service - import_role: - name: config-fail2ban - when: fail2ban_enabled is defined and fail2ban_enabled - tags: config-fail2ban_config - - name: Install guest side - import_role: - name: config-server-type - when: server_type_enabled is defined and server_type_enabled - tags: config-server-type_config - - name: Install and configure ntp - import_role: - name: config-ntp - when: ntp_enabled is defined and ntp_enabled - tags: config-ntp_config - - name: Install and configure AUTOFS HOMES - import_role: - name: config-autofs-homes - when: autofs_homes_enabled is defined and autofs_homes_enabled - tags: config-autofs-homes_config diff --git a/playbooks/debian.yaml b/playbooks/debian.yaml index 0db3d8a..85a6d8a 100644 --- a/playbooks/debian.yaml +++ b/playbooks/debian.yaml @@ -1,5 +1,14 @@ - hosts: all tasks: - - name: Configure base system - import_role: - name: linux-base + - name: Configure AWX user + import_role: + name: awx + - name: Configure base system + import_role: + name: linux-base + - name: Configure guest + import_role: + name: linux-guest + - name: Configure virtual machine + import_role: + name: linux-qemu diff --git a/playbooks/ping.yml b/playbooks/ping.yaml similarity index 100% rename from playbooks/ping.yml rename to playbooks/ping.yaml diff --git a/playbooks/print-facts.yaml b/playbooks/print-facts.yaml new file mode 100644 index 0000000..91e79a3 --- /dev/null +++ b/playbooks/print-facts.yaml @@ -0,0 +1,11 @@ +# https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_vars_facts.html + +- hosts: all + gather_facts: yes + tasks: + - name: Print all available facts + ansible.builtin.debug: + var: ansible_facts + - name: Print variable value + debug: + msg: "Variable: {{ ansible_virtualization_type }}" diff --git a/roles/awx/vars/main.yaml b/roles/awx/vars/main.yaml deleted file mode 100644 index b8d6bad..0000000 --- a/roles/awx/vars/main.yaml +++ /dev/null @@ -1 +0,0 @@ -awx_pub_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDjeIZVyppFK/dqOUa1PxgSeRVWk7MFmANYvSs+VHHnD4/BE//K8AxlxnyLl4e6jAcBFoIu1JLxbRKdOhx+Zgkq5OmEzp/XKzfEvnEU5CP+W2+5MwfkUQ3TetJsOoHiP/qYWPqqqfDFqNM1xs9am5Frv9BVu5pFiSO9oS14xVAlUOwnONQnRtAbuBOmMldpzxmuFY+Rs3G2MmokcOYrs5Z3TdCOG9bDGg8erzWklLW+aRYdXqMEZpwIZPcOFy6JXEyZ/9IpCLBN58IMr0RypFbgWb2Vo05iTI5j99Pzn//FgAhe6BXRyHSGOJ29hmKugt9sIY1N/H6aYqtTVR5EEIngY1XHtFywU1+qtYHMs8PB9Hl87zUkla0+S5Zn8q92y7DQFsOZ9ND6syEzWhiCP1ic3Wo76TVbuNoTW/XvgZnemx1epuOqDj9S7iGTSHMvvSop8z5hU2EQiVkgRPl4cM2fi0vF513ivq5IbCgg2VfXUOLM5E5y0TI7lzBriTtCuIk= awx@awx.verdnatura.es diff --git a/roles/linux-autofs/tasks/main.yaml b/roles/linux-autofs/tasks/main.yaml index 644c69f..bfdb347 100644 --- a/roles/linux-autofs/tasks/main.yaml +++ b/roles/linux-autofs/tasks/main.yaml @@ -1,6 +1,3 @@ -- name: Checking if configuration is needed - meta: end_host - when: autofs_homes_enabled is not defined or not autofs_homes_enabled - name: Install packages for autofs apt: name: "{{ item }}" diff --git a/roles/linux-base/tasks/main.yaml b/roles/linux-base/tasks/main.yaml index 54ed27f..ee0a9c0 100644 --- a/roles/linux-base/tasks/main.yaml +++ b/roles/linux-base/tasks/main.yaml @@ -1,10 +1,22 @@ +- name: Install base packages + apt: + name: "{{ item }}" + state: present + with_items: + - htop + - psmisc + - bash-completion + - screen + - aptitude +- include_role: + name: linux-sudoers - include_role: name: linux-motd - include_role: name: linux-profile -- include_role: - name: linux-sudoers - include_role: name: linux-vim - include_role: - name: linux-locale \ No newline at end of file + name: linux-locale +- include_role: + name: linux-nrpe \ No newline at end of file diff --git a/roles/linux-guest/tasks/main.yaml b/roles/linux-guest/tasks/main.yaml new file mode 100644 index 0000000..1a5dd2a --- /dev/null +++ b/roles/linux-guest/tasks/main.yaml @@ -0,0 +1,5 @@ +- name: Skip if not a guest + meta: end_host + when: ansible_virtualization_role != 'guest' +- include_role: + name: linux-auth diff --git a/roles/linux-install-packages/tasks/main.yaml b/roles/linux-install-packages/tasks/main.yaml deleted file mode 100644 index 3784a65..0000000 --- a/roles/linux-install-packages/tasks/main.yaml +++ /dev/null @@ -1,10 +0,0 @@ -- name: Install base packages - apt: - name: "{{ item }}" - state: present - with_items: - - htop - - psmisc - - bash-completion - - screen - - aptitude diff --git a/roles/linux-ntp/handlers/main.yaml b/roles/linux-ntp/handlers/main.yaml index 52a882c..530fefe 100644 --- a/roles/linux-ntp/handlers/main.yaml +++ b/roles/linux-ntp/handlers/main.yaml @@ -1,4 +1,4 @@ - name: restart systemd-timesyncd service: - name: "{{ timesyncd_daemon }}" + name: systemd-timesyncd state: restarted \ No newline at end of file diff --git a/roles/linux-ntp/tasks/main.yaml b/roles/linux-ntp/tasks/main.yaml index 082e776..89fbe1e 100644 --- a/roles/linux-ntp/tasks/main.yaml +++ b/roles/linux-ntp/tasks/main.yaml @@ -1,6 +1,3 @@ -- name: Checking if configuration is needed - meta: end_host - when: ntp_enabled is not defined or not ntp_enabled - name: Configure /etc/systemd/timesyncd.conf lineinfile: path: /etc/systemd/timesyncd.conf @@ -20,5 +17,5 @@ notify: restart systemd-timesyncd - name: Service should start on boot service: - name: "{{ timesyncd_daemon }}" + name: systemd-timesyncd enabled: yes diff --git a/roles/linux-ntp/vars/main.yaml b/roles/linux-ntp/vars/main.yaml deleted file mode 100644 index 5dd02ed..0000000 --- a/roles/linux-ntp/vars/main.yaml +++ /dev/null @@ -1 +0,0 @@ -timesyncd_daemon: systemd-timesyncd diff --git a/roles/linux-qemu/tasks/main.yaml b/roles/linux-qemu/tasks/main.yaml index 1d295d3..80e5fac 100644 --- a/roles/linux-qemu/tasks/main.yaml +++ b/roles/linux-qemu/tasks/main.yaml @@ -1,3 +1,6 @@ +- 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 @@ -18,3 +21,5 @@ group: root - name: Generate GRUB configuration command: update-grub +- include_role: + name: linux-autofs diff --git a/roles/linux-relayhost/tasks/main.yaml b/roles/linux-relayhost/tasks/main.yaml index 13d0ed9..db2c7f2 100644 --- a/roles/linux-relayhost/tasks/main.yaml +++ b/roles/linux-relayhost/tasks/main.yaml @@ -4,7 +4,7 @@ state: present - name: Reconfigure relayhost lineinfile: - dest: "{{ exim_configuration_file }}" + dest: /etc/exim4/update-exim4.conf.conf regexp: "{{ item.regexp }}" line: "{{ item.line }}" state: present diff --git a/roles/linux-relayhost/vars/main.yaml b/roles/linux-relayhost/vars/main.yaml deleted file mode 100644 index 1764954..0000000 --- a/roles/linux-relayhost/vars/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ -exim_configuration_file: /etc/exim4/update-exim4.conf.conf -exim_daemon: exim4 diff --git a/roles/linux-sudoers/tasks/main.yaml b/roles/linux-sudoers/tasks/main.yaml index 54ec054..f512867 100644 --- a/roles/linux-sudoers/tasks/main.yaml +++ b/roles/linux-sudoers/tasks/main.yaml @@ -1,3 +1,7 @@ +- name: Install sudo package + apt: + name: sudo + state: present - name: Copy sudoers configuration file copy: src: vn diff --git a/roles/linux-vm/tasks/main.yaml b/roles/linux-vm/tasks/main.yaml deleted file mode 100644 index 54ed27f..0000000 --- a/roles/linux-vm/tasks/main.yaml +++ /dev/null @@ -1,10 +0,0 @@ -- include_role: - name: linux-motd -- include_role: - name: linux-profile -- include_role: - name: linux-sudoers -- include_role: - name: linux-vim -- include_role: - name: linux-locale \ No newline at end of file -- 2.40.1 From 0b7ab9a8342801e377eb766fc8b9521b9cf02fd6 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 23 Sep 2024 16:34:09 +0200 Subject: [PATCH 03/20] refs #8025 send-mail refactor --- roles/send-mail/tasks/main.yaml | 2 +- roles/send-mail/vars/main.yaml | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/roles/send-mail/tasks/main.yaml b/roles/send-mail/tasks/main.yaml index a7e7d0c..1b06a29 100644 --- a/roles/send-mail/tasks/main.yaml +++ b/roles/send-mail/tasks/main.yaml @@ -1,4 +1,4 @@ -- name: Sending an e-mail using Verdnatura SMTP servers +- name: Send mail using Verdnatura SMTP servers community.general.mail: host: smtp.verdnatura.es port: 465 diff --git a/roles/send-mail/vars/main.yaml b/roles/send-mail/vars/main.yaml index ae7603d..3286258 100644 --- a/roles/send-mail/vars/main.yaml +++ b/roles/send-mail/vars/main.yaml @@ -1,6 +1,3 @@ ---- -# roles/config-send-mail/vars/main.yaml - bindsecretawx_password: !vault | $ANSIBLE_VAULT;1.1;AES256 62393936623766653737356136353765336265636136616330306537393638646663326663346138 -- 2.40.1 From 9b358d0262c41598aedb6bf4f60aac3985a37d1b Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 23 Sep 2024 16:35:42 +0200 Subject: [PATCH 04/20] refs #8025 Remove non-production hosts from inventory --- hosts | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/hosts b/hosts index 1dff883..a824dc6 100644 --- a/hosts +++ b/hosts @@ -130,30 +130,3 @@ kubeMaster kubeWorker kubeProxy kubeBackup - -[test] - -W2019 ansible_host=10.1.5.224 -graphite ansible_host=graphite.lab.verdnatura.es -metric1 ansible_host=metric1.lab.verdnatura.es -plantilladebian12 ansible_host=plantilladebian12.lab.verdnatura.es -docker-test ansible_host=docker-test.lab.verdnatura.es -nagios4-test ansible_host=nagios4-test.lab.verdnatura.es -nagios4-test2 ansible_host=nagios4-test2.lab.verdnatura.es -cephlab01 ansible_host=cephlab01.lab.verdnatura.es -cephlab02 ansible_host=cephlab02.lab.verdnatura.es -cephlab03 ansible_host=cephlab03.lab.verdnatura.es -core-proxytest ansible_host=core-proxytest.lab.verdnatura.es -openldap-test ansible_host=openldap-test.lab.verdnatura.es -test-playbook ansible_host=test-playbook.lab.verdnatura.es -zabbix-frontend-web ansible_host=zabbix-frontend-web.lab.verdnatura.es -zabbix-server-db ansible_host=zabbix-server-db.lab.verdnatura.es -testansible ansible_host=10.29.6.79 -freeradius-playbook ansible_host=freeradius-playbook.lab.verdnatura.es -debian-vn-test ansible_host=debian-vn-test.lab.verdnatura.es -iventoy-test ansible_host=iventoy-test.lab.verdnatura.es -kubelab-proxy1 ansible_host=kubelab-proxy1.lab.verdnatura.es -openvpn-freeradius ansible_host=openvpn-freeradius.lab.verdnatura.es -vm-debian12 ansible_host=vm-debian12.lab.verdnatura.es -docker-itlab ansible_host=10.29.2.153 -test1 ansible_host=10.29.2.254 -- 2.40.1 From c7299d8499c5c6f4044bb702eda9fe33c7cb9a1a Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Mon, 23 Sep 2024 16:58:52 +0200 Subject: [PATCH 05/20] refs #8025 Hosts reorganized, clearer names for roles --- hosts | 102 +++++++++--------- playbooks/debian.yaml | 8 +- playbooks/test.yaml | 2 +- playbooks/windows-ping.yml | 2 +- playbooks/windows-update.yaml | 3 +- .../tasks/main.yaml | 0 roles/debian-guest/tasks/main.yaml | 3 + .../files/80-hotplug-cpu-mem.rules | 0 .../files/hotplug.cfg | 0 .../tasks/main.yaml | 3 - roles/linux-guest/tasks/main.yaml | 5 - 11 files changed, 60 insertions(+), 68 deletions(-) rename roles/{linux-base => debian-base}/tasks/main.yaml (100%) create mode 100644 roles/debian-guest/tasks/main.yaml rename roles/{linux-qemu => debian-qemu}/files/80-hotplug-cpu-mem.rules (100%) rename roles/{linux-qemu => debian-qemu}/files/hotplug.cfg (100%) rename roles/{linux-qemu => debian-qemu}/tasks/main.yaml (77%) delete mode 100644 roles/linux-guest/tasks/main.yaml diff --git a/hosts b/hosts index a824dc6..f22db36 100644 --- a/hosts +++ b/hosts @@ -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 diff --git a/playbooks/debian.yaml b/playbooks/debian.yaml index 85a6d8a..f131f8c 100644 --- a/playbooks/debian.yaml +++ b/playbooks/debian.yaml @@ -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' diff --git a/playbooks/test.yaml b/playbooks/test.yaml index 99e65fd..8032bff 100644 --- a/playbooks/test.yaml +++ b/playbooks/test.yaml @@ -2,4 +2,4 @@ tasks: - name: Test role import_role: - name: linux-fail2ban + name: linux-base diff --git a/playbooks/windows-ping.yml b/playbooks/windows-ping.yml index 2a141f4..4fef2f5 100644 --- a/playbooks/windows-ping.yml +++ b/playbooks/windows-ping.yml @@ -1,5 +1,5 @@ - name: Ping Windows hosts - hosts: windows + hosts: all tasks: - name: Ping Windows hosts ansible.windows.win_ping: \ No newline at end of file diff --git a/playbooks/windows-update.yaml b/playbooks/windows-update.yaml index 301bf77..b3181a1 100644 --- a/playbooks/windows-update.yaml +++ b/playbooks/windows-update.yaml @@ -1,5 +1,4 @@ -- hosts: windows - ignore_unreachable: yes +- hosts: all serial: 1 tasks: - block: diff --git a/roles/linux-base/tasks/main.yaml b/roles/debian-base/tasks/main.yaml similarity index 100% rename from roles/linux-base/tasks/main.yaml rename to roles/debian-base/tasks/main.yaml diff --git a/roles/debian-guest/tasks/main.yaml b/roles/debian-guest/tasks/main.yaml new file mode 100644 index 0000000..e1125c9 --- /dev/null +++ b/roles/debian-guest/tasks/main.yaml @@ -0,0 +1,3 @@ +- include_role: + name: linux-auth + when: false diff --git a/roles/linux-qemu/files/80-hotplug-cpu-mem.rules b/roles/debian-qemu/files/80-hotplug-cpu-mem.rules similarity index 100% rename from roles/linux-qemu/files/80-hotplug-cpu-mem.rules rename to roles/debian-qemu/files/80-hotplug-cpu-mem.rules diff --git a/roles/linux-qemu/files/hotplug.cfg b/roles/debian-qemu/files/hotplug.cfg similarity index 100% rename from roles/linux-qemu/files/hotplug.cfg rename to roles/debian-qemu/files/hotplug.cfg diff --git a/roles/linux-qemu/tasks/main.yaml b/roles/debian-qemu/tasks/main.yaml similarity index 77% rename from roles/linux-qemu/tasks/main.yaml rename to roles/debian-qemu/tasks/main.yaml index 80e5fac..cab7e7f 100644 --- a/roles/linux-qemu/tasks/main.yaml +++ b/roles/debian-qemu/tasks/main.yaml @@ -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 diff --git a/roles/linux-guest/tasks/main.yaml b/roles/linux-guest/tasks/main.yaml deleted file mode 100644 index 1a5dd2a..0000000 --- a/roles/linux-guest/tasks/main.yaml +++ /dev/null @@ -1,5 +0,0 @@ -- name: Skip if not a guest - meta: end_host - when: ansible_virtualization_role != 'guest' -- include_role: - name: linux-auth -- 2.40.1 From 98684397503c3a9cee14760442fd6965b502fb51 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 24 Sep 2024 09:38:05 +0200 Subject: [PATCH 06/20] refs #8025 Roles merged, passwords moved to global vars, rename .yaml to .yml --- ansible.cfg | 2 +- group_vars/all.yaml | 7 - group_vars/all.yml | 42 +++++ ...debian-upgrade.yaml => debian-upgrade.yml} | 2 +- playbooks/{debian.yaml => debian.yml} | 0 playbooks/{freeradius.yaml => freeradius.yml} | 0 playbooks/{nsupdate.yaml => nsupdate.yml} | 0 playbooks/{ping.yaml => ping.yml} | 0 .../{print-facts.yaml => print-facts.yml} | 0 playbooks/{send-mail.yaml => send-mail.yml} | 0 playbooks/{test.yaml => test.yml} | 0 ...windows-update.yaml => windows-update.yml} | 0 .../defaults/main.yaml | 0 .../files/90-vn => debian-base/files/motd} | 0 .../90-vn.cfg => debian-base/files/nrpe.cfg} | 0 .../vn.sh => debian-base/files/profile.sh} | 0 .../files/set-timezone.sh} | 0 .../files/vn => debian-base/files/sudoers} | 0 .../{linux-ntp => debian-base}/files/timesync | 0 .../files/vimrc.local | 0 roles/debian-base/handlers/main.yml | 21 +++ .../tasks/bacula.yml} | 4 +- .../tasks/fail2ban.yml} | 4 +- roles/debian-base/tasks/install.yml | 10 ++ .../tasks/locale.yml} | 0 roles/debian-base/tasks/main.yaml | 22 --- roles/debian-base/tasks/main.yml | 8 + .../main.yaml => debian-base/tasks/motd.yml} | 4 +- .../main.yaml => debian-base/tasks/nrpe.yml} | 8 +- .../tasks/profile.yml} | 4 +- .../tasks/relayhost.yml} | 2 +- .../main.yaml => debian-base/tasks/root.yaml} | 0 .../tasks/sudoers.yml} | 4 +- .../tasks/tymesyncd.yml} | 0 .../tasks/tzdata.yml} | 2 +- .../main.yaml => debian-base/tasks/vim.yml} | 0 roles/debian-base/tasks/vn-repo.yml | 12 ++ .../templates/bacula-fd.conf.j2} | 4 +- .../templates/jail.local.j2 | 0 .../main.yaml => debian-base/vars/main.yml} | 3 + .../files/nslcd.conf | 2 +- .../main.yaml => debian-guest/tasks/auth.yml} | 2 +- roles/debian-guest/tasks/main.yaml | 3 - roles/debian-guest/tasks/main.yml | 2 + .../files/auto.homes | 0 .../files/homes.autofs | 0 roles/debian-qemu/tasks/agent.yml | 4 + .../tasks/autofs.yml} | 0 .../tasks/{main.yaml => hotplug.yml} | 4 - roles/debian-qemu/tasks/main.yml | 3 + roles/debian-qemu/vars/main.yml | 1 + .../tasks/main.yaml | 0 roles/freeradius/tasks/main.yaml | 156 ------------------ roles/freeradius/tasks/main.yml | 97 +++++++++++ roles/freeradius/templates/clients.j2 | 2 +- roles/freeradius/vars/main.yaml | 16 -- roles/linux-auth/vars/main.yaml | 7 - roles/linux-autofs/tasks/main.yaml | 38 ----- roles/linux-autofs/vars/main.yaml | 1 - roles/linux-fail2ban/handlers/main.yaml | 4 - .../tasks/{main.yaml => main.yml} | 0 roles/linux-nrpe/handlers/main.yaml | 4 - roles/linux-ntp/handlers/main.yaml | 4 - roles/linux-relayhost/handlers/main.yaml | 4 - roles/linux-root/handlers/main.yaml | 4 - .../handlers/{main.yaml => main.yml} | 0 .../tasks/{main.yaml => main.yml} | 0 roles/linux-vn-repo/tasks/main.yaml | 12 -- roles/linux-vn-repo/vars/main.yaml | 2 - roles/nsupdate/meta/{main.yaml => main.yml} | 0 roles/nsupdate/tasks/{main.yaml => main.yml} | 2 +- roles/nsupdate/vars/main.yaml | 7 - roles/send-mail/tasks/{main.yaml => main.yml} | 2 +- roles/send-mail/vars/main.yaml | 7 - 74 files changed, 228 insertions(+), 327 deletions(-) delete mode 100644 group_vars/all.yaml create mode 100644 group_vars/all.yml rename playbooks/{debian-upgrade.yaml => debian-upgrade.yml} (70%) rename playbooks/{debian.yaml => debian.yml} (100%) rename playbooks/{freeradius.yaml => freeradius.yml} (100%) rename playbooks/{nsupdate.yaml => nsupdate.yml} (100%) rename playbooks/{ping.yaml => ping.yml} (100%) rename playbooks/{print-facts.yaml => print-facts.yml} (100%) rename playbooks/{send-mail.yaml => send-mail.yml} (100%) rename playbooks/{test.yaml => test.yml} (100%) rename playbooks/{windows-update.yaml => windows-update.yml} (100%) rename roles/{linux-relayhost => debian-base}/defaults/main.yaml (100%) rename roles/{linux-motd/files/90-vn => debian-base/files/motd} (100%) rename roles/{linux-nrpe/files/90-vn.cfg => debian-base/files/nrpe.cfg} (100%) rename roles/{linux-profile/files/vn.sh => debian-base/files/profile.sh} (100%) rename roles/{linux-tzdata/files/set_timezone.sh => debian-base/files/set-timezone.sh} (100%) rename roles/{linux-sudoers/files/vn => debian-base/files/sudoers} (100%) rename roles/{linux-ntp => debian-base}/files/timesync (100%) rename roles/{linux-vim => debian-base}/files/vimrc.local (100%) create mode 100644 roles/debian-base/handlers/main.yml rename roles/{linux-bacula/tasks/main.yaml => debian-base/tasks/bacula.yml} (85%) rename roles/{linux-fail2ban/tasks/main.yaml => debian-base/tasks/fail2ban.yml} (76%) create mode 100644 roles/debian-base/tasks/install.yml rename roles/{linux-locale/tasks/main.yaml => debian-base/tasks/locale.yml} (100%) delete mode 100644 roles/debian-base/tasks/main.yaml create mode 100644 roles/debian-base/tasks/main.yml rename roles/{linux-motd/tasks/main.yaml => debian-base/tasks/motd.yml} (65%) rename roles/{linux-nrpe/tasks/main.yaml => debian-base/tasks/nrpe.yml} (72%) rename roles/{linux-profile/tasks/main.yaml => debian-base/tasks/profile.yml} (64%) rename roles/{linux-relayhost/tasks/main.yaml => debian-base/tasks/relayhost.yml} (98%) rename roles/{linux-root/tasks/main.yaml => debian-base/tasks/root.yaml} (100%) rename roles/{linux-sudoers/tasks/main.yaml => debian-base/tasks/sudoers.yml} (78%) rename roles/{linux-ntp/tasks/main.yaml => debian-base/tasks/tymesyncd.yml} (100%) rename roles/{linux-tzdata/tasks/main.yaml => debian-base/tasks/tzdata.yml} (55%) rename roles/{linux-vim/tasks/main.yaml => debian-base/tasks/vim.yml} (100%) create mode 100644 roles/debian-base/tasks/vn-repo.yml rename roles/{linux-bacula/files/bacula-fd.conf.jd2 => debian-base/templates/bacula-fd.conf.j2} (88%) rename roles/{linux-fail2ban => debian-base}/templates/jail.local.j2 (100%) rename roles/{linux-fail2ban/vars/main.yaml => debian-base/vars/main.yml} (53%) rename roles/{linux-auth => debian-guest}/files/nslcd.conf (94%) rename roles/{linux-auth/tasks/main.yaml => debian-guest/tasks/auth.yml} (93%) delete mode 100644 roles/debian-guest/tasks/main.yaml create mode 100644 roles/debian-guest/tasks/main.yml rename roles/{linux-autofs => debian-qemu}/files/auto.homes (100%) rename roles/{linux-autofs => debian-qemu}/files/homes.autofs (100%) create mode 100644 roles/debian-qemu/tasks/agent.yml rename roles/{linux-autofs/handlers/main.yaml => debian-qemu/tasks/autofs.yml} (100%) rename roles/debian-qemu/tasks/{main.yaml => hotplug.yml} (82%) create mode 100644 roles/debian-qemu/tasks/main.yml create mode 100644 roles/debian-qemu/vars/main.yml rename roles/{linux-upgrade => debian-upgrade}/tasks/main.yaml (100%) delete mode 100644 roles/freeradius/tasks/main.yaml create mode 100644 roles/freeradius/tasks/main.yml delete mode 100644 roles/linux-auth/vars/main.yaml delete mode 100644 roles/linux-autofs/tasks/main.yaml delete mode 100644 roles/linux-autofs/vars/main.yaml delete mode 100644 roles/linux-fail2ban/handlers/main.yaml rename roles/linux-hostname/tasks/{main.yaml => main.yml} (100%) delete mode 100644 roles/linux-nrpe/handlers/main.yaml delete mode 100644 roles/linux-ntp/handlers/main.yaml delete mode 100644 roles/linux-relayhost/handlers/main.yaml delete mode 100644 roles/linux-root/handlers/main.yaml rename roles/linux-secure-grub/handlers/{main.yaml => main.yml} (100%) rename roles/linux-secure-grub/tasks/{main.yaml => main.yml} (100%) delete mode 100644 roles/linux-vn-repo/tasks/main.yaml delete mode 100644 roles/linux-vn-repo/vars/main.yaml rename roles/nsupdate/meta/{main.yaml => main.yml} (100%) rename roles/nsupdate/tasks/{main.yaml => main.yml} (87%) delete mode 100644 roles/nsupdate/vars/main.yaml rename roles/send-mail/tasks/{main.yaml => main.yml} (87%) delete mode 100644 roles/send-mail/vars/main.yaml diff --git a/ansible.cfg b/ansible.cfg index f917a56..e5b1de3 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -3,7 +3,7 @@ roles_path = ./roles inventory = ./hosts gathering = smart interpreter_python = auto_silent -remote_user = root +remote_user = awx-user host_key_checking = False [privilege_escalation] diff --git a/group_vars/all.yaml b/group_vars/all.yaml deleted file mode 100644 index 9414cf6..0000000 --- a/group_vars/all.yaml +++ /dev/null @@ -1,7 +0,0 @@ -awx_pub_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDjeIZVyppFK/dqOUa1PxgSeRVWk7MFmANYvSs+VHHnD4/BE//K8AxlxnyLl4e6jAcBFoIu1JLxbRKdOhx+Zgkq5OmEzp/XKzfEvnEU5CP+W2+5MwfkUQ3TetJsOoHiP/qYWPqqqfDFqNM1xs9am5Frv9BVu5pFiSO9oS14xVAlUOwnONQnRtAbuBOmMldpzxmuFY+Rs3G2MmokcOYrs5Z3TdCOG9bDGg8erzWklLW+aRYdXqMEZpwIZPcOFy6JXEyZ/9IpCLBN58IMr0RypFbgWb2Vo05iTI5j99Pzn//FgAhe6BXRyHSGOJ29hmKugt9sIY1N/H6aYqtTVR5EEIngY1XHtFywU1+qtYHMs8PB9Hl87zUkla0+S5Zn8q92y7DQFsOZ9ND6syEzWhiCP1ic3Wo76TVbuNoTW/XvgZnemx1epuOqDj9S7iGTSHMvvSop8z5hU2EQiVkgRPl4cM2fi0vF513ivq5IbCgg2VfXUOLM5E5y0TI7lzBriTtCuIk= awx@awx.verdnatura.es -resolv: - domain: verdnatura.es - search: verdnatura.es -resolvers: - - '10.0.0.4' - - '10.0.0.5' diff --git a/group_vars/all.yml b/group_vars/all.yml new file mode 100644 index 0000000..9625d61 --- /dev/null +++ b/group_vars/all.yml @@ -0,0 +1,42 @@ +awx_pub_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDjeIZVyppFK/dqOUa1PxgSeRVWk7MFmANYvSs+VHHnD4/BE//K8AxlxnyLl4e6jAcBFoIu1JLxbRKdOhx+Zgkq5OmEzp/XKzfEvnEU5CP+W2+5MwfkUQ3TetJsOoHiP/qYWPqqqfDFqNM1xs9am5Frv9BVu5pFiSO9oS14xVAlUOwnONQnRtAbuBOmMldpzxmuFY+Rs3G2MmokcOYrs5Z3TdCOG9bDGg8erzWklLW+aRYdXqMEZpwIZPcOFy6JXEyZ/9IpCLBN58IMr0RypFbgWb2Vo05iTI5j99Pzn//FgAhe6BXRyHSGOJ29hmKugt9sIY1N/H6aYqtTVR5EEIngY1XHtFywU1+qtYHMs8PB9Hl87zUkla0+S5Zn8q92y7DQFsOZ9ND6syEzWhiCP1ic3Wo76TVbuNoTW/XvgZnemx1epuOqDj9S7iGTSHMvvSop8z5hU2EQiVkgRPl4cM2fi0vF513ivq5IbCgg2VfXUOLM5E5y0TI7lzBriTtCuIk= awx@awx.verdnatura.es +resolv: + domain: verdnatura.es + search: verdnatura.es +resolvers: + - '10.0.0.4' + - '10.0.0.5' +nslcd_password: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 30343461633538323832316231383362626636653864353535346461353937313131336135396162 + 3866623238353638323961363239373236393339333134380a313561363030306165393965396234 + 65316535626434333331633438613639633163643765633064363833303461363834653864646464 + 3133313233353730620a343536316266393637623563313563613332646630643632366439343764 + 30383935303161646339393361393130613266663337373364626635646430326465 +rndc_key: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 36386562613235363931396632656535383336313537636431643338353438313231623839313031 + 3830616135393732353265666664353963393366343461630a633365396165653761353762383739 + 66303862376465626435633964313237643230653463353662343831646464633639383336323863 + 6139333234386565620a653438613165626131653834633931343766343162653932373161653362 + 38303139333536656263656163623333313234393666353766363565633732366165 +radius_ldap_password: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 31643037313539376337363739616361363339616235623433656131306539373030373731643934 + 3432656465343430366366646237326137656134346562360a306538303762313261616632643135 + 39316439653932396134646432633262326631363765643564306565636363356335653539656531 + 6234636463376364620a636133346337306437643939376531633564633737333133363065633031 + 61643731646163323636343837373761303930323961653663343135303731623133 +radius_client_password: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 62313333666335316231396365653635356639626563613738363137383434343437393833393934 + 6439646632303536393438306234323862363532393733630a356136393539363161346631623161 + 37636365653331333735353166646164613732303035613231353237343139623137396364643637 + 3261656465336435630a666466643734373830633933613266663631343730386530633839386239 + 62623434663130363637303035363434313566376661356362663238666166343534 +awx_smtp_password: !vault | + $ANSIBLE_VAULT;1.1;AES256 + 62393936623766653737356136353765336265636136616330306537393638646663326663346138 + 3631616362363163393036613564623864383365633634660a366563363836363061623566393361 + 37633364633631333130346332613235303762316435313535613664323830656363353237373561 + 3866653365636431630a303262666662376662623862663461633361333037643863353135343836 + 61383730366664353730616331666139376234313562383163613736353231666533 \ No newline at end of file diff --git a/playbooks/debian-upgrade.yaml b/playbooks/debian-upgrade.yml similarity index 70% rename from playbooks/debian-upgrade.yaml rename to playbooks/debian-upgrade.yml index de568cd..8215cb2 100644 --- a/playbooks/debian-upgrade.yaml +++ b/playbooks/debian-upgrade.yml @@ -2,4 +2,4 @@ tasks: - name: Upgrade system import_role: - name: linux-upgrade + name: debian-upgrade diff --git a/playbooks/debian.yaml b/playbooks/debian.yml similarity index 100% rename from playbooks/debian.yaml rename to playbooks/debian.yml diff --git a/playbooks/freeradius.yaml b/playbooks/freeradius.yml similarity index 100% rename from playbooks/freeradius.yaml rename to playbooks/freeradius.yml diff --git a/playbooks/nsupdate.yaml b/playbooks/nsupdate.yml similarity index 100% rename from playbooks/nsupdate.yaml rename to playbooks/nsupdate.yml diff --git a/playbooks/ping.yaml b/playbooks/ping.yml similarity index 100% rename from playbooks/ping.yaml rename to playbooks/ping.yml diff --git a/playbooks/print-facts.yaml b/playbooks/print-facts.yml similarity index 100% rename from playbooks/print-facts.yaml rename to playbooks/print-facts.yml diff --git a/playbooks/send-mail.yaml b/playbooks/send-mail.yml similarity index 100% rename from playbooks/send-mail.yaml rename to playbooks/send-mail.yml diff --git a/playbooks/test.yaml b/playbooks/test.yml similarity index 100% rename from playbooks/test.yaml rename to playbooks/test.yml diff --git a/playbooks/windows-update.yaml b/playbooks/windows-update.yml similarity index 100% rename from playbooks/windows-update.yaml rename to playbooks/windows-update.yml diff --git a/roles/linux-relayhost/defaults/main.yaml b/roles/debian-base/defaults/main.yaml similarity index 100% rename from roles/linux-relayhost/defaults/main.yaml rename to roles/debian-base/defaults/main.yaml diff --git a/roles/linux-motd/files/90-vn b/roles/debian-base/files/motd similarity index 100% rename from roles/linux-motd/files/90-vn rename to roles/debian-base/files/motd diff --git a/roles/linux-nrpe/files/90-vn.cfg b/roles/debian-base/files/nrpe.cfg similarity index 100% rename from roles/linux-nrpe/files/90-vn.cfg rename to roles/debian-base/files/nrpe.cfg diff --git a/roles/linux-profile/files/vn.sh b/roles/debian-base/files/profile.sh similarity index 100% rename from roles/linux-profile/files/vn.sh rename to roles/debian-base/files/profile.sh diff --git a/roles/linux-tzdata/files/set_timezone.sh b/roles/debian-base/files/set-timezone.sh similarity index 100% rename from roles/linux-tzdata/files/set_timezone.sh rename to roles/debian-base/files/set-timezone.sh diff --git a/roles/linux-sudoers/files/vn b/roles/debian-base/files/sudoers similarity index 100% rename from roles/linux-sudoers/files/vn rename to roles/debian-base/files/sudoers diff --git a/roles/linux-ntp/files/timesync b/roles/debian-base/files/timesync similarity index 100% rename from roles/linux-ntp/files/timesync rename to roles/debian-base/files/timesync diff --git a/roles/linux-vim/files/vimrc.local b/roles/debian-base/files/vimrc.local similarity index 100% rename from roles/linux-vim/files/vimrc.local rename to roles/debian-base/files/vimrc.local diff --git a/roles/debian-base/handlers/main.yml b/roles/debian-base/handlers/main.yml new file mode 100644 index 0000000..524348c --- /dev/null +++ b/roles/debian-base/handlers/main.yml @@ -0,0 +1,21 @@ +- name: restart-timesyncd + service: + name: systemd-timesyncd + state: restarted +- name: restart-exim + service: + name: exim4 + state: restarted +- name: restart-ssh + service: + name: ssh + state: restarted +- name: restart-fail2ban + service: + name: fail2ban + state: restarted +- name: restart-nrpe + service: + name: nagios-nrpe-server + state: restarted + diff --git a/roles/linux-bacula/tasks/main.yaml b/roles/debian-base/tasks/bacula.yml similarity index 85% rename from roles/linux-bacula/tasks/main.yaml rename to roles/debian-base/tasks/bacula.yml index 88f96de..a786645 100644 --- a/roles/linux-bacula/tasks/main.yaml +++ b/roles/debian-base/tasks/bacula.yml @@ -1,4 +1,4 @@ -- name: Install packages +- name: Install Bacula FD packages apt: name: bacula-fd state: present @@ -14,7 +14,7 @@ group: bacula mode: '0640' backup: true -- name: Restart service +- name: Restart Bacula FD service service: name: bacula-fd state: restarted diff --git a/roles/linux-fail2ban/tasks/main.yaml b/roles/debian-base/tasks/fail2ban.yml similarity index 76% rename from roles/linux-fail2ban/tasks/main.yaml rename to roles/debian-base/tasks/fail2ban.yml index 8b2aacc..f1a7042 100644 --- a/roles/linux-fail2ban/tasks/main.yaml +++ b/roles/debian-base/tasks/fail2ban.yml @@ -1,11 +1,11 @@ -- name: Install packages +- name: Install fail2ban packages apt: name: fail2ban state: present loop: - fail2ban - rsyslog -- name: Configure service +- name: Configure fail2ban service template: src: jail.local.j2 dest: /etc/fail2ban/jail.local diff --git a/roles/debian-base/tasks/install.yml b/roles/debian-base/tasks/install.yml new file mode 100644 index 0000000..e02d485 --- /dev/null +++ b/roles/debian-base/tasks/install.yml @@ -0,0 +1,10 @@ +- name: Install base packages + apt: + name: "{{ item }}" + state: present + with_items: + - htop + - psmisc + - bash-completion + - screen + - aptitude \ No newline at end of file diff --git a/roles/linux-locale/tasks/main.yaml b/roles/debian-base/tasks/locale.yml similarity index 100% rename from roles/linux-locale/tasks/main.yaml rename to roles/debian-base/tasks/locale.yml diff --git a/roles/debian-base/tasks/main.yaml b/roles/debian-base/tasks/main.yaml deleted file mode 100644 index ee0a9c0..0000000 --- a/roles/debian-base/tasks/main.yaml +++ /dev/null @@ -1,22 +0,0 @@ -- name: Install base packages - apt: - name: "{{ item }}" - state: present - with_items: - - htop - - psmisc - - bash-completion - - screen - - aptitude -- include_role: - name: linux-sudoers -- include_role: - name: linux-motd -- include_role: - name: linux-profile -- include_role: - name: linux-vim -- include_role: - name: linux-locale -- include_role: - name: linux-nrpe \ No newline at end of file diff --git a/roles/debian-base/tasks/main.yml b/roles/debian-base/tasks/main.yml new file mode 100644 index 0000000..ed03574 --- /dev/null +++ b/roles/debian-base/tasks/main.yml @@ -0,0 +1,8 @@ +- import_tasks: install.yml +- import_tasks: sudoers.yml +- import_tasks: motd.yml +- import_tasks: profile.yml +- import_tasks: vim.yml +- import_tasks: locale.yml +- import_tasks: tzdata.yml +- import_tasks: nrpe.yml diff --git a/roles/linux-motd/tasks/main.yaml b/roles/debian-base/tasks/motd.yml similarity index 65% rename from roles/linux-motd/tasks/main.yaml rename to roles/debian-base/tasks/motd.yml index 7a7ec8f..a51f73b 100644 --- a/roles/linux-motd/tasks/main.yaml +++ b/roles/debian-base/tasks/motd.yml @@ -1,7 +1,7 @@ - name: Copy MOTD configuration file copy: - src: 90-vn - dest: "/etc/update-motd.d/" + src: motd + dest: /etc/update-motd.d/90-vn mode: '755' owner: root group: root diff --git a/roles/linux-nrpe/tasks/main.yaml b/roles/debian-base/tasks/nrpe.yml similarity index 72% rename from roles/linux-nrpe/tasks/main.yaml rename to roles/debian-base/tasks/nrpe.yml index 25b4c1d..b76f672 100644 --- a/roles/linux-nrpe/tasks/main.yaml +++ b/roles/debian-base/tasks/nrpe.yml @@ -1,19 +1,19 @@ -- name: Install packages +- name: Install NRPE packages apt: name: "{{ item }}" state: present loop: - nagios-nrpe-server - nagios-plugins-contrib -- name: Set generic configuration +- name: Set NRPE generic configuration copy: - src: 90-vn.cfg + src: nrpe.cfg dest: /etc/nagios/nrpe.d/90-vn.cfg owner: root group: root mode: '0644' notify: restart-nrpe -- name: Create local configuration file +- name: Create NRPE local configuration file file: path: /etc/nagios/nrpe.d/99-local.cfg state: touch diff --git a/roles/linux-profile/tasks/main.yaml b/roles/debian-base/tasks/profile.yml similarity index 64% rename from roles/linux-profile/tasks/main.yaml rename to roles/debian-base/tasks/profile.yml index d6ca52e..65a7b53 100644 --- a/roles/linux-profile/tasks/main.yaml +++ b/roles/debian-base/tasks/profile.yml @@ -1,7 +1,7 @@ - name: Copy profile configuration file copy: - src: vn.sh - dest: "/etc/profile.d/" + src: profile.sh + dest: "/etc/profile.d/vn.sh" mode: '644' owner: root group: root diff --git a/roles/linux-relayhost/tasks/main.yaml b/roles/debian-base/tasks/relayhost.yml similarity index 98% rename from roles/linux-relayhost/tasks/main.yaml rename to roles/debian-base/tasks/relayhost.yml index db2c7f2..1af0549 100644 --- a/roles/linux-relayhost/tasks/main.yaml +++ b/roles/debian-base/tasks/relayhost.yml @@ -1,4 +1,4 @@ -- name: Install packages +- name: Install exim packages apt: name: exim4 state: present diff --git a/roles/linux-root/tasks/main.yaml b/roles/debian-base/tasks/root.yaml similarity index 100% rename from roles/linux-root/tasks/main.yaml rename to roles/debian-base/tasks/root.yaml diff --git a/roles/linux-sudoers/tasks/main.yaml b/roles/debian-base/tasks/sudoers.yml similarity index 78% rename from roles/linux-sudoers/tasks/main.yaml rename to roles/debian-base/tasks/sudoers.yml index f512867..83bee94 100644 --- a/roles/linux-sudoers/tasks/main.yaml +++ b/roles/debian-base/tasks/sudoers.yml @@ -4,8 +4,8 @@ state: present - name: Copy sudoers configuration file copy: - src: vn - dest: "/etc/sudoers.d/" + src: sudoers + dest: "/etc/sudoers.d/vn" mode: u=rw,g=r owner: root group: root diff --git a/roles/linux-ntp/tasks/main.yaml b/roles/debian-base/tasks/tymesyncd.yml similarity index 100% rename from roles/linux-ntp/tasks/main.yaml rename to roles/debian-base/tasks/tymesyncd.yml diff --git a/roles/linux-tzdata/tasks/main.yaml b/roles/debian-base/tasks/tzdata.yml similarity index 55% rename from roles/linux-tzdata/tasks/main.yaml rename to roles/debian-base/tasks/tzdata.yml index 60872cf..f5e34a8 100644 --- a/roles/linux-tzdata/tasks/main.yaml +++ b/roles/debian-base/tasks/tzdata.yml @@ -1,2 +1,2 @@ - name: Configure the time zone - script: set_timezone.sh + script: set-timezone.sh diff --git a/roles/linux-vim/tasks/main.yaml b/roles/debian-base/tasks/vim.yml similarity index 100% rename from roles/linux-vim/tasks/main.yaml rename to roles/debian-base/tasks/vim.yml diff --git a/roles/debian-base/tasks/vn-repo.yml b/roles/debian-base/tasks/vn-repo.yml new file mode 100644 index 0000000..c0fdfff --- /dev/null +++ b/roles/debian-base/tasks/vn-repo.yml @@ -0,0 +1,12 @@ +- name: Download vn-host Debian package + get_url: + url: "{{ vn_host.url }}/{{ vn_host.package }}" + dest: "/tmp/{{ vn_host.package }}" + mode: '0644' +- name: Install package + apt: + deb: "/tmp/{{ vn_host.package }}" +- name: Delete package + file: + path: "/tmp/{{ vn_host.package }}" + state: absent diff --git a/roles/linux-bacula/files/bacula-fd.conf.jd2 b/roles/debian-base/templates/bacula-fd.conf.j2 similarity index 88% rename from roles/linux-bacula/files/bacula-fd.conf.jd2 rename to roles/debian-base/templates/bacula-fd.conf.j2 index 5f02660..e205166 100644 --- a/roles/linux-bacula/files/bacula-fd.conf.jd2 +++ b/roles/debian-base/templates/bacula-fd.conf.j2 @@ -1,10 +1,10 @@ Director { Name = bacula-dir - Password = "$FDPASSWD" + Password = "{{ FDPASSWD }}" } Director { Name = bacula-mon - Password = "$FDMPASSWD" + Password = "{{ FDMPASSWD }}" Monitor = yes } FileDaemon { diff --git a/roles/linux-fail2ban/templates/jail.local.j2 b/roles/debian-base/templates/jail.local.j2 similarity index 100% rename from roles/linux-fail2ban/templates/jail.local.j2 rename to roles/debian-base/templates/jail.local.j2 diff --git a/roles/linux-fail2ban/vars/main.yaml b/roles/debian-base/vars/main.yml similarity index 53% rename from roles/linux-fail2ban/vars/main.yaml rename to roles/debian-base/vars/main.yml index dc675b0..a0b2eab 100644 --- a/roles/linux-fail2ban/vars/main.yaml +++ b/roles/debian-base/vars/main.yml @@ -3,3 +3,6 @@ fail2ban: bantime: 600 maxretry: 4 ignore: 127.0.0.0/8 10.0.0.0/16 +vn_host: + url: http://apt.verdnatura.es/pool/main/v/vn-host + package: vn-host_2.0.2_all.deb diff --git a/roles/linux-auth/files/nslcd.conf b/roles/debian-guest/files/nslcd.conf similarity index 94% rename from roles/linux-auth/files/nslcd.conf rename to roles/debian-guest/files/nslcd.conf index 0a12872..858edce 100644 --- a/roles/linux-auth/files/nslcd.conf +++ b/roles/debian-guest/files/nslcd.conf @@ -8,7 +8,7 @@ idle_timelimit 60 base dc=verdnatura,dc=es binddn cn=nss,ou=admins,dc=verdnatura,dc=es -bindpw passwordblablabla +bindpw password pagesize 500 filter group (&(objectClass=posixGroup)(cn=sysadmin)) diff --git a/roles/linux-auth/tasks/main.yaml b/roles/debian-guest/tasks/auth.yml similarity index 93% rename from roles/linux-auth/tasks/main.yaml rename to roles/debian-guest/tasks/auth.yml index da30777..d576a73 100644 --- a/roles/linux-auth/tasks/main.yaml +++ b/roles/debian-guest/tasks/auth.yml @@ -19,7 +19,7 @@ state: present with_items: - regexp: "^bindpw" - line: "bindpw {{ bindpw_password }}" + line: "bindpw {{ nslcd_password }}" - name: Configure nsswitch to use NSLCD lineinfile: dest: /etc/nsswitch.conf diff --git a/roles/debian-guest/tasks/main.yaml b/roles/debian-guest/tasks/main.yaml deleted file mode 100644 index e1125c9..0000000 --- a/roles/debian-guest/tasks/main.yaml +++ /dev/null @@ -1,3 +0,0 @@ -- include_role: - name: linux-auth - when: false diff --git a/roles/debian-guest/tasks/main.yml b/roles/debian-guest/tasks/main.yml new file mode 100644 index 0000000..3245538 --- /dev/null +++ b/roles/debian-guest/tasks/main.yml @@ -0,0 +1,2 @@ +- include_tasks: auth.yml + when: false diff --git a/roles/linux-autofs/files/auto.homes b/roles/debian-qemu/files/auto.homes similarity index 100% rename from roles/linux-autofs/files/auto.homes rename to roles/debian-qemu/files/auto.homes diff --git a/roles/linux-autofs/files/homes.autofs b/roles/debian-qemu/files/homes.autofs similarity index 100% rename from roles/linux-autofs/files/homes.autofs rename to roles/debian-qemu/files/homes.autofs diff --git a/roles/debian-qemu/tasks/agent.yml b/roles/debian-qemu/tasks/agent.yml new file mode 100644 index 0000000..db2b4ee --- /dev/null +++ b/roles/debian-qemu/tasks/agent.yml @@ -0,0 +1,4 @@ +- name: Install QEMU guest agent + apt: + name: qemu-guest-agent + state: present diff --git a/roles/linux-autofs/handlers/main.yaml b/roles/debian-qemu/tasks/autofs.yml similarity index 100% rename from roles/linux-autofs/handlers/main.yaml rename to roles/debian-qemu/tasks/autofs.yml diff --git a/roles/debian-qemu/tasks/main.yaml b/roles/debian-qemu/tasks/hotplug.yml similarity index 82% rename from roles/debian-qemu/tasks/main.yaml rename to roles/debian-qemu/tasks/hotplug.yml index cab7e7f..4dc9a34 100644 --- a/roles/debian-qemu/tasks/main.yaml +++ b/roles/debian-qemu/tasks/hotplug.yml @@ -1,7 +1,3 @@ -- name: Install QEMU guest agent - apt: - name: qemu-guest-agent - state: present - name: Configure udev hotplug rules copy: src: 80-hotplug-cpu-mem.rules diff --git a/roles/debian-qemu/tasks/main.yml b/roles/debian-qemu/tasks/main.yml new file mode 100644 index 0000000..3820ce9 --- /dev/null +++ b/roles/debian-qemu/tasks/main.yml @@ -0,0 +1,3 @@ +- import_tasks: agent.yml +- import_tasks: hotplug.yml +- import_tasks: autofs.yml diff --git a/roles/debian-qemu/vars/main.yml b/roles/debian-qemu/vars/main.yml new file mode 100644 index 0000000..05ae960 --- /dev/null +++ b/roles/debian-qemu/vars/main.yml @@ -0,0 +1 @@ +homes_path: /mnt/homes diff --git a/roles/linux-upgrade/tasks/main.yaml b/roles/debian-upgrade/tasks/main.yaml similarity index 100% rename from roles/linux-upgrade/tasks/main.yaml rename to roles/debian-upgrade/tasks/main.yaml diff --git a/roles/freeradius/tasks/main.yaml b/roles/freeradius/tasks/main.yaml deleted file mode 100644 index c3c8dc0..0000000 --- a/roles/freeradius/tasks/main.yaml +++ /dev/null @@ -1,156 +0,0 @@ -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# Install and configure FREERADIUS TOTP -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# install packages if there are not present in the system -- name: install packagesfor freeradiusotp if is not in the system - apt: - name: "{{ item }}" - state: present - with_items: - - freeradius - - freeradius-ldap - - libpam-google-authenticator - - python3-qrcode - - zip - - mutt -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# config symbolic files to enable modules -- name: create a symbolic link - ansible.builtin.file: - src: "{{ item.src }}" - dest: "{{ item.dest }}" - owner: freerad - group: freerad - state: link - force: yes - loop: -# - { src: '"{{ freeradius_mods_enabled_folder }}"ldap', dest: '"{{ freeradius_mods_available_folder }}"ldap' } -# - { src: '"{{ freeradius_mods_enabled_folder }}"pam', dest: '"{{ freeradius_mods_available_folder }}"pam' } - - { src: '{{ freeradius_mods_available_folder }}ldap', dest: '{{ freeradius_mods_enabled_folder }}ldap' } - - { src: '{{ freeradius_mods_available_folder }}pam', dest: '{{ freeradius_mods_enabled_folder }}pam' } -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# config default file /etc/freeradius/3.0/sites-enabled/default -- name: config default file - ansible.builtin.template: - src: default.j2 - dest: "{{ freeradius_default_config }}" - owner: freerad - group: freerad - mode: '0640' - backup: yes -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# config default file /etc/freeradius/3.0/mods-available/ldap -#- name: config ldap file -# ansible.builtin.template: -# src: ldap.j2 -# dest: "{{ freeradius_mod_ldap }}" -# owner: freerad -# group: freerad -# mode: '0640' -# backup: yes -# paso1 - copy -- name: copy file ldap - copy: - src: ldap - dest: "{{ freeradius_mod_ldap }}" - owner: freerad - group: freerad - mode: '0640' - backup: yes -# paso2 - lineinfile password with vault -- name: add password with ansible vault to file ldap - lineinfile: - dest: "{{ freeradius_mod_ldap }}" - regexp: "{{item.regexp}}" - line: "{{item.line}}" - state: present - with_items: - - regexp: "^ password =" - line: " password = {{ bindradiusldap_password }}" -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# config default file /etc/freeradius/3.0/dictionary -- name: config dictionary file - ansible.builtin.template: - src: dictionary.j2 - dest: "{{ freeradius_dictionary_config }}" - owner: freerad - group: freerad - mode: '0640' - backup: yes -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# config default file /etc/freeradius/3.0/clients.conf -- name: config clients.conf file - ansible.builtin.template: - src: clients.j2 - dest: "{{ freeradius_clients_config }}" - owner: freerad - group: freerad - mode: '0640' - backup: yes -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# config default file /etc/freeradius/3.0/policy.d/filter -- name: config filter file - ansible.builtin.template: - src: filter.j2 - dest: "{{ freeradius_filter_config }}" - owner: freerad - group: freerad - mode: '0640' - backup: yes -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# config default file /etc/freeradius/3.0/radiusd.conf -- name: config radius.conf file - ansible.builtin.template: - src: radiusd.j2 - dest: "{{ freeradius_base_config }}" - owner: freerad - group: freerad - mode: '0640' - backup: yes - notify: restart freeradius -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# config default file /etc/pam.d/radiusd -- name: config pam radiusd file - ansible.builtin.template: - src: radiusdpam.j2 - dest: "{{ freeradius_pam_config }}" - owner: root - group: root - mode: '0644' -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# config default file /lib/systemd/system/freeradius.service -- name: config freeradius systemd service file - ansible.builtin.template: - src: freeradiusservice.j2 - dest: "{{ freeradius_service_config }}" - owner: root - group: root - mode: '0644' -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -# force systemd to reread configs -- name: Just force systemd to reread configs (2.4 and above) - ansible.builtin.systemd_service: - daemon_reload: true -# ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ \ No newline at end of file diff --git a/roles/freeradius/tasks/main.yml b/roles/freeradius/tasks/main.yml new file mode 100644 index 0000000..78a9f2a --- /dev/null +++ b/roles/freeradius/tasks/main.yml @@ -0,0 +1,97 @@ +- name: Install packagesfor freeradiusotp + apt: + name: "{{ item }}" + state: present + with_items: + - freeradius + - freeradius-ldap + - libpam-google-authenticator + - python3-qrcode + - zip + - mutt +- name: Create a symbolic link + ansible.builtin.file: + src: "{{ item.src }}" + dest: "{{ item.dest }}" + owner: freerad + group: freerad + state: link + force: yes + loop: + - { src: '{{ freeradius_mods_available_folder }}ldap', dest: '{{ freeradius_mods_enabled_folder }}ldap' } + - { src: '{{ freeradius_mods_available_folder }}pam', dest: '{{ freeradius_mods_enabled_folder }}pam' } +- name: config default file + ansible.builtin.template: + src: default.j2 + dest: "{{ freeradius_default_config }}" + owner: freerad + group: freerad + mode: '0640' + backup: yes +- name: Copy LDAP file + copy: + src: ldap + dest: "{{ freeradius_mod_ldap }}" + owner: freerad + group: freerad + mode: '0640' + backup: yes +- name: Add password to LDAP file + lineinfile: + dest: "{{ freeradius_mod_ldap }}" + regexp: "{{item.regexp}}" + line: "{{item.line}}" + state: present + with_items: + - regexp: "^ password =" + line: " password = {{ radius_ldap_password }}" +- name: Config dictionary file + ansible.builtin.template: + src: dictionary.j2 + dest: "{{ freeradius_dictionary_config }}" + owner: freerad + group: freerad + mode: '0640' + backup: yes +- name: Config clients.conf file + ansible.builtin.template: + src: clients.j2 + dest: "{{ freeradius_clients_config }}" + owner: freerad + group: freerad + mode: '0640' + backup: yes +- name: Config filter file + ansible.builtin.template: + src: filter.j2 + dest: "{{ freeradius_filter_config }}" + owner: freerad + group: freerad + mode: '0640' + backup: yes +- name: Config radius.conf file + ansible.builtin.template: + src: radiusd.j2 + dest: "{{ freeradius_base_config }}" + owner: freerad + group: freerad + mode: '0640' + backup: yes + notify: restart freeradius +- name: Config pam radiusd file + ansible.builtin.template: + src: radiusdpam.j2 + dest: "{{ freeradius_pam_config }}" + owner: root + group: root + mode: '0644' +- name: Config freeradius systemd service file + ansible.builtin.template: + src: freeradiusservice.j2 + dest: "{{ freeradius_service_config }}" + owner: root + group: root + mode: '0644' +- name: Just force systemd to reread configs (2.4 and above) + ansible.builtin.systemd_service: + daemon_reload: true diff --git a/roles/freeradius/templates/clients.j2 b/roles/freeradius/templates/clients.j2 index 0e865ae..fc6b9b3 100644 --- a/roles/freeradius/templates/clients.j2 +++ b/roles/freeradius/templates/clients.j2 @@ -1,4 +1,4 @@ client opnsense { ipaddr = 0.0.0.0/0 - secret = {{ bindradiusclient_password }} + secret = {{ radius_client_password }} } \ No newline at end of file diff --git a/roles/freeradius/vars/main.yaml b/roles/freeradius/vars/main.yaml index 53ea0da..5d83bfc 100644 --- a/roles/freeradius/vars/main.yaml +++ b/roles/freeradius/vars/main.yaml @@ -1,5 +1,3 @@ ---- -# vars file freeradius_base_folder: /etc/freeradius/3.0/ freeradius_mods_available_folder: "{{ freeradius_base_folder }}mods-available/" freeradius_mods_enabled_folder: "{{ freeradius_base_folder }}mods-enabled/" @@ -11,19 +9,5 @@ freeradius_clients_config: "{{ freeradius_base_folder }}clients.conf" freeradius_mod_ldap: "{{ freeradius_mods_available_folder }}ldap" freeradius_filter_config: "{{ freeradius_base_folder }}policy.d/filter" freeradius_daemon: freeradius -bindradiusldap_password: !vault | - $ANSIBLE_VAULT;1.1;AES256 - 31643037313539376337363739616361363339616235623433656131306539373030373731643934 - 3432656465343430366366646237326137656134346562360a306538303762313261616632643135 - 39316439653932396134646432633262326631363765643564306565636363356335653539656531 - 6234636463376364620a636133346337306437643939376531633564633737333133363065633031 - 61643731646163323636343837373761303930323961653663343135303731623133 -bindradiusclient_password: !vault | - $ANSIBLE_VAULT;1.1;AES256 - 62313333666335316231396365653635356639626563613738363137383434343437393833393934 - 6439646632303536393438306234323862363532393733630a356136393539363161346631623161 - 37636365653331333735353166646164613732303035613231353237343139623137396364643637 - 3261656465336435630a666466643734373830633933613266663631343730386530633839386239 - 62623434663130363637303035363434313566376661356362663238666166343534 freeradius_pam_config: /etc/pam.d/radiusd freeradius_service_config: /lib/systemd/system/freeradius.service diff --git a/roles/linux-auth/vars/main.yaml b/roles/linux-auth/vars/main.yaml deleted file mode 100644 index 1bc5a44..0000000 --- a/roles/linux-auth/vars/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ -bindpw_password: !vault | - $ANSIBLE_VAULT;1.1;AES256 - 30343461633538323832316231383362626636653864353535346461353937313131336135396162 - 3866623238353638323961363239373236393339333134380a313561363030306165393965396234 - 65316535626434333331633438613639633163643765633064363833303461363834653864646464 - 3133313233353730620a343536316266393637623563313563613332646630643632366439343764 - 30383935303161646339393361393130613266663337373364626635646430326465 diff --git a/roles/linux-autofs/tasks/main.yaml b/roles/linux-autofs/tasks/main.yaml deleted file mode 100644 index bfdb347..0000000 --- a/roles/linux-autofs/tasks/main.yaml +++ /dev/null @@ -1,38 +0,0 @@ -- name: Install packages for autofs - apt: - name: "{{ item }}" - state: present - with_items: - - nfs-common - - autofs - - libnfs-utils - - autofs-ldap -- name: Create homes directory - ansible.builtin.file: - path: "{{ path_mnt_homes }}" - state: directory - mode: '0755' -- name: Configure nsswitch - lineinfile: - path: /etc/nsswitch.conf - line: "automount: files" - notify: restart nslcd -- name: Add file homes.autofs configured to autofs - copy: - src: homes.autofs - dest: /etc/auto.master.d/homes.autofs - owner: root - group: root - mode: '0644' -- name: Add file /etc/auto.homes configured to the systemd - copy: - src: auto.homes - dest: /etc/auto.homes - owner: root - group: root - mode: '0644' - notify: restart autofs -- name: Service autofs service - service: - name: autofs - enabled: yes diff --git a/roles/linux-autofs/vars/main.yaml b/roles/linux-autofs/vars/main.yaml deleted file mode 100644 index 71f712c..0000000 --- a/roles/linux-autofs/vars/main.yaml +++ /dev/null @@ -1 +0,0 @@ -path_mnt_homes: /mnt/homes diff --git a/roles/linux-fail2ban/handlers/main.yaml b/roles/linux-fail2ban/handlers/main.yaml deleted file mode 100644 index d5fc7c4..0000000 --- a/roles/linux-fail2ban/handlers/main.yaml +++ /dev/null @@ -1,4 +0,0 @@ -- name: restart-fail2ban - service: - name: fail2ban - state: restarted diff --git a/roles/linux-hostname/tasks/main.yaml b/roles/linux-hostname/tasks/main.yml similarity index 100% rename from roles/linux-hostname/tasks/main.yaml rename to roles/linux-hostname/tasks/main.yml diff --git a/roles/linux-nrpe/handlers/main.yaml b/roles/linux-nrpe/handlers/main.yaml deleted file mode 100644 index 0399734..0000000 --- a/roles/linux-nrpe/handlers/main.yaml +++ /dev/null @@ -1,4 +0,0 @@ -- name: restart-nrpe - service: - name: nagios-nrpe-server - state: restarted diff --git a/roles/linux-ntp/handlers/main.yaml b/roles/linux-ntp/handlers/main.yaml deleted file mode 100644 index 530fefe..0000000 --- a/roles/linux-ntp/handlers/main.yaml +++ /dev/null @@ -1,4 +0,0 @@ -- name: restart systemd-timesyncd - service: - name: systemd-timesyncd - state: restarted \ No newline at end of file diff --git a/roles/linux-relayhost/handlers/main.yaml b/roles/linux-relayhost/handlers/main.yaml deleted file mode 100644 index 21e507a..0000000 --- a/roles/linux-relayhost/handlers/main.yaml +++ /dev/null @@ -1,4 +0,0 @@ -- name: restart-exim - service: - name: exim4 - state: restarted \ No newline at end of file diff --git a/roles/linux-root/handlers/main.yaml b/roles/linux-root/handlers/main.yaml deleted file mode 100644 index 4ca2b3a..0000000 --- a/roles/linux-root/handlers/main.yaml +++ /dev/null @@ -1,4 +0,0 @@ -- name: Restart SSH service - service: - name: ssh - state: restarted \ No newline at end of file diff --git a/roles/linux-secure-grub/handlers/main.yaml b/roles/linux-secure-grub/handlers/main.yml similarity index 100% rename from roles/linux-secure-grub/handlers/main.yaml rename to roles/linux-secure-grub/handlers/main.yml diff --git a/roles/linux-secure-grub/tasks/main.yaml b/roles/linux-secure-grub/tasks/main.yml similarity index 100% rename from roles/linux-secure-grub/tasks/main.yaml rename to roles/linux-secure-grub/tasks/main.yml diff --git a/roles/linux-vn-repo/tasks/main.yaml b/roles/linux-vn-repo/tasks/main.yaml deleted file mode 100644 index d515adf..0000000 --- a/roles/linux-vn-repo/tasks/main.yaml +++ /dev/null @@ -1,12 +0,0 @@ -- name: Download vn-host Debian package - get_url: - url: "{{ repo_url }}" - dest: "{{ package_path }}" - mode: '0644' -- name: Install package - apt: - deb: "{{ package_path }}" -- name: Delete package - file: - path: "{{ package_path }}" - state: absent diff --git a/roles/linux-vn-repo/vars/main.yaml b/roles/linux-vn-repo/vars/main.yaml deleted file mode 100644 index a66fb2a..0000000 --- a/roles/linux-vn-repo/vars/main.yaml +++ /dev/null @@ -1,2 +0,0 @@ -repo_url: http://apt.verdnatura.es/pool/main/v/vn-host/vn-host_2.0.2_all.deb -package_path: /tmp/vn-host_2.0.2_all.deb diff --git a/roles/nsupdate/meta/main.yaml b/roles/nsupdate/meta/main.yml similarity index 100% rename from roles/nsupdate/meta/main.yaml rename to roles/nsupdate/meta/main.yml diff --git a/roles/nsupdate/tasks/main.yaml b/roles/nsupdate/tasks/main.yml similarity index 87% rename from roles/nsupdate/tasks/main.yaml rename to roles/nsupdate/tasks/main.yml index f4e541c..797156d 100644 --- a/roles/nsupdate/tasks/main.yaml +++ b/roles/nsupdate/tasks/main.yml @@ -1,7 +1,7 @@ - name: Add or modify DNS records A to some IP community.general.nsupdate: key_name: "rndc-key" - key_secret: "{{ bind9secretkey_password }}" + key_secret: "{{ rndc_key }}" key_algorithm: "hmac-md5" server: "ns1.verdnatura.es" zone: "{{ zone_record }}" diff --git a/roles/nsupdate/vars/main.yaml b/roles/nsupdate/vars/main.yaml deleted file mode 100644 index 1960e50..0000000 --- a/roles/nsupdate/vars/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ -bind9secretkey_password: !vault | - $ANSIBLE_VAULT;1.1;AES256 - 36386562613235363931396632656535383336313537636431643338353438313231623839313031 - 3830616135393732353265666664353963393366343461630a633365396165653761353762383739 - 66303862376465626435633964313237643230653463353662343831646464633639383336323863 - 6139333234386565620a653438613165626131653834633931343766343162653932373161653362 - 38303139333536656263656163623333313234393666353766363565633732366165 diff --git a/roles/send-mail/tasks/main.yaml b/roles/send-mail/tasks/main.yml similarity index 87% rename from roles/send-mail/tasks/main.yaml rename to roles/send-mail/tasks/main.yml index 1b06a29..02b8597 100644 --- a/roles/send-mail/tasks/main.yaml +++ b/roles/send-mail/tasks/main.yml @@ -3,7 +3,7 @@ host: smtp.verdnatura.es port: 465 username: awx@verdnatura.es - password: "{{ bindsecretawx_password }}" + password: "{{ awx_smtp_password }}" to: sysadmin@verdnatura.es subject: Ansible-test body: System {{ ansible_hostname }} has been send successfully mail. diff --git a/roles/send-mail/vars/main.yaml b/roles/send-mail/vars/main.yaml deleted file mode 100644 index 3286258..0000000 --- a/roles/send-mail/vars/main.yaml +++ /dev/null @@ -1,7 +0,0 @@ -bindsecretawx_password: !vault | - $ANSIBLE_VAULT;1.1;AES256 - 62393936623766653737356136353765336265636136616330306537393638646663326663346138 - 3631616362363163393036613564623864383365633634660a366563363836363061623566393361 - 37633364633631333130346332613235303762316435313535613664323830656363353237373561 - 3866653365636431630a303262666662376662623862663461633361333037643863353135343836 - 61383730366664353730616331666139376234313562383163613736353231666533 -- 2.40.1 From 46b9c9d6be40b264acedd04f1bfc26a014938f3d Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 24 Sep 2024 09:38:32 +0200 Subject: [PATCH 07/20] refs #8025 awx role sudoers file renamed --- roles/awx/files/{awx => sudoers} | 0 roles/awx/tasks/main.yaml | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename roles/awx/files/{awx => sudoers} (100%) diff --git a/roles/awx/files/awx b/roles/awx/files/sudoers similarity index 100% rename from roles/awx/files/awx rename to roles/awx/files/sudoers diff --git a/roles/awx/tasks/main.yaml b/roles/awx/tasks/main.yaml index 9ccdbe0..de3aa70 100644 --- a/roles/awx/tasks/main.yaml +++ b/roles/awx/tasks/main.yaml @@ -16,8 +16,8 @@ state: present - name: Add user to sudoers copy: - src: awx - dest: /etc/sudoers.d/ + src: sudoers + dest: /etc/sudoers.d/awx mode: u=rw,g=r owner: root group: root -- 2.40.1 From fffa2796504d347e3497c48b752b7b96fb39e512 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 24 Sep 2024 09:45:24 +0200 Subject: [PATCH 08/20] refs #8025 autofs task restored --- roles/debian-qemu/handlers/main.yml | 8 ++++++ roles/debian-qemu/tasks/autofs.yml | 42 ++++++++++++++++++++++++----- 2 files changed, 44 insertions(+), 6 deletions(-) create mode 100644 roles/debian-qemu/handlers/main.yml diff --git a/roles/debian-qemu/handlers/main.yml b/roles/debian-qemu/handlers/main.yml new file mode 100644 index 0000000..0079561 --- /dev/null +++ b/roles/debian-qemu/handlers/main.yml @@ -0,0 +1,8 @@ +- name: restart-nslcd + service: + name: nslcd + state: restarted +- name: restart-autofs + service: + name: autofs + state: restarted \ No newline at end of file diff --git a/roles/debian-qemu/tasks/autofs.yml b/roles/debian-qemu/tasks/autofs.yml index b368265..049e21d 100644 --- a/roles/debian-qemu/tasks/autofs.yml +++ b/roles/debian-qemu/tasks/autofs.yml @@ -1,8 +1,38 @@ -- name: Restart nslcd - service: - name: nslcd - state: restarted -- name: Restart autofs +- name: Install autofs packages + apt: + name: "{{ item }}" + state: present + with_items: + - nfs-common + - autofs + - libnfs-utils + - autofs-ldap +- name: Create homes directory + ansible.builtin.file: + path: "{{ homes_path }}" + state: directory + mode: '0755' +- name: Configure nsswitch for autofs + lineinfile: + path: /etc/nsswitch.conf + line: "automount: files" + notify: restart-nslcd +- name: Add file homes.autofs configured to autofs + copy: + src: homes.autofs + dest: /etc/auto.master.d/homes.autofs + owner: root + group: root + mode: '0644' +- name: Add file /etc/auto.homes configured to the systemd + copy: + src: auto.homes + dest: /etc/auto.homes + owner: root + group: root + mode: '0644' + notify: restart-autofs +- name: Service autofs service service: name: autofs - state: restarted \ No newline at end of file + enabled: yes \ No newline at end of file -- 2.40.1 From 29bfaf6b3385d8a1146ab67b6ba2a188173110fe Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 24 Sep 2024 10:25:40 +0200 Subject: [PATCH 09/20] refs #8025 relayhost fixes, self vars moved to global --- group_vars/all.yml | 13 ++++++++++++- playbooks/{print-facts.yml => facts.yml} | 2 +- roles/debian-base/defaults/main.yaml | 6 +++--- roles/debian-base/tasks/main.yml | 7 ++++--- roles/debian-base/tasks/relayhost.yml | 19 ++++++++++++------- roles/debian-base/vars/main.yml | 4 ++-- roles/send-mail/tasks/main.yml | 2 +- 7 files changed, 35 insertions(+), 18 deletions(-) rename playbooks/{print-facts.yml => facts.yml} (81%) diff --git a/group_vars/all.yml b/group_vars/all.yml index 9625d61..09b751b 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -1,10 +1,21 @@ -awx_pub_key: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDjeIZVyppFK/dqOUa1PxgSeRVWk7MFmANYvSs+VHHnD4/BE//K8AxlxnyLl4e6jAcBFoIu1JLxbRKdOhx+Zgkq5OmEzp/XKzfEvnEU5CP+W2+5MwfkUQ3TetJsOoHiP/qYWPqqqfDFqNM1xs9am5Frv9BVu5pFiSO9oS14xVAlUOwnONQnRtAbuBOmMldpzxmuFY+Rs3G2MmokcOYrs5Z3TdCOG9bDGg8erzWklLW+aRYdXqMEZpwIZPcOFy6JXEyZ/9IpCLBN58IMr0RypFbgWb2Vo05iTI5j99Pzn//FgAhe6BXRyHSGOJ29hmKugt9sIY1N/H6aYqtTVR5EEIngY1XHtFywU1+qtYHMs8PB9Hl87zUkla0+S5Zn8q92y7DQFsOZ9ND6syEzWhiCP1ic3Wo76TVbuNoTW/XvgZnemx1epuOqDj9S7iGTSHMvvSop8z5hU2EQiVkgRPl4cM2fi0vF513ivq5IbCgg2VfXUOLM5E5y0TI7lzBriTtCuIk= awx@awx.verdnatura.es +sysadmin_mail: sysadmin@verdnatura.es +smtp_server: smtp.verdnatura.es +dc_net: "10.0.0.0/16" resolv: domain: verdnatura.es search: verdnatura.es resolvers: - '10.0.0.4' - '10.0.0.5' +awx_pub_key: > + ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDjeIZVyppFK/dqOUa1PxgSeRVWk7MFmANYvSs+VHHn + D4/BE//K8AxlxnyLl4e6jAcBFoIu1JLxbRKdOhx+Zgkq5OmEzp/XKzfEvnEU5CP+W2+5MwfkUQ3TetJs + OoHiP/qYWPqqqfDFqNM1xs9am5Frv9BVu5pFiSO9oS14xVAlUOwnONQnRtAbuBOmMldpzxmuFY+Rs3G2 + MmokcOYrs5Z3TdCOG9bDGg8erzWklLW+aRYdXqMEZpwIZPcOFy6JXEyZ/9IpCLBN58IMr0RypFbgWb2V + o05iTI5j99Pzn//FgAhe6BXRyHSGOJ29hmKugt9sIY1N/H6aYqtTVR5EEIngY1XHtFywU1+qtYHMs8PB + 9Hl87zUkla0+S5Zn8q92y7DQFsOZ9ND6syEzWhiCP1ic3Wo76TVbuNoTW/XvgZnemx1epuOqDj9S7iGT + SHMvvSop8z5hU2EQiVkgRPl4cM2fi0vF513ivq5IbCgg2VfXUOLM5E5y0TI7lzBriTtCuIk= + awx@awx.verdnatura.es nslcd_password: !vault | $ANSIBLE_VAULT;1.1;AES256 30343461633538323832316231383362626636653864353535346461353937313131336135396162 diff --git a/playbooks/print-facts.yml b/playbooks/facts.yml similarity index 81% rename from playbooks/print-facts.yml rename to playbooks/facts.yml index 91e79a3..aeb0d4f 100644 --- a/playbooks/print-facts.yml +++ b/playbooks/facts.yml @@ -8,4 +8,4 @@ var: ansible_facts - name: Print variable value debug: - msg: "Variable: {{ ansible_virtualization_type }}" + msg: "Variable: {{ awx_pub_key }}" diff --git a/roles/debian-base/defaults/main.yaml b/roles/debian-base/defaults/main.yaml index ed9eef3..7f95631 100644 --- a/roles/debian-base/defaults/main.yaml +++ b/roles/debian-base/defaults/main.yaml @@ -1,11 +1,11 @@ exim_dc_eximconfig_configtype: satellite -dc_other_hostnames: "{{ ansible_nodename }}" +dc_other_hostnames: "{{ ansible_fqdn }}" dc_local_interfaces: 127.0.0.1 -dc_readhost: "{{ ansible_nodename }}" +dc_readhost: "{{ ansible_fqdn }}" dc_relay_domains: "" dc_minimaldns: false dc_relay_nets: "" -dc_smarthost: smtp.verdnatura.es +dc_smarthost: "{{ smtp_server }}" CFILEMODE: 644 dc_use_split_config: false dc_hide_mailname: true diff --git a/roles/debian-base/tasks/main.yml b/roles/debian-base/tasks/main.yml index ed03574..88a86ad 100644 --- a/roles/debian-base/tasks/main.yml +++ b/roles/debian-base/tasks/main.yml @@ -1,8 +1,9 @@ - import_tasks: install.yml -- import_tasks: sudoers.yml +- import_tasks: locale.yml +- import_tasks: tzdata.yml - import_tasks: motd.yml - import_tasks: profile.yml - import_tasks: vim.yml -- import_tasks: locale.yml -- import_tasks: tzdata.yml +- import_tasks: sudoers.yml - import_tasks: nrpe.yml +- import_tasks: relayhost.yml diff --git a/roles/debian-base/tasks/relayhost.yml b/roles/debian-base/tasks/relayhost.yml index 1af0549..eab5dc9 100644 --- a/roles/debian-base/tasks/relayhost.yml +++ b/roles/debian-base/tasks/relayhost.yml @@ -2,7 +2,7 @@ apt: name: exim4 state: present -- name: Reconfigure relayhost +- name: Prepare exim configuration lineinfile: dest: /etc/exim4/update-exim4.conf.conf regexp: "{{ item.regexp }}" @@ -13,11 +13,11 @@ - regexp: '^dc_eximconfig_configtype' line: "dc_eximconfig_configtype='{{ exim_dc_eximconfig_configtype }}'" - regexp: '^dc_other_hostnames' - line: "dc_other_hostnames='{{ dc_other_hostnames }}'.verdnatura.es" + line: "dc_other_hostnames='{{ dc_other_hostnames }}'" - regexp: '^dc_local_interfaces' line: "dc_local_interfaces='{{ dc_local_interfaces }}'" - regexp: '^dc_readhost' - line: "dc_readhost='{{ dc_readhost }}'.verdnatura.es" + line: "dc_readhost='{{ dc_readhost }}'" - regexp: '^dc_relay_domains' line: "dc_relay_domains='{{ dc_relay_domains }}'" - regexp: '^dc_minimaldns' @@ -37,7 +37,12 @@ - regexp: '^dc_localdelivery' line: "dc_localdelivery='{{ dc_localdelivery }}'" notify: restart-exim - register: exim4_config -- name: Sending mail to verify exim4 config works - shell: echo "Verify send email from host {{ ansible_nodename }}.verdnatura.es with mailx , bye." | mailx -s "test mail verify exim4 for the host {{ ansible_nodename }}.verdnatura.es" -c rubenb@verdnatura.es,nada@verdnatura.es,juan@verdnatura.es,davidl@verdnatura.es sysadmin@verdnatura.es - when: exim4_config.changed + register: exim_config +- name: Update exim configuration + command: update-exim4.conf + when: exim_config.changed +- name: Sending mail to verify relay host configuration works + shell: > + echo "If you see this message, relayhost on {{ ansible_fqdn }} has been configured correctly." \ + | mailx -s "Relayhost test for {{ ansible_fqdn }}" "{{ sysadmin_mail }}" + when: exim_config.changed diff --git a/roles/debian-base/vars/main.yml b/roles/debian-base/vars/main.yml index a0b2eab..4fd5f1c 100644 --- a/roles/debian-base/vars/main.yml +++ b/roles/debian-base/vars/main.yml @@ -1,8 +1,8 @@ fail2ban: - email: sysamdmin@verdnatura.es + email: "{{ sysadmin_mail }}" bantime: 600 maxretry: 4 - ignore: 127.0.0.0/8 10.0.0.0/16 + ignore: "127.0.0.0/8 {{ dc_net }}" vn_host: url: http://apt.verdnatura.es/pool/main/v/vn-host package: vn-host_2.0.2_all.deb diff --git a/roles/send-mail/tasks/main.yml b/roles/send-mail/tasks/main.yml index 02b8597..f7dbc94 100644 --- a/roles/send-mail/tasks/main.yml +++ b/roles/send-mail/tasks/main.yml @@ -4,7 +4,7 @@ port: 465 username: awx@verdnatura.es password: "{{ awx_smtp_password }}" - to: sysadmin@verdnatura.es + to: "{{ sysadmin_mail }}" subject: Ansible-test body: System {{ ansible_hostname }} has been send successfully mail. delegate_to: localhost -- 2.40.1 From f033c92278bf303d3c4808c2d3f4a5d1cc79a724 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 24 Sep 2024 10:37:09 +0200 Subject: [PATCH 10/20] refs #8025 Code reorganization --- group_vars/all.yml | 7 ++++++- roles/debian-base/tasks/root.yaml | 4 ++-- roles/debian-base/tasks/sudoers.yml | 2 +- roles/debian-base/tasks/vim.yml | 2 +- roles/debian-base/templates/jail.local.j2 | 2 +- roles/debian-upgrade/tasks/main.yaml | 11 ++++------- roles/linux-hostname/tasks/main.yml | 4 ++-- roles/linux-secure-grub/handlers/main.yml | 2 +- roles/linux-secure-grub/tasks/main.yml | 8 +++----- roles/linux-secure-grub/vars/main.yaml | 3 +-- 10 files changed, 22 insertions(+), 23 deletions(-) diff --git a/group_vars/all.yml b/group_vars/all.yml index 09b751b..796f56d 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -50,4 +50,9 @@ awx_smtp_password: !vault | 3631616362363163393036613564623864383365633634660a366563363836363061623566393361 37633364633631333130346332613235303762316435313535613664323830656363353237373561 3866653365636431630a303262666662376662623862663461633361333037643863353135343836 - 61383730366664353730616331666139376234313562383163613736353231666533 \ No newline at end of file + 61383730366664353730616331666139376234313562383163613736353231666533 +grub_code: > + grub.pbkdf2.sha512.10000.C91C8756466E7DB535C77DB7FBDBF3D33A39A0712DE3A9AFD38BE22 + 29139E86F23C4E007E6B76DDFDBBE4B2B32764B4EFFECF208C70BA9FECC6BB3FF68A6BA05.8EA385 + 7B795AF29FF5C6E003E31EC4D79B84813175C7A56A8A12F3F30A19B501D7127C0307277FB37073EE + 0246BCFDA9BD4EDDC3A1EE8176D25CD37B7FB07AF7 diff --git a/roles/debian-base/tasks/root.yaml b/roles/debian-base/tasks/root.yaml index ad4407d..6e42647 100644 --- a/roles/debian-base/tasks/root.yaml +++ b/roles/debian-base/tasks/root.yaml @@ -1,6 +1,6 @@ - name: Delete default user user: - name: "{{ name_user }}" + name: "{{ default_user }}" state: absent remove: yes - name: Change root password @@ -9,7 +9,7 @@ password: "{{ ssh_password | password_hash('sha512') }}" - name: Configure bashrc lineinfile: - dest: "/root/.bashrc" + dest: /root/.bashrc regexp: "{{item.regexp}}" line: "{{item.line}}" state: present diff --git a/roles/debian-base/tasks/sudoers.yml b/roles/debian-base/tasks/sudoers.yml index 83bee94..e31f0eb 100644 --- a/roles/debian-base/tasks/sudoers.yml +++ b/roles/debian-base/tasks/sudoers.yml @@ -5,7 +5,7 @@ - name: Copy sudoers configuration file copy: src: sudoers - dest: "/etc/sudoers.d/vn" + dest: /etc/sudoers.d/vn mode: u=rw,g=r owner: root group: root diff --git a/roles/debian-base/tasks/vim.yml b/roles/debian-base/tasks/vim.yml index aa5ed3c..3b4a32a 100644 --- a/roles/debian-base/tasks/vim.yml +++ b/roles/debian-base/tasks/vim.yml @@ -5,7 +5,7 @@ - name: Copy vim configuration file copy: src: vimrc.local - dest: "/etc/vim/" + dest: /etc/vim/ mode: '644' owner: root group: root \ No newline at end of file diff --git a/roles/debian-base/templates/jail.local.j2 b/roles/debian-base/templates/jail.local.j2 index 74a65ce..838b4ed 100644 --- a/roles/debian-base/templates/jail.local.j2 +++ b/roles/debian-base/templates/jail.local.j2 @@ -7,7 +7,7 @@ bantime = {{ fail2ban.bantime }} findtime = {{ fail2ban.bantime }} maxretry = {{ fail2ban.maxretry }} destemail = {{ fail2ban.email }} -sender = root@ +sender = root@{{ ansible_fqdn }} banaction = nftables-multiport action = %(action_)s diff --git a/roles/debian-upgrade/tasks/main.yaml b/roles/debian-upgrade/tasks/main.yaml index 0674f4b..1949907 100644 --- a/roles/debian-upgrade/tasks/main.yaml +++ b/roles/debian-upgrade/tasks/main.yaml @@ -1,20 +1,17 @@ -- name: Checking if it's necessary to update - meta: end_host - when: update_enabled is not defined or not update_enabled -- name: update index of all packages +- name: Update APT package index ansible.builtin.apt: update_cache: true force_apt_get: true -- name: update all packages to their latest version +- name: Update all packages to their latest version ansible.builtin.apt: name: "*" state: latest force_apt_get: true -- name: upgrade the OS (apt-get full-upgrade) +- name: Upgrade the OS (apt-get full-upgrade) ansible.builtin.apt: upgrade: full force_apt_get: true -- name: autoremove packages unused dependency packages +- name: Autoremove unused packages ansible.builtin.apt: autoremove: true force_apt_get: true diff --git a/roles/linux-hostname/tasks/main.yml b/roles/linux-hostname/tasks/main.yml index 773e7d6..e052922 100644 --- a/roles/linux-hostname/tasks/main.yml +++ b/roles/linux-hostname/tasks/main.yml @@ -7,7 +7,7 @@ - name: Replace /etc/hosts template: src: hosts.j2 - dest: "/etc/hosts" + dest: /etc/hosts owner: root group: root mode: '0644' @@ -15,7 +15,7 @@ - name: Replace /etc/resolv.conf template: src: resolv.j2 - dest: "/etc/resolv.conf" + dest: /etc/resolv.conf owner: root group: root mode: '0644' diff --git a/roles/linux-secure-grub/handlers/main.yml b/roles/linux-secure-grub/handlers/main.yml index 9f3d6e6..5b3125c 100644 --- a/roles/linux-secure-grub/handlers/main.yml +++ b/roles/linux-secure-grub/handlers/main.yml @@ -1,2 +1,2 @@ - name: grub-register - command: update-grub \ No newline at end of file + command: update-grub diff --git a/roles/linux-secure-grub/tasks/main.yml b/roles/linux-secure-grub/tasks/main.yml index d2876e3..dd4acb3 100644 --- a/roles/linux-secure-grub/tasks/main.yml +++ b/roles/linux-secure-grub/tasks/main.yml @@ -1,9 +1,7 @@ -- name: GRUB password boot protection +- name: GRUB boot password protection blockinfile: path: /etc/grub.d/40_custom block: | - set superusers="{{ user_grub }}" - password_pbkdf2 {{ user_grub }} {{ code_grub }} + set superusers="{{ grub_user }}" + password_pbkdf2 {{ grub_user }} {{ grub_code }} notify: grub-register - when: secure_grub_enabled - diff --git a/roles/linux-secure-grub/vars/main.yaml b/roles/linux-secure-grub/vars/main.yaml index d61c32d..875fc0c 100644 --- a/roles/linux-secure-grub/vars/main.yaml +++ b/roles/linux-secure-grub/vars/main.yaml @@ -1,2 +1 @@ -user_grub: admin -code_grub: grub.pbkdf2.sha512.10000.C91C8756466E7DB535C77DB7FBDBF3D33A39A0712DE3A9AFD38BE2229139E86F23C4E007E6B76DDFDBBE4B2B32764B4EFFECF208C70BA9FECC6BB3FF68A6BA05.8EA3857B795AF29FF5C6E003E31EC4D79B84813175C7A56A8A12F3F30A19B501D7127C0307277FB37073EE0246BCFDA9BD4EDDC3A1EE8176D25CD37B7FB07AF7 +grub_user: admin -- 2.40.1 From 876dc606068a9077ea5ae5d4058de7a693941560 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 24 Sep 2024 10:38:19 +0200 Subject: [PATCH 11/20] refs #8025 Duplicated hosts removed --- hosts | 3 --- 1 file changed, 3 deletions(-) diff --git a/hosts b/hosts index f22db36..c150cfa 100644 --- a/hosts +++ b/hosts @@ -86,9 +86,6 @@ 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 -tftp ansible_host=tftp.backup.dc.verdnatura.es -core-agent ansible_host=core-agent.core.dc.verdnatura.es -core-proxy ansible_host=core-proxy.core.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 -- 2.40.1 From e43c32fdf0bc8c17531d3e45f6cd491f1a38fa44 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 24 Sep 2024 12:20:42 +0200 Subject: [PATCH 12/20] refs #8025 README added, intentories dir, lab inventory added --- README.md | 36 ++++++++++++++++ ansible.cfg | 2 +- .../group_vars}/all.yml | 0 inventories/laboratory | 42 +++++++++++++++++++ hosts => inventories/production | 0 playbooks/facts.yml | 4 +- playbooks/test.yml | 2 +- 7 files changed, 81 insertions(+), 5 deletions(-) create mode 100644 README.md rename {group_vars => inventories/group_vars}/all.yml (100%) create mode 100644 inventories/laboratory rename hosts => inventories/production (100%) diff --git a/README.md b/README.md new file mode 100644 index 0000000..87fe507 --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# Verdnatura Ansible playbooks + +Collection of Ansible playbooks used in the Verdnatura server farm. + +## Install Ansible + +Instal Ansible on Debian. +``` +apt install ansible +``` + +## Run playbook + +Before merging changes into protected branches, playbooks should be tested +locally to ensure they work properly. + +To runan Ansible playbook locally on a temporary host without registering it in +the inventory (on the fly) run the following command. +``` +ansible-playbook playbooks/test.yml -u root -i , +``` + +*Note the comma at the end of the hostname or IP.* + +## Basic playbooks + +* **facts.yml**: Collect and display facts from a host. +* **ping.yml**: Checking that a host is alive and reachable by Ansible. +* **test.yml**: Test an specific role. Don't forget to undo changes before pushing! +* **debian.yml**: Setup base Debian server + +## Documentation + +* https://docs.ansible.com/ansible/latest/reference_appendices/config.html +* https://docs.ansible.com/ansible/latest/collections/ansible/builtin/gather_facts_module.html +* https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_vars_facts.html diff --git a/ansible.cfg b/ansible.cfg index e5b1de3..c46bb72 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -1,6 +1,6 @@ [defaults] roles_path = ./roles -inventory = ./hosts +inventory = ./inventories/production gathering = smart interpreter_python = auto_silent remote_user = awx-user diff --git a/group_vars/all.yml b/inventories/group_vars/all.yml similarity index 100% rename from group_vars/all.yml rename to inventories/group_vars/all.yml diff --git a/inventories/laboratory b/inventories/laboratory new file mode 100644 index 0000000..08668e3 --- /dev/null +++ b/inventories/laboratory @@ -0,0 +1,42 @@ +[laboratory] +corelab-proxy1 ansible_host=corelab-proxy1.lab.verdnatura.es +docker-itlab ansible_host=docker-itlab.lab.verdnatura.es +zammad ansible_host=zammad.lab.verdnatura.es +matrix ansible_host=matrix.lab.verdnatura.es +ansible-test ansible_host=ansible-test.lab.verdnatura.es + +[network] +opnsense1-test ansible_host=opnsense1-test.lab.verdnatura.es +opnsense2-test ansible_host=opnsense2-test.lab.verdnatura.es + +[cephlab] +cephlab01 ansible_host=cephlab01.lab.verdnatura.es +cephlab02 ansible_host=cephlab02.lab.verdnatura.es +cephlab03 ansible_host=cephlab03.lab.verdnatura.es + +[cephtest] +cephtest01 ansible_host=cephtest01.lab.verdnatura.es +cephtest02 ansible_host=cephtest02.lab.verdnatura.es +cephtest03 ansible_host=cephtest03.lab.verdnatura.es + +[kubepre] +kubepre-helm ansible_host=kubepre-helm.lab.verdnatura.es +kubepre-proxy1 ansible_host=kubepre-proxy1.lab.verdnatura.es +kubepre-proxy2 ansible_host=kubepre-proxy2.lab.verdnatura.es +kubepre-master1 ansible_host=kubepre-master1.lab.verdnatura.es +kubepre-master2 ansible_host=kubepre-master2.lab.verdnatura.es +kubepre-master3 ansible_host=kubepre-master3.lab.verdnatura.es +kubepre-worker1 ansible_host=kubepre-worker1.lab.verdnatura.es +kubepre-worker2 ansible_host=kubepre-worker2.lab.verdnatura.es +kubepre-worker3 ansible_host=kubepre-worker3.lab.verdnatura.es +kubepre-worker4 ansible_host=kubepre-worker4.lab.verdnatura.es + +[kubetest] +kubetest-helm ansible_host=kubetest-helm.lab.verdnatura.es +kubetest-master01 ansible_host=kubetest-master01.lab.verdnatura.es +kubetest-master02 ansible_host=kubetest-master02.lab.verdnatura.es +kubetest-master03 ansible_host=kubetest-master03.lab.verdnatura.es +kubetest-worker01 ansible_host=kubetest-worker01.lab.verdnatura.es +kubetest-worker02 ansible_host=kubetest-worker02.lab.verdnatura.es +kubetest-worker03 ansible_host=kubetest-worker03.lab.verdnatura.es +kubetest-worker04 ansible_host=kubetest-worker04.lab.verdnatura.es diff --git a/hosts b/inventories/production similarity index 100% rename from hosts rename to inventories/production diff --git a/playbooks/facts.yml b/playbooks/facts.yml index aeb0d4f..04ad610 100644 --- a/playbooks/facts.yml +++ b/playbooks/facts.yml @@ -1,5 +1,3 @@ -# https://docs.ansible.com/ansible/latest/playbook_guide/playbooks_vars_facts.html - - hosts: all gather_facts: yes tasks: @@ -8,4 +6,4 @@ var: ansible_facts - name: Print variable value debug: - msg: "Variable: {{ awx_pub_key }}" + msg: "Variable: {{ ansible_fqdn }}" diff --git a/playbooks/test.yml b/playbooks/test.yml index 8032bff..65fd033 100644 --- a/playbooks/test.yml +++ b/playbooks/test.yml @@ -2,4 +2,4 @@ tasks: - name: Test role import_role: - name: linux-base + name: debian-base -- 2.40.1 From 4f20789f61dbb65d11383e89f9c3c81894023db4 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 24 Sep 2024 12:21:50 +0200 Subject: [PATCH 13/20] refs #8025 Collections README line break fixes --- collections/README.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/collections/README.md b/collections/README.md index d3ea311..9566a14 100644 --- a/collections/README.md +++ b/collections/README.md @@ -1,4 +1,4 @@ -# Collections +## Collections The purpose of collections is get more modules and plugins to use in ansible. @@ -11,7 +11,8 @@ In *awx-operator* container, execute: ansible-galaxy collection install -r requirements.yml ``` -Where `requirements.yml` we need to specify the list of collections that we want to install: +Where `requirements.yml` we need to specify the list of collections that we +want to install: ``` collections: - name: community.general @@ -23,7 +24,8 @@ collections: # List collections -To list installed collections, run `ansible-galaxy collection list` (inside awx operator container) +To list installed collections, run `ansible-galaxy collection list` (inside awx +operator container) * https://docs.ansible.com/ansible/latest/collections_guide/collections_listing.html -- 2.40.1 From c8b0d9fb1cfe7253eed2e629462d7f07b248f4aa Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 24 Sep 2024 12:27:24 +0200 Subject: [PATCH 14/20] refs #8025 send-mail made generic --- inventories/group_vars/all.yml | 1 + playbooks/debian-upgrade.yml | 6 ++-- playbooks/freeradius.yml | 6 ++-- playbooks/nsupdate.yml | 6 ++-- playbooks/ping.yml | 2 +- playbooks/send-mail.yml | 7 ++--- playbooks/test.yml | 6 ++-- playbooks/windows-ping.yml | 4 +-- playbooks/windows-update.yml | 50 +++++++++++++++++----------------- roles/send-mail/tasks/main.yml | 10 +++---- 10 files changed, 49 insertions(+), 49 deletions(-) diff --git a/inventories/group_vars/all.yml b/inventories/group_vars/all.yml index 796f56d..9578df8 100644 --- a/inventories/group_vars/all.yml +++ b/inventories/group_vars/all.yml @@ -7,6 +7,7 @@ resolv: resolvers: - '10.0.0.4' - '10.0.0.5' +awx_email: awx@verdnatura.es awx_pub_key: > ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDjeIZVyppFK/dqOUa1PxgSeRVWk7MFmANYvSs+VHHn D4/BE//K8AxlxnyLl4e6jAcBFoIu1JLxbRKdOhx+Zgkq5OmEzp/XKzfEvnEU5CP+W2+5MwfkUQ3TetJs diff --git a/playbooks/debian-upgrade.yml b/playbooks/debian-upgrade.yml index 8215cb2..76ef424 100644 --- a/playbooks/debian-upgrade.yml +++ b/playbooks/debian-upgrade.yml @@ -1,5 +1,5 @@ - hosts: all tasks: - - name: Upgrade system - import_role: - name: debian-upgrade + - name: Upgrade system + import_role: + name: debian-upgrade diff --git a/playbooks/freeradius.yml b/playbooks/freeradius.yml index 2783ef1..086923b 100644 --- a/playbooks/freeradius.yml +++ b/playbooks/freeradius.yml @@ -1,5 +1,5 @@ - hosts: all tasks: - - name: Install and configure Freeradius with TOTP - import_role: - name: freeradius \ No newline at end of file + - name: Install and configure Freeradius with TOTP + import_role: + name: freeradius \ No newline at end of file diff --git a/playbooks/nsupdate.yml b/playbooks/nsupdate.yml index 454bb43..0b575f7 100644 --- a/playbooks/nsupdate.yml +++ b/playbooks/nsupdate.yml @@ -1,5 +1,5 @@ - hosts: ns1 tasks: - - name: Configure zone with nsupdate - import_role: - name: nsupdate \ No newline at end of file + - name: Configure zone with nsupdate + import_role: + name: nsupdate \ No newline at end of file diff --git a/playbooks/ping.yml b/playbooks/ping.yml index 55c6a68..8661c51 100644 --- a/playbooks/ping.yml +++ b/playbooks/ping.yml @@ -1,3 +1,3 @@ - hosts: all tasks: - - ping: \ No newline at end of file + - ping: \ No newline at end of file diff --git a/playbooks/send-mail.yml b/playbooks/send-mail.yml index 64aad1e..201fece 100644 --- a/playbooks/send-mail.yml +++ b/playbooks/send-mail.yml @@ -1,7 +1,6 @@ - hosts: localhost become: no - become_method: sudo tasks: - - name: Send mail - import_role: - name: config-send-mail + - name: Send mail + import_role: + name: send-mail diff --git a/playbooks/test.yml b/playbooks/test.yml index 65fd033..a056033 100644 --- a/playbooks/test.yml +++ b/playbooks/test.yml @@ -1,5 +1,5 @@ - hosts: all tasks: - - name: Test role - import_role: - name: debian-base + - name: Test role + import_role: + name: debian-base diff --git a/playbooks/windows-ping.yml b/playbooks/windows-ping.yml index 4fef2f5..0dd8dea 100644 --- a/playbooks/windows-ping.yml +++ b/playbooks/windows-ping.yml @@ -1,5 +1,5 @@ - name: Ping Windows hosts hosts: all tasks: - - name: Ping Windows hosts - ansible.windows.win_ping: \ No newline at end of file + - name: Ping Windows hosts + ansible.windows.win_ping: \ No newline at end of file diff --git a/playbooks/windows-update.yml b/playbooks/windows-update.yml index b3181a1..4a6cc78 100644 --- a/playbooks/windows-update.yml +++ b/playbooks/windows-update.yml @@ -1,28 +1,28 @@ - hosts: all serial: 1 tasks: - - block: - - name: Check if there are missing updates - win_updates: state=searched - register: update_count - - block: - - name: Install missing updates only if at least one is missing - win_updates: - category_names: '*' - #- Application - #- Connectors - #- DefinitionUpdates - #- DeveloperKits - #- FeaturePacks - #- Guidance - #- ServicePacks - #- Tools - #- UpdateRollups - #- CriticalUpdates - #- SecurityUpdates - log_path: C:\Win_Template_Patch.log - register: update_result - - name: Reboot, if needed. - win_reboot: - when: update_result.reboot_required - when: update_count.found_update_count|int >= 1 \ No newline at end of file + - block: + - name: Check if there are missing updates + win_updates: state=searched + register: update_count + - block: + - name: Install missing updates only if at least one is missing + win_updates: + category_names: '*' + #- Application + #- Connectors + #- DefinitionUpdates + #- DeveloperKits + #- FeaturePacks + #- Guidance + #- ServicePacks + #- Tools + #- UpdateRollups + #- CriticalUpdates + #- SecurityUpdates + log_path: C:\Win_Template_Patch.log + register: update_result + - name: Reboot, if needed. + win_reboot: + when: update_result.reboot_required + when: update_count.found_update_count|int >= 1 \ No newline at end of file diff --git a/roles/send-mail/tasks/main.yml b/roles/send-mail/tasks/main.yml index f7dbc94..071e12f 100644 --- a/roles/send-mail/tasks/main.yml +++ b/roles/send-mail/tasks/main.yml @@ -1,10 +1,10 @@ -- name: Send mail using Verdnatura SMTP servers +- name: Send mail using own SMTP server community.general.mail: - host: smtp.verdnatura.es + host: "{{ smtp_server }}" port: 465 - username: awx@verdnatura.es + username: "{{ awx_email }}" password: "{{ awx_smtp_password }}" to: "{{ sysadmin_mail }}" - subject: Ansible-test - body: System {{ ansible_hostname }} has been send successfully mail. + subject: Ansible test + body: System {{ ansible_fqdn }} has sent the email successfully. delegate_to: localhost -- 2.40.1 From f8a765e47ca54f2cdaf047c9280d4b7980f24e13 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 24 Sep 2024 12:28:10 +0200 Subject: [PATCH 15/20] refs #8025 README fix --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 87fe507..0439c18 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,8 @@ apt install ansible Before merging changes into protected branches, playbooks should be tested locally to ensure they work properly. -To runan Ansible playbook locally on a temporary host without registering it in -the inventory (on the fly) run the following command. +To run an Ansible playbook locally on a temporary host without registering it +in the inventory (on the fly) run the following command. ``` ansible-playbook playbooks/test.yml -u root -i , ``` -- 2.40.1 From 74c03400eb7297ed979a9af490a860c0f0fb573c Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 24 Sep 2024 12:28:52 +0200 Subject: [PATCH 16/20] refs #8025 README fix --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0439c18..946fe7a 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ ansible-playbook playbooks/test.yml -u root -i , *Note the comma at the end of the hostname or IP.* -## Basic playbooks +## Common playbooks * **facts.yml**: Collect and display facts from a host. * **ping.yml**: Checking that a host is alive and reachable by Ansible. -- 2.40.1 From 06986ae2bdcb3a347d66b2a05a3fc8d7a07bfb07 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 24 Sep 2024 13:01:01 +0200 Subject: [PATCH 17/20] refs #8025 windows playbooks abreviated to win --- playbooks/{windows-ping.yml => win-ping.yml} | 0 playbooks/{windows-update.yml => win-update.yml} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename playbooks/{windows-ping.yml => win-ping.yml} (100%) rename playbooks/{windows-update.yml => win-update.yml} (100%) diff --git a/playbooks/windows-ping.yml b/playbooks/win-ping.yml similarity index 100% rename from playbooks/windows-ping.yml rename to playbooks/win-ping.yml diff --git a/playbooks/windows-update.yml b/playbooks/win-update.yml similarity index 100% rename from playbooks/windows-update.yml rename to playbooks/win-update.yml -- 2.40.1 From 4845d08548892c82937bfa2e3b3351fd300cb1a9 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 24 Sep 2024 13:04:59 +0200 Subject: [PATCH 18/20] refs #8025 remove path quotes --- roles/debian-base/tasks/locale.yml | 2 +- roles/debian-base/tasks/profile.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/debian-base/tasks/locale.yml b/roles/debian-base/tasks/locale.yml index 593a7cc..33efdf0 100644 --- a/roles/debian-base/tasks/locale.yml +++ b/roles/debian-base/tasks/locale.yml @@ -1,6 +1,6 @@ - name: Enable locale languages lineinfile: - dest: "/etc/locale.gen" + dest: /etc/locale.gen regexp: "{{item.regexp}}" line: "{{item.line}}" state: present diff --git a/roles/debian-base/tasks/profile.yml b/roles/debian-base/tasks/profile.yml index 65a7b53..7b02471 100644 --- a/roles/debian-base/tasks/profile.yml +++ b/roles/debian-base/tasks/profile.yml @@ -1,7 +1,7 @@ - name: Copy profile configuration file copy: src: profile.sh - dest: "/etc/profile.d/vn.sh" + dest: /etc/profile.d/vn.sh mode: '644' owner: root group: root -- 2.40.1 From e3344b7ef2651f576c07bead85730958ef6e7d8e Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 24 Sep 2024 13:10:26 +0200 Subject: [PATCH 19/20] refs #8025 README run playbook clarified --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 946fe7a..56c9c28 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,7 @@ apt install ansible Before merging changes into protected branches, playbooks should be tested locally to ensure they work properly. -To run an Ansible playbook locally on a temporary host without registering it -in the inventory (on the fly) run the following command. +Launch playbook on the fly on a host not declared in the inventory. ``` ansible-playbook playbooks/test.yml -u root -i , ``` -- 2.40.1 From 0307c105b29cb64eafcc45dfcd2344ee0c5d4df3 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Tue, 24 Sep 2024 14:26:55 +0200 Subject: [PATCH 20/20] refs #8025 vault keys fixes --- inventories/group_vars/all.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/inventories/group_vars/all.yml b/inventories/group_vars/all.yml index 9578df8..eb4e821 100644 --- a/inventories/group_vars/all.yml +++ b/inventories/group_vars/all.yml @@ -17,35 +17,35 @@ awx_pub_key: > 9Hl87zUkla0+S5Zn8q92y7DQFsOZ9ND6syEzWhiCP1ic3Wo76TVbuNoTW/XvgZnemx1epuOqDj9S7iGT SHMvvSop8z5hU2EQiVkgRPl4cM2fi0vF513ivq5IbCgg2VfXUOLM5E5y0TI7lzBriTtCuIk= awx@awx.verdnatura.es -nslcd_password: !vault | +nslcd_password: !vault > $ANSIBLE_VAULT;1.1;AES256 30343461633538323832316231383362626636653864353535346461353937313131336135396162 3866623238353638323961363239373236393339333134380a313561363030306165393965396234 65316535626434333331633438613639633163643765633064363833303461363834653864646464 3133313233353730620a343536316266393637623563313563613332646630643632366439343764 30383935303161646339393361393130613266663337373364626635646430326465 -rndc_key: !vault | +rndc_key: !vault > $ANSIBLE_VAULT;1.1;AES256 36386562613235363931396632656535383336313537636431643338353438313231623839313031 3830616135393732353265666664353963393366343461630a633365396165653761353762383739 66303862376465626435633964313237643230653463353662343831646464633639383336323863 6139333234386565620a653438613165626131653834633931343766343162653932373161653362 38303139333536656263656163623333313234393666353766363565633732366165 -radius_ldap_password: !vault | +radius_ldap_password: !vault > $ANSIBLE_VAULT;1.1;AES256 31643037313539376337363739616361363339616235623433656131306539373030373731643934 3432656465343430366366646237326137656134346562360a306538303762313261616632643135 39316439653932396134646432633262326631363765643564306565636363356335653539656531 6234636463376364620a636133346337306437643939376531633564633737333133363065633031 61643731646163323636343837373761303930323961653663343135303731623133 -radius_client_password: !vault | +radius_client_password: !vault > $ANSIBLE_VAULT;1.1;AES256 62313333666335316231396365653635356639626563613738363137383434343437393833393934 6439646632303536393438306234323862363532393733630a356136393539363161346631623161 37636365653331333735353166646164613732303035613231353237343139623137396364643637 3261656465336435630a666466643734373830633933613266663631343730386530633839386239 62623434663130363637303035363434313566376661356362663238666166343534 -awx_smtp_password: !vault | +awx_smtp_password: !vault > $ANSIBLE_VAULT;1.1;AES256 62393936623766653737356136353765336265636136616330306537393638646663326663346138 3631616362363163393036613564623864383365633634660a366563363836363061623566393361 -- 2.40.1