ansible-roles/evolinux-base/tasks/main.yml
Mathieu Trossevin 7c632352a0
Replace the include module with include_tasks or import_tasks
The behaviour of the `include` module is badly defined (it try to choose
between statically importing the tasks and dynamically including them)
and can cause problems depending on any number of constraints (mostly if
it choose the wrong behaviour).

Replace it with the `import_tasks` (always statically import tasks) unless
the `include` is in a loop in which case we replace it with
`include_tasks` (always dynamically include tasks).
2023-01-03 14:43:42 +01:00

136 lines
3.3 KiB
YAML

---
- name: "System compatibility checks"
assert:
that:
- ansible_distribution == "Debian"
- ansible_distribution_major_version is version('8', '>=')
msg: only compatible with Debian >= 8
- name: Apt configuration
include_role:
name: evolix/apt
vars:
apt_install_basics: "{{ evolinux_apt_replace_default_sources }}"
apt_install_evolix_public: "{{ evolinux_apt_public_sources }}"
apt_upgrade: "{{ evolinux_apt_upgrade }}"
apt_basics_components: "{{ 'main contrib non-free' if ansible_virtualization_role == 'host' else 'main' }}"
when: evolinux_apt_include | bool
- name: /etc versioning with Git
include_role:
name: evolix/etc-git
when: evolinux_etcgit_include | bool
- name: /etc/evolinux base
import_tasks: etc-evolinux.yml
when: evolinux_etcevolinux_include | bool
- name: Hostname
import_tasks: hostname.yml
when: evolinux_hostname_include | bool
- name: Kernel tuning
import_tasks: kernel.yml
when: evolinux_kernel_include | bool
- name: Fstab configuration
import_tasks: fstab.yml
when: evolinux_fstab_include | bool
- name: Packages
import_tasks: packages.yml
when: evolinux_packages_include | bool
- name: System settings
import_tasks: system.yml
when: evolinux_system_include | bool
- name: Minifirewall
include_role:
name: evolix/minifirewall
when: evolinux_minifirewall_include | bool
- name: Evomaintenance
include_role:
name: evolix/evomaintenance
when: evolinux_evomaintenance_include | bool
- name: SSH configuration
import_tasks: ssh.yml
when: evolinux_ssh_include | bool
### disabled because of a memory leak
# - name: Create evolinux users
# include_role:
# name: evolix/evolinux-users
# when: evolinux_users_include
- name: Root user configuration
import_tasks: root.yml
when: evolinux_root_include | bool
- name: Postfix
import_tasks: postfix.yml
when: evolinux_postfix_include | bool
- name: Logs management
import_tasks: logs.yml
when: evolinux_logs_include | bool
- name: Default index page
import_tasks: default_www.yml
when: evolinux_default_www_include | bool
- name: Hardware drivers and tools
import_tasks: hardware.yml
when: evolinux_hardware_include | bool
- name: Customize for Online.net
import_tasks: provider_online.yml
when: evolinux_provider_online_include | bool
- name: Customize for Orange FCE
import_tasks: provider_orange_fce.yml
when: evolinux_provider_orange_fce_include | bool
- name: Override Log2mail service
import_tasks: log2mail.yml
when: evolinux_log2mail_include | bool
- import_tasks: motd.yml
when: evolinux_motd_include | bool
- import_tasks: utils.yml
when: evolinux_utils_include | bool
- name: Munin
include_role:
name: evolix/munin
when: evolinux_munin_include | bool
- name: Nagios/NRPE
include_role:
name: evolix/nagios-nrpe
when: evolinux_nagios_nrpe_include | bool
- name: fail2ban
include_role:
name: evolix/fail2ban
when: evolinux_fail2ban_include | bool
- name: Evocheck
include_role:
name: evolix/evocheck
when: evolinux_evocheck_include | bool
- name: Listupgrade
include_role:
name: evolix/listupgrade
when: evolinux_listupgrade_include | bool
- name: Generate ldif script
include_role:
name: evolix/generate-ldif
when: evolinux_generateldif_include | bool