From 56c8c925e2b0599f098f0f71f0cd8b4b26347269 Mon Sep 17 00:00:00 2001 From: Rottler Tamas Date: Wed, 7 Sep 2022 02:41:58 +0200 Subject: [PATCH] ubuntu20.04 --- tasks/main.yml | 140 ++++++++++++++++++++++++------------------------- 1 file changed, 69 insertions(+), 71 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index c009bae..0dcc905 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -34,18 +34,17 @@ - name: install packages, jessie tags: apt apt: - name: "{{ item }}" + name: + - apache2 + - libapache2-mod-php5 + - mysql-client + - php5-cli + - php5-curl + - php5-gd + - php5-json + - php5-ldap + - php5-mysqlnd state: present - with_items: - - apache2 - - libapache2-mod-php5 - - mysql-client - - php5-cli - - php5-curl - - php5-gd - - php5-json - - php5-ldap - - php5-mysqlnd when: - ansible_distribution == "Debian" - ansible_distribution_major_version == "8" @@ -53,23 +52,22 @@ - name: install packages, stretch-buster tags: apt apt: - name: "{{ item }}" + name: + - apache2 + - libapache2-mod-php + - mariadb-client + - php-cli + - php-bcmath + - php-curl + - php-gd + - php-json + - php-ldap + - php-mbstring + - php-mysql + - php-soap + - php-xml + - php-zip state: present - with_items: - - apache2 - - libapache2-mod-php - - mariadb-client - - php-cli - - php-bcmath - - php-curl - - php-gd - - php-json - - php-ldap - - php-mbstring - - php-mysql - - php-soap - - php-xml - - php-zip when: - ansible_distribution == "Debian" - ansible_distribution_major_version|int() == 9 or ansible_distribution_major_version|int() == 10 @@ -79,7 +77,7 @@ shell: "curl {{ (proxy is defined) | ternary('--proxy '+ proxy|default(''), '')}} -o /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg" when: - ansible_distribution == "Debian" - - ansible_distribution_major_version|int() == 11 + - ansible_distribution_major_version|int() >= 11 - name: sury repo in sources list, bullseye tags: apt @@ -89,7 +87,7 @@ create: yes when: - ansible_distribution == "Debian" - - ansible_distribution_major_version|int() == 11 + - ansible_distribution_major_version|int() >= 11 - name: apt update, bullseye tags: apt @@ -97,33 +95,32 @@ update_cache: yes when: - ansible_distribution == "Debian" - - ansible_distribution_major_version|int() == 11 + - ansible_distribution_major_version|int() >= 11 - name: install packages, bullseye tags: apt apt: - name: "{{ item }}" + name: + - apache2 + - mariadb-client + - php7.4-cli + - php7.4-fpm + - php7.4-bcmath + - php7.4-curl + - php7.4-gd + - php7.4-json + - php7.4-ldap + - php7.4-mbstring + - php7.4-mysql + - php7.4-opcache + - php7.4-readline + - php7.4-soap + - php7.4-xml + - php7.4-zip state: present - with_items: - - apache2 - - mariadb-client - - php7.4-cli - - php7.4-fpm - - php7.4-bcmath - - php7.4-curl - - php7.4-gd - - php7.4-json - - php7.4-ldap - - php7.4-mbstring - - php7.4-mysql - - php7.4-opcache - - php7.4-readline - - php7.4-soap - - php7.4-xml - - php7.4-zip when: - - ansible_distribution == "Debian" - - ansible_distribution_major_version|int() == 11 + - (ansible_distribution == "Debian" and ansible_distribution_major_version|int() >= 11) or + (ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int() >= 20) - name: conf-available copy: @@ -143,8 +140,8 @@ - name: enable confs / modules, bullseye+ shell: "a2enconf charset log-detailed && a2enmod rewrite headers proxy_fcgi" when: - - ansible_distribution == "Debian" - - ansible_distribution_major_version|int() >= 11 + - (ansible_distribution == "Debian" and ansible_distribution_major_version|int() >= 11) or + (ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int() >= 20) - name: virtualhost config, -buster copy: @@ -159,8 +156,8 @@ src: 000-default_fpm7.4.conf dest: /etc/apache2/sites-available/000-default.conf when: - - ansible_distribution == "Debian" - - ansible_distribution_major_version|int() == 11 + - (ansible_distribution == "Debian" and ansible_distribution_major_version|int() >= 11) or + (ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int() >= 20) - name: php config, jessie copy: @@ -203,8 +200,8 @@ src: hws.php.ini.fpm dest: /etc/php/7.4/hws.php.ini when: - - ansible_distribution == "Debian" - - ansible_distribution_major_version == "11" + - (ansible_distribution == "Debian" and ansible_distribution_major_version|int() >= 11) or + (ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int() >= 20) - name: php config symlinks, stretch file: @@ -230,17 +227,17 @@ - ansible_distribution == "Debian" - ansible_distribution_major_version == "10" -- name: php config symlinks, bullseye - file: - state: link - src: /etc/php/7.4/hws.php.ini - path: "/etc/php/7.4/{{ item }}/conf.d/hws.php.ini" - with_items: - - fpm - - cli - when: - - ansible_distribution == "Debian" - - ansible_distribution_major_version == "11" +#- name: php config symlinks, bullseye +# file: +# state: link +# src: /etc/php/7.4/hws.php.ini +# path: "/etc/php/7.4/{{ item }}/conf.d/hws.php.ini" +# with_items: +# - fpm +# - cli +# when: +# - ansible_distribution == "Debian" +# - ansible_distribution_major_version == "11" - name: php logrotate config @@ -255,8 +252,9 @@ regexp: "^ServerTokens" line: "ServerTokens Prod" when: - - ansible_distribution == "Debian" - - ansible_distribution_major_version|int() >= 11 + - (ansible_distribution == "Debian" and ansible_distribution_major_version|int() >= 11) or + (ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int() >= 20) + - name: security.conf ServerSignature, bullseye+ tags: apt @@ -265,8 +263,8 @@ regexp: "^ServerSignature" line: "ServerSignature Off" when: - - ansible_distribution == "Debian" - - ansible_distribution_major_version|int() >= 11 + - (ansible_distribution == "Debian" and ansible_distribution_major_version|int() >= 11) or + (ansible_distribution == "Ubuntu" and ansible_distribution_major_version|int() >= 20) # vim: set tabstop=2 shiftwidth=2 expandtab smarttab: