Browse Source

Replace version_compare() with version()

tags/10.0.0^2
Jérémy Lecour 7 months ago
committed by Jérémy Lecour
parent
commit
7283e34077
40 changed files with 83 additions and 82 deletions
  1. +1
    -0
      CHANGELOG.md
  2. +1
    -1
      apache/tasks/main.yml
  3. +1
    -1
      apt/tasks/main.yml
  4. +1
    -1
      certbot/tasks/main.yml
  5. +3
    -3
      elasticsearch/tasks/tmpdir.yml
  6. +1
    -1
      etc-git/tasks/main.yml
  7. +1
    -1
      evoacme/tasks/main.yml
  8. +1
    -1
      evoacme/templates/nginx.conf.j2
  9. +1
    -1
      evolinux-base/tasks/fstab.yml
  10. +1
    -1
      evolinux-base/tasks/hardware.yml
  11. +1
    -1
      evolinux-base/tasks/main.yml
  12. +3
    -3
      evolinux-base/tasks/packages.yml
  13. +1
    -1
      evolinux-base/tasks/root.yml
  14. +3
    -3
      evolinux-base/tasks/ssh.yml
  15. +3
    -3
      evolinux-base/tasks/system.yml
  16. +1
    -1
      evolinux-base/templates/logs/zsyslog.j2
  17. +1
    -1
      evolinux-users/tasks/main.yml
  18. +2
    -2
      evolinux-users/tasks/ssh.yml
  19. +1
    -1
      evolinux-users/tasks/sudo.yml
  20. +4
    -4
      evolinux-users/tasks/user.yml
  21. +1
    -1
      lxc/tasks/main.yml
  22. +2
    -2
      lxc/templates/default.conf
  23. +1
    -1
      mongodb/tasks/main.yml
  24. +3
    -3
      mysql-oracle/tasks/utils.yml
  25. +3
    -3
      mysql/tasks/main.yml
  26. +2
    -2
      mysql/tasks/utils.yml
  27. +2
    -2
      packweb-apache/tasks/main.yml
  28. +2
    -2
      packweb-apache/tasks/phpmyadmin.yml
  29. +1
    -1
      php/tasks/config_fpm.yml
  30. +1
    -1
      php/tasks/main.yml
  31. +2
    -2
      postgresql/tasks/main.yml
  32. +1
    -1
      postgresql/templates/postgresql.conf.j2
  33. +4
    -4
      redis/tasks/instance-server.yml
  34. +3
    -3
      redis/tasks/nrpe.yml
  35. +1
    -1
      redis/templates/redis.conf.j2
  36. +15
    -15
      squid/tasks/main.yml
  37. +1
    -1
      varnish/tasks/main.yml
  38. +2
    -2
      webapps/evoadmin-web/tasks/packages.yml
  39. +2
    -2
      webapps/evoadmin-web/tasks/user.yml
  40. +2
    -2
      webapps/evoadmin-web/tasks/web.yml

+ 1
- 0
CHANGELOG.md View File

@@ -42,6 +42,7 @@ The **patch** part changes incrementally at each release.
* evobackup-client role to configure a machine for backups with bkctld(8)

### Changed
* replace version_compare() with version()s
* removed some deprecations for Ansible 2.7
* apache: improve permissions in save_apache_status script
* apt: hold packages only if package is installed


+ 1
- 1
apache/tasks/main.yml View File

@@ -12,7 +12,7 @@
tags:
- apache
- packages
when: ansible_distribution_major_version is version_compare('9', '>=')
when: ansible_distribution_major_version is version('9', '>=')

- name: packages are installed (jessie)
apt:


+ 1
- 1
apt/tasks/main.yml View File

@@ -4,7 +4,7 @@
fail:
msg: only compatible with Debian >= 8
when:
- ansible_distribution != "Debian" or ansible_distribution_major_version is version_compare('8', '<')
- ansible_distribution != "Debian" or ansible_distribution_major_version is version('8', '<')
tags:
- apt



