From be31d974575bbf4b8d2ef7348408d19f4852435f Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Tue, 7 Sep 2021 12:00:07 +0200 Subject: [PATCH] Update to 2021-09-07 12:00 --- roles/common/vars/Ubuntu-20.yml | 10 ++++++++++ roles/fusioninventory_agent/tasks/install_Debian.yml | 8 ++++++-- roles/mailman/tasks/facts.yml | 2 ++ roles/mailman/templates/settings.py.j2 | 11 +++-------- roles/ntp_client/vars/Ubuntu-20.yml | 6 ++++++ roles/repo_zabbix/tasks/Debian.yml | 3 +-- roles/sssd_ad_auth/templates/deb_pam_common_session.j2 | 3 +++ roles/zabbix_agent/vars/Ubuntu-20.yml | 14 ++++++++++++++ 8 files changed, 45 insertions(+), 12 deletions(-) create mode 100644 roles/common/vars/Ubuntu-20.yml create mode 100644 roles/ntp_client/vars/Ubuntu-20.yml create mode 100644 roles/zabbix_agent/vars/Ubuntu-20.yml diff --git a/roles/common/vars/Ubuntu-20.yml b/roles/common/vars/Ubuntu-20.yml new file mode 100644 index 0000000..11709c8 --- /dev/null +++ b/roles/common/vars/Ubuntu-20.yml @@ -0,0 +1,10 @@ +--- + +system_distro_utils: + - apt-transport-https + - openssh-client + - netcat + - xz-utils + - liblz4-tool + - sshfs + - zstd diff --git a/roles/fusioninventory_agent/tasks/install_Debian.yml b/roles/fusioninventory_agent/tasks/install_Debian.yml index c374844..5d16452 100644 --- a/roles/fusioninventory_agent/tasks/install_Debian.yml +++ b/roles/fusioninventory_agent/tasks/install_Debian.yml @@ -1,6 +1,8 @@ --- -- when: ansible_distribution_major_version is version('11', '<') +- when: > + (ansible_distribution == 'Debian' and ansible_distribution_major_version is version('11', '<')) or + (ansible_distribution == 'Ubuntu' and ansible_distribution_major_version is version('20', '<')) block: - name: Install dependencies apt: @@ -31,7 +33,9 @@ tags: inventory -- when: ansible_distribution_major_version is version('11', '>=') +- when: > + (ansible_distribution == 'Debian' and ansible_distribution_major_version is version('11', '>=')) or + (ansible_distribution == 'Ubuntu' and ansible_distribution_major_version is version('20', '>=')) block: - name: Install FusionInventory Agent apt: diff --git a/roles/mailman/tasks/facts.yml b/roles/mailman/tasks/facts.yml index 8671ead..ddea34c 100644 --- a/roles/mailman/tasks/facts.yml +++ b/roles/mailman/tasks/facts.yml @@ -68,6 +68,7 @@ - import_tasks: ../includes/get_rand_pass.yml vars: - pass_file: "{{ mailman_root_dir }}/meta/ansible_rest_pass" + - complex: False - set_fact: mailman_rest_pass={{ rand_pass }} when: mailman_rest_pass is not defined tags: mailman @@ -77,6 +78,7 @@ - import_tasks: ../includes/get_rand_pass.yml vars: - pass_file: "{{ mailman_root_dir }}/meta/ansible_hyperkitty_api_key" + - complex: False - set_fact: mailman_hyperkitty_api_key={{ rand_pass }} when: mailman_hyperkitty_api_key is not defined tags: mailman diff --git a/roles/mailman/templates/settings.py.j2 b/roles/mailman/templates/settings.py.j2 index c8a1e5d..8ac95c4 100644 --- a/roles/mailman/templates/settings.py.j2 +++ b/roles/mailman/templates/settings.py.j2 @@ -16,6 +16,9 @@ DATABASES = { 'PASSWORD': '{{ mailman_db_pass }}', 'HOST': '{{ mailman_db_server }}', 'PORT': '{{ mailman_db_port }}', +{% if mailman_db_engine != 'postgres' %} + 'OPTIONS': {'charset': 'utf8mb4'} +{% endif %} } } @@ -43,11 +46,6 @@ ALLOWED_HOSTS = [ '{{ mailman_public_url | urlsplit("hostname") }}' ] -#: Current Django Site being served. This is used to customize the web host -#: being used to serve the current website. For more details about Django -#: site, see: https://docs.djangoproject.com/en/dev/ref/contrib/sites/ -SITE_ID = 1 - # Set this to a new secret value. SECRET_KEY = '{{ mailman_secret_key }}' @@ -88,9 +86,6 @@ CSRF_COOKIE_HTTPONLY = True X_FRAME_OPTIONS = 'DENY' TIME_ZONE = '{{ (system_tz is defined) | ternary(system_tz, 'UTC') }}' -USE_I18N = True -USE_L10N = True -USE_TZ = True ACCOUNT_AUTHENTICATION_METHOD = "username_email" ACCOUNT_EMAIL_REQUIRED = True diff --git a/roles/ntp_client/vars/Ubuntu-20.yml b/roles/ntp_client/vars/Ubuntu-20.yml new file mode 100644 index 0000000..1f3c307 --- /dev/null +++ b/roles/ntp_client/vars/Ubuntu-20.yml @@ -0,0 +1,6 @@ +--- + +ntp_ntpd_service: ntp +ntp_chrony_service: chrony +ntp_chrony_conf: /etc/chrony/chrony.conf +ntp_chrony_keyfile: /etc/chrony/chrony.keys diff --git a/roles/repo_zabbix/tasks/Debian.yml b/roles/repo_zabbix/tasks/Debian.yml index b101992..0196449 100644 --- a/roles/repo_zabbix/tasks/Debian.yml +++ b/roles/repo_zabbix/tasks/Debian.yml @@ -8,7 +8,6 @@ - name: Add Zabbix repo apt_repository: - # Waiting for Zabbix repo to support bullseye, point it to buster - repo: deb http://repo.zabbix.com/zabbix/{{ zabbix_major_version }}/debian {{ (ansible_distribution_release == 'bullseye') | ternary('buster',ansible_distribution_release) }} main + repo: deb http://repo.zabbix.com/zabbix/{{ zabbix_major_version }}/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} main filename: zabbix tags: repo diff --git a/roles/sssd_ad_auth/templates/deb_pam_common_session.j2 b/roles/sssd_ad_auth/templates/deb_pam_common_session.j2 index ca57a4c..147abba 100644 --- a/roles/sssd_ad_auth/templates/deb_pam_common_session.j2 +++ b/roles/sssd_ad_auth/templates/deb_pam_common_session.j2 @@ -1,6 +1,9 @@ session [default=1] pam_permit.so session requisite pam_deny.so session required pam_permit.so +{% if ansible_service_mgr == 'systemd' %} +session optional pam_systemd.so +{% endif %} session optional pam_oddjob_mkhomedir.so skel=/etc/skel umask=0077 session optional pam_sss.so session required pam_unix.so diff --git a/roles/zabbix_agent/vars/Ubuntu-20.yml b/roles/zabbix_agent/vars/Ubuntu-20.yml new file mode 100644 index 0000000..b09c3a4 --- /dev/null +++ b/roles/zabbix_agent/vars/Ubuntu-20.yml @@ -0,0 +1,14 @@ +--- + +zabbix_agent_packages: + - zabbix-agent + - openssl + - git + - libconfig-simple-perl + - libjson-perl + - libfile-which-perl + - smartmontools + - lm-sensors + - patch + - fping + - libstatistics-descriptive-perl