From e2460c10d128bce6f8e9ebb13cf5b36fe7486878 Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Tue, 3 Jan 2017 12:11:01 +0100 Subject: [PATCH] evolinux-base: tasks groups disabling --- evolinux-base/README.md | 21 ++++++--- evolinux-base/defaults/main.yml | 80 ++++++++++++++++++++++++--------- evolinux-base/tasks/main.yml | 45 ++++++------------- 3 files changed, 89 insertions(+), 57 deletions(-) diff --git a/evolinux-base/README.md b/evolinux-base/README.md index 375b1fad..243d4b5f 100644 --- a/evolinux-base/README.md +++ b/evolinux-base/README.md @@ -4,11 +4,22 @@ Various tasks for Evolinux setup. ## Tasks -* `system.yml` : -* `apt.yml` : -* `install_tools.yml` : -* `root.yml` : -* `logs.yml` : +* `hostname` : +* `kernel` : +* `apt` : +* `fstab` : +* `packages` : +* `system` : +* `root` : +* `ssh` : +* `postfix` : +* `logs` : +* `default_www` : +* `hardware` : +* `provider_online` : +* `provider_orange_fce` : + +Each task file is included in the `main.yml` file with a condition based on a variable like `evolinux_tasks_hostname` (mostly `True` by default). The variables can be set to `False` to disable groups of tasks. Finer grained tasks disabling is done in each group of tasks. ## Available variables diff --git a/evolinux-base/defaults/main.yml b/evolinux-base/defaults/main.yml index 364e0a20..9eb05354 100644 --- a/evolinux-base/defaults/main.yml +++ b/evolinux-base/defaults/main.yml @@ -1,4 +1,7 @@ --- + +# email variables + general_alert_email: "root@localhost" reboot_alert_email: Null apt_alert_email: Null @@ -8,48 +11,83 @@ postfix_alias_email: Null # hostname +evolinux_tasks_hostname: True + evolinux_hostname: "{{ ansible_hostname }}" evolinux_domain: "{{ ansible_domain }}" evolinux_fqdn: "{{ ansible_fqdn }}" evolinux_internal_hostname: "{{ evolinux_hostname }}" -# apt - -evolinux_apt_upgrade: True -evolinux_apt_repositories_components: "main" -evolinux_apt_hooks: True -evolinux_apt_remove_aptitude: True - -# postfix - -evolinux_postfix_purge_exim: True - # kernel +evolinux_tasks_kernel: True + evolinux_kernel_reboot_after_panic: True evolinux_kernel_disable_tcp_timestamps: True evolinux_kernel_reduce_swapiness: True evolinux_kernel_cve20165696: True -# providers +# apt -evolinux_provider_online: False -evolinux_provider_orange_fce: False +evolinux_tasks_apt: True + +evolinux_apt_upgrade: True +evolinux_apt_repositories_components: "main" +evolinux_apt_hooks: True +evolinux_apt_remove_aptitude: True + +# fstab + +evolinux_tasks_fstab: True + +# packages + +evolinux_tasks_packages: True + +evolinux_delete_nfs: True + +# system + +evolinux_tasks_system: True + +evolinux_ntp_server: Null +evolinux_timezone: "Europe/Paris" + +# root + +evolinux_tasks_root: True + +# ssh + +evolinux_tasks_ssh: True + +evolinux_ssh_password_auth_addresses: [] +evolinux_ssh_disable_root: True + +# postfix + +evolinux_tasks_postfix: True + +evolinux_postfix_purge_exim: True + +# logs + +evolinux_tasks_logs: True # default www +evolinux_tasks_default_www: True + evolinux_default_www_redirect_url: "http://evolix.fr" evolinux_default_www_ssl_subject: "/CN={{ ansible_fqdn }}" evolinux_default_www_nginx_enabled: False evolinux_default_www_apache_enabled: False -# ssh +# hardware -evolinux_ssh_password_auth_addresses: [] -evolinux_ssh_disable_root: True +evolinux_tasks_hardware: True -# misc. +# providers -evolinux_ntp_server: Null -evolinux_delete_nfs: True -evolinux_timezone: "Europe/Paris" +evolinux_tasks_provider_online: False +evolinux_tasks_provider_orange_fce: False diff --git a/evolinux-base/tasks/main.yml b/evolinux-base/tasks/main.yml index 930f4d82..3069a6e5 100644 --- a/evolinux-base/tasks/main.yml +++ b/evolinux-base/tasks/main.yml @@ -1,73 +1,56 @@ --- - name: Hostname include: hostname.yml - tags: - - evolinux_hostname + when: evolinux_tasks_hostname - name: Kernel tuning include: kernel.yml - tags: - - evolinux_kernel + when: evolinux_tasks_kernel - name: Apt configuration and packages install include: apt.yml - tags: - - evolinux_apt + when: evolinux_tasks_apt - name: Fstab configuration include: fstab.yml - tags: - - evolinux_fstab + when: evolinux_tasks_fstab - name: Packages include: packages.yml - tags: - - evolinux_packages + when: evolinux_tasks_packages - name: System settings include: system.yml - tags: - - evolinux_system + when: evolinux_tasks_system - name: Root user configuration include: root.yml - tags: - - evolinux_root + when: evolinux_tasks_root - name: SSH configuration include: ssh.yml - tags: - - evolinux_ssh + when: evolinux_tasks_ssh - name: Postfix include: postfix.yml - tags: - - evolinux_postfix + when: evolinux_tasks_postfix - name: Logs management include: logs.yml - tags: - - evolinux_logs - + when: evolinux_tasks_logs - name: Default index page include: default_www.yml - tags: - - evolinux_default_www + when: evolinux_tasks_default_www - name: Hardware drivers and tools include: hardware.yml - tags: - - evolinux_hardware + when: evolinux_tasks_hardware - name: Customize for Online.net include: provider_online.yml - tags: - - evolinux_provider_online - when: evolinux_provider_online + when: evolinux_tasks_provider_online - name: Customize for Orange FCE include: provider_orange_fce.yml - tags: - - evolinux_provider_orange_fce - when: evolinux_provider_orange_fce + when: evolinux_tasks_provider_orange_fce