+ 1
- 1
certbot/tasks/main.yml View File

@@ -4,7 +4,7 @@
assert:
that:
- ansible_distribution == "Debian"
- ansible_distribution_major_version is version_compare('9', '>=')
- ansible_distribution_major_version is version('9', '>=')
msg: only compatible with Debian 9+

- name: certbot package is installed


+ 3
- 3
elasticsearch/tasks/tmpdir.yml View File

@@ -29,7 +29,7 @@
- restart elasticsearch
tags:
- elasticsearch
when: elastic_stack_version is version_compare('6', '<')
when: elastic_stack_version is version('6', '<')

- name: check if ES_TMPDIR is available (>= 6.x)
lineinfile:
@@ -41,7 +41,7 @@
- restart elasticsearch
tags:
- elasticsearch
when: elastic_stack_version is version_compare('6', '>=')
when: elastic_stack_version is version('6', '>=')

- name: change JVM tmpdir (>= 6.x)
lineinfile:
@@ -53,5 +53,5 @@
- restart elasticsearch
tags:
- elasticsearch
when: elastic_stack_version is version_compare('6', '>=')
when: elastic_stack_version is version('6', '>=')
when: (elasticsearch_custom_tmpdir != '' and elasticsearch_custom_tmpdir != None) or fstab_tmp_noexec.rc == 0

+ 1
- 1
etc-git/tasks/main.yml View File

@@ -30,7 +30,7 @@
gitignore_items: []
when:
- _usr_share_scripts.stat.isdir
- ansible_distribution_major_version is version_compare('10', '>=')
- ansible_distribution_major_version is version('10', '>=')

- name: Check if cron is installed
shell: "dpkg -l cron 2> /dev/null | grep -q -E '^(i|h)i'"


+ 1
- 1
evoacme/tasks/main.yml View File

@@ -3,7 +3,7 @@
- fail:
msg: only compatible with Debian >= 8
when:
- ansible_distribution != "Debian" or ansible_distribution_major_version is version_compare('8', '<')
- ansible_distribution != "Debian" or ansible_distribution_major_version is version('8', '<')

- include: certbot.yml



+ 1
- 1
evoacme/templates/nginx.conf.j2 View File

