2023-10-31 10:18:47 +00:00
|
|
|
---
|
|
|
|
|
2023-12-19 14:55:30 +00:00
|
|
|
- hosts: '{{ ip_addr }}'
|
2023-10-31 10:18:47 +00:00
|
|
|
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
|
2024-02-15 09:23:34 +00:00
|
|
|
when: root-user_enabled is defined and root-user_enabled
|
2024-02-15 09:25:25 +00:00
|
|
|
tags: config-root-user_config
|
2023-10-31 10:18:47 +00:00
|
|
|
|
2024-02-12 12:11:05 +00:00
|
|
|
- name: "[CONFIG HOSTNAME] Configure hostname"
|
|
|
|
import_role:
|
|
|
|
name: config-hostname
|
2024-02-15 09:23:34 +00:00
|
|
|
when: hostname_enabled is defined and hostname_enabled
|
2024-02-15 09:25:25 +00:00
|
|
|
tags: config-hostname_config
|
2024-02-12 12:11:05 +00:00
|
|
|
|
2024-02-14 14:52:35 +00:00
|
|
|
- name: "[CONFIG HOSTS FILE] Configure hosts file"
|
|
|
|
import_role:
|
|
|
|
name: config-hosts
|
2024-02-15 09:23:34 +00:00
|
|
|
when: hosts_enabled is defined and hosts_enabled
|
2024-02-15 09:25:25 +00:00
|
|
|
tags: config-hosts_config_config
|
2024-02-14 14:52:35 +00:00
|
|
|
|
2024-02-14 16:07:15 +00:00
|
|
|
- name: "[CONFIG RESOLV FILE] Configure resolv file"
|
|
|
|
import_role:
|
|
|
|
name: config-resolv
|
2024-02-15 09:23:34 +00:00
|
|
|
when: resolv_enabled is defined and resolv_enabled
|
2024-02-15 09:25:25 +00:00
|
|
|
tags: config-resolv_config
|
2023-10-31 10:18:47 +00:00
|
|
|
|
2024-02-12 10:31:56 +00:00
|
|
|
- name: "[CONFIG UPDATE] Config update"
|
|
|
|
import_role:
|
|
|
|
name: config-update-and-upgrade-packages
|
2024-02-15 09:23:34 +00:00
|
|
|
when: update_enabled is defined and update_enabled
|
2024-02-15 09:25:25 +00:00
|
|
|
tags: config-update-and-upgrade-packages_config
|
2024-02-12 10:31:56 +00:00
|
|
|
|
|
|
|
- name: "[CONFIG INSTALL PACKAGES] Install packages"
|
|
|
|
import_role:
|
|
|
|
name: config-install-packages
|
2024-02-15 09:23:34 +00:00
|
|
|
when: packages_enabled is defined and packages_enabled
|
2024-02-15 09:25:25 +00:00
|
|
|
tags: config-install-packages_config
|
2024-02-12 10:31:56 +00:00
|
|
|
|
|
|
|
- name: "[CONFIG RELAYHOST SMTP] Config relayhost smtp"
|
|
|
|
import_role:
|
|
|
|
name: config-relayhost-smtp
|
2024-02-15 09:23:34 +00:00
|
|
|
when: relay-host_enabled is defined and relay-host_enabled
|
2024-02-15 09:25:25 +00:00
|
|
|
tags: config-relayhost-smtp_config
|
2024-02-12 10:31:56 +00:00
|
|
|
|
|
|
|
- name: "[CONFIG CENTRALIZED AUTH] Config centralized auth"
|
|
|
|
import_role:
|
|
|
|
name: config-centralized-auth
|
2024-02-15 09:23:34 +00:00
|
|
|
when: centralized-auth_enabled is defined and centralized-auth_enabled
|
2024-02-15 09:25:25 +00:00
|
|
|
tags: config-centralized-auth_config
|
2024-02-12 10:31:56 +00:00
|
|
|
|
|
|
|
- name: "[CONFIG SUDOERS] Config sudoers"
|
|
|
|
import_role:
|
|
|
|
name: config-sudoers
|
2024-02-15 09:23:34 +00:00
|
|
|
when: sudoers_enabled is defined and sudoers_enabled
|
2024-02-15 09:25:25 +00:00
|
|
|
tags: config-sudoers_config
|
2024-02-12 10:31:56 +00:00
|
|
|
|
2024-02-15 09:23:34 +00:00
|
|
|
- name: "[CONFIG SECURE GRUB] configure secure grub"
|
|
|
|
import_role:
|
|
|
|
name: config-secure-grub
|
|
|
|
when: secure-grub_enabled is defined and secure-grub_enabled
|
2024-02-15 09:25:25 +00:00
|
|
|
tags: config-secure-grub_config
|
2024-02-12 10:31:56 +00:00
|
|
|
|
|
|
|
- name: "[CONFIG VIM OPTIONS] Config vim options"
|
|
|
|
import_role:
|
|
|
|
name: config-vim-options
|
2024-02-15 09:23:34 +00:00
|
|
|
when: vim-options_enabled is defined and vim-options_enabled
|
2024-02-15 09:25:25 +00:00
|
|
|
tags: config-vim-options_config
|
2024-02-12 10:31:56 +00:00
|
|
|
|
|
|
|
- name: "[CONFIG MOTD] Config motd"
|
|
|
|
import_role:
|
|
|
|
name: config-motd
|
2024-02-15 09:23:34 +00:00
|
|
|
when: motd_enabled is defined and motd_enabled
|
2024-02-15 09:25:25 +00:00
|
|
|
tags: config-motd_config
|
2024-02-12 10:31:56 +00:00
|
|
|
|
2024-02-15 09:23:34 +00:00
|
|
|
- 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
|
2024-02-15 09:25:25 +00:00
|
|
|
tags: config-hot-plug_config
|
2024-02-12 10:31:56 +00:00
|
|
|
|
2023-10-31 10:18:47 +00:00
|
|
|
- name: "[CONFIG LOCALES] Set locales"
|
|
|
|
import_role:
|
|
|
|
name: config-locales
|
2024-02-15 09:23:34 +00:00
|
|
|
when: locales_enabled is defined and locales_enabled
|
2024-02-15 09:25:25 +00:00
|
|
|
tags: config-locales_config
|
2023-10-31 10:18:47 +00:00
|
|
|
|
|
|
|
- name: "[CONFIG TZDATA] Set timezone"
|
|
|
|
import_role:
|
|
|
|
name: config-tzdata
|
2024-02-15 09:23:34 +00:00
|
|
|
when: tzdata_enabled is defined and tzdata_enabled
|
2024-02-15 09:25:25 +00:00
|
|
|
tags: config-tzdata_config
|
2023-10-31 10:18:47 +00:00
|
|
|
|
|
|
|
- name: "[CONFIG REPO VN] Add-repos-vn"
|
|
|
|
import_role:
|
|
|
|
name: config-repo-vn
|
2024-02-15 09:23:34 +00:00
|
|
|
when: repo-vn_enabled is defined and repo-vn_enabled
|
2024-02-15 09:25:25 +00:00
|
|
|
tags: config-repo-vn_config
|
2023-10-31 10:18:47 +00:00
|
|
|
|
|
|
|
- name: "[CONFIG FAIL2BAN] Install and configure fail2ban service"
|
|
|
|
import_role:
|
|
|
|
name: config-fail2ban
|
2024-02-15 09:23:34 +00:00
|
|
|
when: fail2ban_enabled is defined and fail2ban_enabled
|
2024-02-15 09:25:25 +00:00
|
|
|
tags: config-fail2ban_config
|
2023-10-31 10:18:47 +00:00
|
|
|
|
|
|
|
- name: "[CONFIG NAGIOS NRPE] Install and configure nagios nrpe service"
|
|
|
|
import_role:
|
|
|
|
name: config-nagios-nrpe
|
2024-02-15 09:23:34 +00:00
|
|
|
when: nagios-nrpe_enabled is defined and nagios-nrpe_enabled
|
2024-02-15 09:25:25 +00:00
|
|
|
tags: config-nagios-nrpe_config
|
2023-10-31 10:18:47 +00:00
|
|
|
|
|
|
|
- name: "[CONFIG SERVER TYPE] Install guest side"
|
|
|
|
import_role:
|
|
|
|
name: config-server-type
|
2024-02-15 09:23:34 +00:00
|
|
|
when: server-type_enabled is defined and server-type_enabled
|
2024-02-15 09:25:25 +00:00
|
|
|
tags: config-server-type_config
|
2023-10-31 10:18:47 +00:00
|
|
|
|
|
|
|
- name: "[CONFIG NTP] Install and configure ntp"
|
|
|
|
import_role:
|
|
|
|
name: config-ntp
|
2024-02-15 09:23:34 +00:00
|
|
|
when: ntp_enabled is defined and ntp_enabled
|
2024-02-15 09:25:25 +00:00
|
|
|
tags: config-ntp_config
|
2023-10-31 10:18:47 +00:00
|
|
|
|
2023-11-06 16:15:10 +00:00
|
|
|
- name: "[CONFIG AUTOFS HOMES] Install and configure AUTOFS HOMES"
|
|
|
|
import_role:
|
|
|
|
name: config-autofs-homes
|
2024-02-15 09:23:34 +00:00
|
|
|
when: autofs-homes_enabled is defined and autofs-homes_enabled
|
2024-02-15 09:25:25 +00:00
|
|
|
tags: config-autofs-homes_config
|
2023-11-06 16:15:10 +00:00
|
|
|
|
2023-10-31 10:18:47 +00:00
|
|
|
- name: "[CONFIG ZABBIX AGENT] Install and configure ZABBIX AGENT"
|
|
|
|
import_role:
|
|
|
|
name: config-zabbix-agent
|
2024-02-15 09:23:34 +00:00
|
|
|
when: zabbix-agent_enabled is defined and zabbix-agent_enabled
|
2024-02-15 09:25:25 +00:00
|
|
|
tags: config-zabbix-agent_config
|
2023-10-31 10:18:47 +00:00
|
|
|
|
|
|
|
#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
|