@@ -1,5 +1,5 @@
location ~ /.well-known/acme-challenge {
{% if ansible_distribution_major_version is version_compare('9', '>=') %}
{% if ansible_distribution_major_version is version('9', '>=') %}
alias {{ evoacme_acme_dir }}/;
{% else %}
alias {{ evoacme_acme_dir }}/.well-known/acme-challenge;


+ 1
- 1
evolinux-base/tasks/fstab.yml View File

@@ -66,6 +66,6 @@
state: mounted
when:
- evolinux_fstab_dev_shm
- ansible_distribution_major_version is version_compare('10', '>=')
- ansible_distribution_major_version is version('10', '>=')

- meta: flush_handlers

+ 1
- 1
evolinux-base/tasks/hardware.yml View File

@@ -71,7 +71,7 @@
apt_key:
# url: https://hwraid.le-vert.net/debian/hwraid.le-vert.net.gpg.key
data: "{{ lookup('file', 'hwraid.le-vert.net.gpg.key') }}"
when: ansible_distribution_major_version is version_compare('9', '>=')
when: ansible_distribution_major_version is version('9', '>=')

- name: Add HW tool repository
apt_repository:


+ 1
- 1
evolinux-base/tasks/main.yml View File

@@ -4,7 +4,7 @@
assert:
that:
- ansible_distribution == "Debian"
- ansible_distribution_major_version is version_compare('8', '>=')
- ansible_distribution_major_version is version('8', '>=')
msg: only compatible with Debian >= 8

- name: Apt configuration


+ 3
- 3
evolinux-base/tasks/packages.yml View File

@@ -93,7 +93,7 @@
name: net-tools
when:
- evolinux_packages_stretch
- ansible_distribution_major_version is version_compare('9', '>=')
- ansible_distribution_major_version is version('9', '>=')

- name: Install/Update packages for Buster and later
apt:
@@ -102,7 +102,7 @@
- binutils
when:
- evolinux_packages_buster
- ansible_distribution_major_version is version_compare('10', '>=')
- ansible_distribution_major_version is version('10', '>=')

- name: Customize logcheck recipient
lineinfile:
@@ -141,6 +141,6 @@
state: absent
when:
- ansible_distribution == "Debian"
- ansible_distribution_major_version is version_compare('9', '>=')
- ansible_distribution_major_version is version('9', '>=')

- meta: flush_handlers

+ 1
- 1
evolinux-base/tasks/root.yml View File

@@ -41,7 +41,7 @@
lineinfile:
dest: "/root/.profile"
line: "PATH=\"${PATH}:/usr/share/scripts\""
when: ansible_distribution_major_version is version_compare('10', '>=')
when: ansible_distribution_major_version is version('10', '>=')

- name: Custom git config for root
copy:


+ 3
- 3
evolinux-base/tasks/ssh.yml View File

@@ -27,7 +27,7 @@
notify: reload sshd
when:
- evolinux_ssh_password_auth_addresses != []
- ansible_distribution_major_version is version_compare('10', '>=')
- ansible_distribution_major_version is version('10', '>=')

- name: Security directives for Evolinux (Jessie/Stretch)
blockinfile:
@@ -41,7 +41,7 @@
notify: reload sshd
when:
- evolinux_ssh_password_auth_addresses != []
- ansible_distribution_major_version is version_compare('10', '<')
- ansible_distribution_major_version is version('10', '<')

# We disable AcceptEnv because it can be a security issue, but also because we
# do not want clients to push their environment variables like LANG.
@@ -59,7 +59,7 @@
regexp: '^#?LogLevel [A-Z]+'
replace: "LogLevel VERBOSE"
notify: reload sshd
when: ansible_distribution_major_version is version_compare('9', '>=')
when: ansible_distribution_major_version is version('9', '>=')

- name: "Get current user"
command: logname


+ 3
- 3
evolinux-base/tasks/system.yml View File

@@ -153,7 +153,7 @@
mode: "0755"
when:
- evolinux_system_alert5_init
- ansible_distribution_major_version is version_compare('10', '>=')
- ansible_distribution_major_version is version('10', '>=')

- name: Install alert5 service (buster)
copy:
@@ -163,7 +163,7 @@
mode: "0644"
when:
- evolinux_system_alert5_init
- ansible_distribution_major_version is version_compare('10', '>=')
- ansible_distribution_major_version is version('10', '>=')

- name: Enable alert5 init script (buster)
systemd:
@@ -173,7 +173,7 @@
when:
- evolinux_system_alert5_init
- evolinux_system_alert5_enable
- ansible_distribution_major_version is version_compare('10', '>=')
- ansible_distribution_major_version is version('10', '>=')

## network interfaces



+ 1
- 1
evolinux-base/templates/logs/zsyslog.j2 View File

@@ -8,7 +8,7 @@ notifempty
delaycompress
compress
postrotate
{% if ansible_distribution_major_version is version_compare('10', '>=') %}
{% if ansible_distribution_major_version is version('10', '>=') %}
/usr/lib/rsyslog/rsyslog-rotate
{% else %}
invoke-rc.d rsyslog rotate > /dev/null


+ 1
- 1
evolinux-users/tasks/main.yml View File

@@ -4,7 +4,7 @@
assert:
that:
- ansible_distribution == "Debian"
- ansible_distribution_major_version is version_compare('8', '>=')
- ansible_distribution_major_version is version('8', '>=')
msg: only compatible with Debian >= 8

- debug:


+ 2
- 2
evolinux-users/tasks/ssh.yml View File

@@ -28,9 +28,9 @@

- set_fact:
# If "AllowGroups is present" or "AllowUsers is absent and Debian 10+",
ssh_allowgroups: "{{ (grep_allowgroups_ssh.rc == 0) or (grep_allowusers_ssh.rc != 0 and (ansible_distribution_major_version is version_compare('10', '>='))) }}"
ssh_allowgroups: "{{ (grep_allowgroups_ssh.rc == 0) or (grep_allowusers_ssh.rc != 0 and (ansible_distribution_major_version is version('10', '>='))) }}"
# If "AllowGroups is absent" and "AllowUsers is absent or Debian <10"
ssh_allowusers: "{{ (grep_allowusers_ssh.rc == 0) or (grep_allowgroups_ssh.rc != 0 and (ansible_distribution_major_version is version_compare('10', '<'))) }}"
ssh_allowusers: "{{ (grep_allowusers_ssh.rc == 0) or (grep_allowgroups_ssh.rc != 0 and (ansible_distribution_major_version is version('10', '<'))) }}"

- debug:
var: ssh_allowgroups


+ 1
- 1
evolinux-users/tasks/sudo.yml View File

@@ -4,6 +4,6 @@
when: ansible_distribution_release == "jessie"

- include: sudo_stretch.yml
when: ansible_distribution_major_version is version_compare('9', '>=')
when: ansible_distribution_major_version is version('9', '>=')

- meta: flush_handlers

+ 4
- 4
evolinux-users/tasks/user.yml View File

@@ -63,14 +63,14 @@
group:
name: "{{ evolinux_ssh_group }}"
state: present
when: ansible_distribution_major_version is version_compare('10', '>=')
when: ansible_distribution_major_version is version('10', '>=')

- name: "Unix user '{{ user.name }}' belongs to group '{{ evolinux_ssh_group }}' (Debian 10 or later)"
user:
name: '{{ user.name }}'
groups: "{{ evolinux_ssh_group }}"
append: yes
when: ansible_distribution_major_version is version_compare('10', '>=')
when: ansible_distribution_major_version is version('10', '>=')

## Optional group for all evolinux users

@@ -81,7 +81,7 @@
when:
- evolinux_internal_group is defined
- evolinux_internal_group != ""
- ansible_distribution_major_version is version_compare('9', '>=')
- ansible_distribution_major_version is version('9', '>=')

- name: "Unix user '{{ user.name }}' belongs to group '{{ evolinux_internal_group }}' (Debian 9 or later)"
user:
@@ -91,7 +91,7 @@
when:
- evolinux_internal_group is defined
- evolinux_internal_group != ""
- ansible_distribution_major_version is version_compare('9', '>=')
- ansible_distribution_major_version is version('9', '>=')

## Optional secondary groups, defined per user



+ 1
- 1
lxc/tasks/main.yml View File

@@ -10,7 +10,7 @@
- name: Install lxc-templates on Buster
apt:
name: lxc-templates
when: ansible_distribution_major_version is version_compare('10', '>=')
when: ansible_distribution_major_version is version('10', '>=')

- name: Copy LXC default containers configuration
template:


+ 2
- 2
lxc/templates/default.conf View File

@@ -7,7 +7,7 @@ lxc.id_map = g 0 100000 10000

{% endif %}
# Set the default network virtualization method.
{% if ansible_distribution_major_version is version_compare('9', '<=') %}
{% if ansible_distribution_major_version is version('9', '<=') %}
lxc.network.type = {{lxc_network_type}}
{% else %}
lxc.net.0.type = {{lxc_network_type}}
@@ -21,7 +21,7 @@ lxc.mount.entry = {{lxc_mount_part}} {{lxc_mount_part |replace('/', '')}} none b
{% endif %}
# Only one tty is enough.
# This require that you disabled others tty ([2-6]) in systemd.
{% if ansible_distribution_major_version is version_compare('9', '<=') %}
{% if ansible_distribution_major_version is version('9', '<=') %}
lxc.tty = 1
{% else %}
lxc.tty.max = 1


+ 1
- 1
mongodb/tasks/main.yml View File

@@ -12,4 +12,4 @@
when: ansible_distribution_release == "stretch"

- include: main_buster.yml
when: ansible_distribution_major_version is version_compare('10', '>=')
when: ansible_distribution_major_version is version('10', '>=')

+ 3
- 3
mysql-oracle/tasks/utils.yml View File

@@ -27,7 +27,7 @@
# - name: "mysql-utilities are installed (Debian 9 or later)"
# apt:
# name: mysql-utilities
# when: ansible_distribution_major_version is version_compare('9', '>=')
# when: ansible_distribution_major_version is version('9', '>=')

- name: "mytop dependencies are installed (stretch)"
apt:
@@ -49,7 +49,7 @@
- mariadb-client-10.3
- libconfig-inifiles-perl
- libterm-readkey-perl
when: ansible_distribution_major_version is version_compare('10', '>=')
when: ansible_distribution_major_version is version('10', '>=')

- include_role:
name: evolix/remount-usr
@@ -68,7 +68,7 @@
tags:
- mytop
- mysql
when: ansible_distribution_major_version is version_compare('9', '>=')
when: ansible_distribution_major_version is version('9', '>=')

- name: Read debian-sys-maint password
shell: 'cat /etc/mysql/debian.cnf | grep -m1 "password = .*" | cut -d" " -f3'


+ 3
- 3
mysql/tasks/main.yml View File

@@ -4,19 +4,19 @@
mysql_restart_handler_name: "{{ mysql_restart_if_needed | bool | ternary('restart mysql', 'restart mysql (noop)') }}"

- include: packages_stretch.yml
when: ansible_distribution_major_version is version_compare('9', '>=')
when: ansible_distribution_major_version is version('9', '>=')

- include: packages_jessie.yml
when: ansible_distribution_release == "jessie"

- include: users_stretch.yml
when: ansible_distribution_major_version is version_compare('9', '>=')
when: ansible_distribution_major_version is version('9', '>=')

- include: users_jessie.yml
when: ansible_distribution_release == "jessie"

- include: config_stretch.yml
when: ansible_distribution_major_version is version_compare('9', '>=')
when: ansible_distribution_major_version is version('9', '>=')

- include: config_jessie.yml
when: ansible_distribution_release == "jessie"


+ 2
- 2
mysql/tasks/utils.yml View File

@@ -38,7 +38,7 @@
- mariadb-client-10.3
- libconfig-inifiles-perl
- libterm-readkey-perl
when: ansible_distribution_major_version is version_compare('10', '>=')
when: ansible_distribution_major_version is version('10', '>=')

- name: Read debian-sys-maint password
shell: 'cat /etc/mysql/debian.cnf | grep -m1 "password = .*" | cut -d" " -f3'
@@ -92,7 +92,7 @@
- packages
- percona-toolkit
- mysql
when: ansible_distribution_major_version is version_compare('9', '>=')
when: ansible_distribution_major_version is version('9', '>=')

# automatic optimizations



+ 2
- 2
packweb-apache/tasks/main.yml View File

@@ -3,7 +3,7 @@
- fail:
msg: only compatible with Debian >= 8
when:
- ansible_distribution != "Debian" or ansible_distribution_major_version is version_compare('8', '<')
- ansible_distribution != "Debian" or ansible_distribution_major_version is version('8', '<')

- name: install info.php
copy:
@@ -67,7 +67,7 @@
src: userlogrotate
dest: /etc/cron.weekly/userlogrotate
mode: "0755"
when: ansible_distribution_major_version is version_compare('9', '>=')
when: ansible_distribution_major_version is version('9', '>=')

- name: Force DIR_MODE to 0750 in /etc/adduser.conf
lineinfile:


+ 2
- 2
packweb-apache/tasks/phpmyadmin.yml View File

@@ -7,7 +7,7 @@
- name: Install phpmyadmin (Debian <=9)
apt:
name: phpmyadmin
when: ansible_distribution_major_version is version_compare('9', '<=')
when: ansible_distribution_major_version is version('9', '<=')

- include_role:
name: evolix/remount-usr
@@ -17,7 +17,7 @@
- name: Install phpmyadmin using sid package (Debian >=10)
apt:
deb: http://mirror.evolix.org/debian/pool/main/p/phpmyadmin/phpmyadmin_4.6.6-4_all.deb
when: ansible_distribution_major_version is version_compare('10', '>=')
when: ansible_distribution_major_version is version('10', '>=')

- name: Check if phpmyadmin default configuration is present
stat:


+ 1
- 1
php/tasks/config_fpm.yml View File

@@ -57,7 +57,7 @@
- { option: "pm.status_path", value: "/fpm_status" }
- { option: "request_terminate_timeout", value: "60s" }
notify: "restart {{ php_fpm_service_name }}"
when: ansible_distribution_major_version is version_compare('9', '>=')
when: ansible_distribution_major_version is version('9', '>=')

- name: Custom PHP FPM values
copy:


+ 1
- 1
php/tasks/main.yml View File

@@ -3,7 +3,7 @@
- fail:
msg: only compatible with Debian >= 8
when:
- ansible_distribution != "Debian" or ansible_distribution_major_version is version_compare('8', '<')
- ansible_distribution != "Debian" or ansible_distribution_major_version is version('8', '<')

- include: main_jessie.yml
when: ansible_distribution_release == "jessie"


+ 2
- 2
postgresql/tasks/main.yml View File

@@ -5,10 +5,10 @@
when: ansible_distribution_release == "jessie"

- include: packages_stretch.yml
when: ansible_distribution_major_version is version_compare('9', '=')
when: ansible_distribution_major_version is version('9', '=')

- include: packages_buster.yml
when: ansible_distribution_major_version is version_compare('10', '>=')
when: ansible_distribution_major_version is version('10', '>=')

- include: config.yml



+ 1
- 1
postgresql/templates/postgresql.conf.j2 View File

@@ -3,7 +3,7 @@ shared_buffers = {{ postgresql_shared_buffers }}
work_mem = {{ postgresql_work_mem }}
#shared_preload_libraries = 'pg_stat_statements'
#synchronous_commit = off
{% if postgresql_version is version_compare('9.5', '<') %}
{% if postgresql_version is version('9.5', '<') %}
checkpoint_segments = 30
{% else %}
max_wal_size = 15GB


+ 4
- 4
redis/tasks/instance-server.yml View File

@@ -44,7 +44,7 @@
- "{{ redis_conf_dir }}/redis-server.post-down.d"
when:
- ansible_distribution == "Debian"
- ansible_distribution_major_version is version_compare('9', '=')
- ansible_distribution_major_version is version('9', '=')
tags:
- redis

@@ -59,7 +59,7 @@
- "redis-server.post-down.d"
when:
- ansible_distribution == "Debian"
- ansible_distribution_major_version is version_compare('9', '=')
- ansible_distribution_major_version is version('9', '=')
tags:
- redis

@@ -99,7 +99,7 @@
group: "root"
when:
- ansible_distribution == "Debian"
- ansible_distribution_major_version is version_compare('9', '<')
- ansible_distribution_major_version is version('9', '<')
tags:
- redis

@@ -112,7 +112,7 @@
group: "root"
when:
- ansible_distribution == "Debian"
- ansible_distribution_major_version is version_compare('9', '>=')
- ansible_distribution_major_version is version('9', '>=')
tags:
- redis



+ 3
- 3
redis/tasks/nrpe.yml View File

@@ -18,7 +18,7 @@
group: root
when:
- ansible_distribution == "Debian"
- ansible_distribution_major_version is version_compare('9', '<')
- ansible_distribution_major_version is version('9', '<')
tags:
- redis
- nrpe
@@ -28,7 +28,7 @@
redis_check_redis_path: /usr/local/lib/nagios/plugins/check_redis
when:
- ansible_distribution == "Debian"
- ansible_distribution_major_version is version_compare('9', '<')
- ansible_distribution_major_version is version('9', '<')
tags:
- redis
- nrpe
@@ -38,7 +38,7 @@
redis_check_redis_path: /usr/lib/nagios/plugins/check_redis
when:
- ansible_distribution == "Debian"
- ansible_distribution_major_version is version_compare('9', '>=')
- ansible_distribution_major_version is version('9', '>=')
tags:
- redis
- nrpe


+ 1
- 1
redis/templates/redis.conf.j2 View File

@@ -36,7 +36,7 @@ rdbcompression {{ redis_rdbcompression | bool | ternary('yes','no') }}
dbfilename {{ redis_data_file }}
dir {{ redis_data_dir }}

{% if redis_installed_version is version_compare('3.2', '>=') %}
{% if redis_installed_version is version('3.2', '>=') %}
protected-mode {{ redis_protected_mode | bool | ternary('yes','no') }}
{% endif %}



+ 15
- 15
squid/tasks/main.yml View File

@@ -3,7 +3,7 @@
- fail:
msg: only compatible with Debian >= 8
when:
- ansible_distribution != "Debian" or ansible_distribution_major_version is version_compare('8', '<')
- ansible_distribution != "Debian" or ansible_distribution_major_version is version('8', '<')

- name: "Set squid name (jessie)"
set_fact:
@@ -13,7 +13,7 @@
- name: "Set squid name (Debian 9 or later)"
set_fact:
squid_daemon_name: squid
when: ansible_distribution_major_version is version_compare('9', '>=')
when: ansible_distribution_major_version is version('9', '>=')

- name: "Install Squid packages"
apt:
@@ -26,7 +26,7 @@
copy:
src: default_squid
dest: /etc/default/squid
when: ansible_distribution_major_version is version_compare('9', '>=')
when: ansible_distribution_major_version is version('9', '>=')

- name: "squid.conf is present (jessie)"
template:
@@ -48,14 +48,14 @@
src: evolinux-defaults.conf
dest: /etc/squid/evolinux-defaults.conf
notify: "restart squid"
when: ansible_distribution_major_version is version_compare('9', '>=')
when: ansible_distribution_major_version is version('9', '>=')

- name: "evolinux defaults whitelist (Debian 9 or later)"
copy:
src: evolinux-whitelist-defaults.conf
dest: /etc/squid/evolinux-whitelist-defaults.conf
notify: "reload squid"
when: ansible_distribution_major_version is version_compare('9', '>=')
when: ansible_distribution_major_version is version('9', '>=')

- name: "evolinux custom whitelist (Debian 9 or later)"
copy:
@@ -63,7 +63,7 @@
content: |
# Put customized values here.
force: no
when: ansible_distribution_major_version is version_compare('9', '>=')
when: ansible_distribution_major_version is version('9', '>=')

- name: "evolinux acl for local proxy (Debian 9 or later)"
template:
@@ -71,7 +71,7 @@
dest: /etc/squid/evolinux-acl.conf
force: no
notify: "reload squid"
when: squid_localproxy_enable and ansible_distribution_major_version is version_compare('9', '>=')
when: squid_localproxy_enable and ansible_distribution_major_version is version('9', '>=')

- name: "evolinux custom acl (Debian 9 or later)"
copy:
@@ -79,7 +79,7 @@
content: |
# Put customized values here.
force: no
when: squid_localproxy_enable == False and ansible_distribution_major_version is version_compare('9', '>=')
when: squid_localproxy_enable == False and ansible_distribution_major_version is version('9', '>=')

- name: "evolinux http_access for local proxy (Debian 9 or later)"
copy:
@@ -87,7 +87,7 @@
dest: /etc/squid/evolinux-httpaccess.conf
force: no
notify: "reload squid"
when: squid_localproxy_enable and ansible_distribution_major_version is version_compare('9', '>=')
when: squid_localproxy_enable and ansible_distribution_major_version is version('9', '>=')

- name: "evolinux custom http_access (Debian 9 or later)"
copy:
@@ -95,7 +95,7 @@
content: |
# Put customized values here.
force: no
when: squid_localproxy_enable == False and ansible_distribution_major_version is version_compare('9', '>=')
when: squid_localproxy_enable == False and ansible_distribution_major_version is version('9', '>=')

- name: "evolinux overrides for local proxy (Debian 9 or later)"
template:
@@ -103,7 +103,7 @@
dest: /etc/squid/evolinux-custom.conf
force: no
notify: "reload squid"
when: squid_localproxy_enable and ansible_distribution_major_version is version_compare('9', '>=')
when: squid_localproxy_enable and ansible_distribution_major_version is version('9', '>=')

- name: "evolinux custom overrides (Debian 9 or later)"
copy:
@@ -111,7 +111,7 @@
content: |
# Put customized values here.
force: no
when: squid_localproxy_enable == False and ansible_distribution_major_version is version_compare('9', '>=')
when: squid_localproxy_enable == False and ansible_distribution_major_version is version('9', '>=')

- name: add some URL in whitelist (Debian 8)
lineinfile:
@@ -131,16 +131,16 @@
state: present
with_items: '{{ squid_whitelist_items }}'
notify: "reload squid"
when: ansible_distribution_major_version is version_compare('9', '>=')
when: ansible_distribution_major_version is version('9', '>=')

- include: systemd.yml
when: ansible_distribution_major_version is version_compare('10', '>=')
when: ansible_distribution_major_version is version('10', '>=')

- include: logrotate_jessie.yml
when: ansible_distribution_release == "jessie"

- include: logrotate_stretch.yml
when: ansible_distribution_major_version is version_compare('9', '>=')
when: ansible_distribution_major_version is version('9', '>=')

- include: minifirewall.yml



+ 1
- 1
varnish/tasks/main.yml View File

@@ -25,7 +25,7 @@
mode: "0700"
owner: root
group: root
when: ansible_distribution_major_version is version_compare('9', '<=')
when: ansible_distribution_major_version is version('9', '<=')
notify: reload varnish
tags:
- varnish


+ 2
- 2
webapps/evoadmin-web/tasks/packages.yml View File

@@ -8,7 +8,7 @@
apt:
name: php-pear
state: present
when: ansible_distribution_major_version is version_compare('10', '>=')
when: ansible_distribution_major_version is version('10', '>=')

# /!\ Warning, this is a temporary hack
- include_role:
@@ -21,7 +21,7 @@
state: present
with_items:
- 'http://mirror.evolix.org/debian/pool/main/p/php-log/php-log_1.12.9-2_all.deb'
when: ansible_distribution_major_version is version_compare('10', '>=')
when: ansible_distribution_major_version is version('10', '>=')

- name: Install PHP packages (stretch)
apt:


+ 2
- 2
webapps/evoadmin-web/tasks/user.yml View File

@@ -22,7 +22,7 @@
- name: "Create www-evoadmin (Debian 9 or later)"
user:
name: www-evoadmin
when: ansible_distribution_major_version is version_compare('9', '>=')
when: ansible_distribution_major_version is version('9', '>=')

- name: Is /etc/aliases present?
stat:
@@ -62,7 +62,7 @@
dest: "{{ evoadmin_document_root }}"
version: master
update: False
when: ansible_distribution_major_version is version_compare('9', '>=')
when: ansible_distribution_major_version is version('9', '>=')

- name: Change ownership on git repository
file:


+ 2
- 2
webapps/evoadmin-web/tasks/web.yml View File

@@ -16,7 +16,7 @@
option: "disable_functions"
value: "shell-exec,system,passthru,putenv,popen"
notify: reload apache2
when: ansible_distribution_major_version is version_compare('9', '=')
when: ansible_distribution_major_version is version('9', '=')

- name: "Set custom values for PHP config (Debian 10)"
ini_file:
@@ -25,7 +25,7 @@
option: "disable_functions"
value: "shell-exec,system,passthru,putenv,popen"
notify: reload apache2
when: ansible_distribution_major_version is version_compare('10', '=')
when: ansible_distribution_major_version is version('10', '=')

- name: Install evoadmin VHost
template:


Loading…
Cancel
Save