From 9830b712e475344a4e2bdef42132545d84fda5c9 Mon Sep 17 00:00:00 2001 From: jurgenhaas <juergen@paragon-es.de> Date: Tue, 11 Jun 2019 18:36:40 +0200 Subject: [PATCH] ansible-playbooks/general#85 Linting --- defaults/main.yml | 42 ++++++----- tasks/main.yml | 42 +++++------ tasks/oci-5.3.yml | 130 ++++++++++++++++---------------- tasks/oci-5.6.yml | 120 +++++++++++++++--------------- tasks/oci-7.0.yml | 120 +++++++++++++++--------------- tasks/php53.yml | 186 +++++++++++++++++++++++----------------------- 6 files changed, 321 insertions(+), 319 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index b4254e0..def1a47 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,11 +1,13 @@ +--- + php_version: 7.0 php_version_main: 7 -php_fpm: true -php_fpm_socket: false +php_fpm: yes +php_fpm_socket: no -php_install_redis: true -php_hold_version: false +php_install_redis: yes +php_hold_version: no php_repositories: [] php_packages: - php-apc @@ -30,34 +32,34 @@ php_base_dir: php5 php_conf_dir: conf.d php_imagick_config_dir: /etc/ImageMagick-6 -php_allow_call_time_pass_reference: on -php_browscap: false +php_allow_call_time_pass_reference: 'on' +php_browscap: no php_date_timezone: Europe/Berlin -php_display_errors: Off -php_display_startup_errors: Off +php_display_errors: 'Off' +php_display_startup_errors: 'Off' php_error_reporting: E_ALL & ~E_NOTICE -php_expose_php: Off +php_expose_php: 'Off' php_filter_default: unsafe_raw -php_html_errors: Off -php_log_errors: On -php_magic_quotes_gpc: On +php_html_errors: 'Off' +php_log_errors: 'On' +php_magic_quotes_gpc: 'On' php_max_execution_time: 30 php_max_file_uploads: 20 php_max_input_time: 60 php_max_input_vars: 1000 php_memory_limit: 32M -php_needs_msodbc: false -php_needs_oci8: false +php_needs_msodbc: no +php_needs_oci8: no php_output_buffering: 4096 php_post_max_size: 32M -php_register_globals: Off -php_register_long_arrays: On +php_register_globals: 'Off' +php_register_long_arrays: 'On' php_sendmail_path: /usr/sbin/sendmail -t -i php_session_cache_expire: 180 php_session_cookie_lifetime: 0 php_session_gc_divisor: 1000 php_session_gc_maxlifetime: 1440 -php_short_open_tag: Off +php_short_open_tag: 'Off' php_upload_max_filesize: 2M php_zend_assertions: -1 @@ -105,13 +107,13 @@ php53: - gd - imagick - imap - #- json + # - json - mcrypt - #- memcached + # - memcached - mysql - mysqli - pdo_mysql - #- readline + # - readline - redis - xmlrpc extdir: /usr/local/lib/php/extensions/no-debug-non-zts-20090626 diff --git a/tasks/main.yml b/tasks/main.yml index 17d5582..29501fe 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -13,26 +13,26 @@ - block: - - include_tasks: variables.yml - tags: - - always - - - import_tasks: php.yml - - - name: Link PhpEnMod for PHP 5.3 - file: - dest: /usr/local/bin/php{{ item }} - src: /usr/sbin/php5{{ item }} - state: link - with_items: - - enmod - - dismod - when: php_version|default("5.5") == "5.3" - - - name: PHP | Remember that this role had been run - set_fact: - role_php_completed: yes - tags: - - always + - include_tasks: variables.yml + tags: + - always + + - import_tasks: php.yml + + - name: Link PhpEnMod for PHP 5.3 + file: + dest: /usr/local/bin/php{{ item }} + src: /usr/sbin/php5{{ item }} + state: link + with_items: + - enmod + - dismod + when: php_version|default("5.5") == "5.3" + + - name: PHP | Remember that this role had been run + set_fact: + role_php_completed: yes + tags: + - always when: not excluded_roles or "php" not in excluded_roles and role_php_completed is not defined diff --git a/tasks/oci-5.3.yml b/tasks/oci-5.3.yml index 179c18e..f2b818c 100644 --- a/tasks/oci-5.3.yml +++ b/tasks/oci-5.3.yml @@ -12,80 +12,80 @@ - block: - - name: PHP | OCI | Enable OCI for PHP - copy: - content: extension={{ item }}.so - dest: /etc/{{ php_base_dir }}/{{ php_conf_dir }}/{{ item }}.ini - owner: root - group: root - mode: 0644 - with_items: - - oci8 - - pdo_oci + - name: PHP | OCI | Enable OCI for PHP + copy: + content: extension={{ item }}.so + dest: /etc/{{ php_base_dir }}/{{ php_conf_dir }}/{{ item }}.ini + owner: root + group: root + mode: 0644 + with_items: + - oci8 + - pdo_oci - - name: PHP | OCI | Remove possible components in /tmp - file: - path: /tmp/{{ item }} - state: absent - with_items: - - instantclient_11_2 - - oracle_x64_11_2_0_3_0_oci8_so - - oracle_x64_11_2_0_3_0_pdo_oci_so + - name: PHP | OCI | Remove possible components in /tmp + file: + path: /tmp/{{ item }} + state: absent + with_items: + - instantclient_11_2 + - oracle_x64_11_2_0_3_0_oci8_so + - oracle_x64_11_2_0_3_0_pdo_oci_so - - name: PHP | OCI | Make available Oracle InstantClient - command: scp -r {{ repository }}{{ item }} /tmp/ - become: no - with_items: - - instantclient_11_2 - - oracle_x64_11_2_0_3_0_oci8_so - - oracle_x64_11_2_0_3_0_pdo_oci_so + - name: PHP | OCI | Make available Oracle InstantClient + command: scp -r {{ repository }}{{ item }} /tmp/ + become: no + with_items: + - instantclient_11_2 + - oracle_x64_11_2_0_3_0_oci8_so + - oracle_x64_11_2_0_3_0_pdo_oci_so - - name: PHP | OCI | Remove /usr/local/lib/instantclient_11_2 - file: - path: /usr/local/lib/instantclient_11_2 - state: absent + - name: PHP | OCI | Remove /usr/local/lib/instantclient_11_2 + file: + path: /usr/local/lib/instantclient_11_2 + state: absent - - name: PHP | OCI | Move Oracle InstantClient to /usr/local/lib - command: mv /tmp/instantclient_11_2 /usr/local/lib/ + - name: PHP | OCI | Move Oracle InstantClient to /usr/local/lib + command: mv /tmp/instantclient_11_2 /usr/local/lib/ - - name: PHP | OCI | Move oci8 to /usr/lib/php5 - command: mv /tmp/oracle_x64_11_2_0_3_0_oci8_so /usr/lib/php5/20090626/oci8.so + - name: PHP | OCI | Move oci8 to /usr/lib/php5 + command: mv /tmp/oracle_x64_11_2_0_3_0_oci8_so /usr/lib/php5/20090626/oci8.so - - name: PHP | OCI | Move pdo_oci to /usr/lib/php5 - command: mv /tmp/oracle_x64_11_2_0_3_0_pdo_oci_so /usr/lib/php5/20090626/pdo_oci.so + - name: PHP | OCI | Move pdo_oci to /usr/lib/php5 + command: mv /tmp/oracle_x64_11_2_0_3_0_pdo_oci_so /usr/lib/php5/20090626/pdo_oci.so - - name: PHP | OCI | Change ownership for Oracle InstantClient - file: - path: '{{ item }}' - owner: root - group: root - recurse: yes - follow: no - with_items: - - /usr/local/lib/instantclient_11_2 + - name: PHP | OCI | Change ownership for Oracle InstantClient + file: + path: '{{ item }}' + owner: root + group: root + recurse: yes + follow: no + with_items: + - /usr/local/lib/instantclient_11_2 - - name: Ensure log directories - file: - path: /usr/local/lib/instantclient_11_2/log/diag/clients - owner: www-data - group: root - state: directory - mode: 0775 - follow: no + - name: Ensure log directories + file: + path: /usr/local/lib/instantclient_11_2/log/diag/clients + owner: www-data + group: root + state: directory + mode: 0775 + follow: no - - name: Set permissions in log directories - file: - path: /usr/local/lib/instantclient_11_2/log - owner: www-data - group: root - mode: 0775 - recurse: yes - follow: no + - name: Set permissions in log directories + file: + path: /usr/local/lib/instantclient_11_2/log + owner: www-data + group: root + mode: 0775 + recurse: yes + follow: no - - name: PHP | OCI | Make available libclntsh.so - file: - src: /usr/local/lib/instantclient_11_2/libclntsh.so.11.1 - dest: /usr/local/lib/instantclient_11_2/libclntsh.so - state: link + - name: PHP | OCI | Make available libclntsh.so + file: + src: /usr/local/lib/instantclient_11_2/libclntsh.so.11.1 + dest: /usr/local/lib/instantclient_11_2/libclntsh.so + state: link when: not oci_file.stat.exists diff --git a/tasks/oci-5.6.yml b/tasks/oci-5.6.yml index b48faf3..ecc04ca 100644 --- a/tasks/oci-5.6.yml +++ b/tasks/oci-5.6.yml @@ -8,74 +8,74 @@ - block: - - name: Enable OCI for PHP - copy: - content: extension={{ item }}.so - dest: /etc/{{ php_base_dir }}/{{ php_conf_dir }}/{{ item }}.ini - owner: root - group: root - mode: 0644 - with_items: - - oci8 + - name: Enable OCI for PHP + copy: + content: extension={{ item }}.so + dest: /etc/{{ php_base_dir }}/{{ php_conf_dir }}/{{ item }}.ini + owner: root + group: root + mode: 0644 + with_items: + - oci8 - - name: Remove possible components in /tmp - file: - path: /tmp/{{ item }} - state: absent - with_items: - - instantclient_11_2 - - oracle_x64_11_2_0_3_0_oci8_so_php_5_6 + - name: Remove possible components in /tmp + file: + path: /tmp/{{ item }} + state: absent + with_items: + - instantclient_11_2 + - oracle_x64_11_2_0_3_0_oci8_so_php_5_6 - - name: Make available Oracle InstantClient - command: scp -r {{ repository }}{{ item }} /tmp/ - become: no - with_items: - - instantclient_11_2 - - oracle_x64_11_2_0_3_0_oci8_so_php_5_6 + - name: Make available Oracle InstantClient + command: scp -r {{ repository }}{{ item }} /tmp/ + become: no + with_items: + - instantclient_11_2 + - oracle_x64_11_2_0_3_0_oci8_so_php_5_6 - - name: Remove /usr/local/lib/instantclient_11_2 - file: - path: /usr/local/lib/instantclient_11_2 - state: absent + - name: Remove /usr/local/lib/instantclient_11_2 + file: + path: /usr/local/lib/instantclient_11_2 + state: absent - - name: Move Oracle InstantClient to /usr/local/lib - command: mv /tmp/instantclient_11_2 /usr/local/lib/ + - name: Move Oracle InstantClient to /usr/local/lib + command: mv /tmp/instantclient_11_2 /usr/local/lib/ - - name: Move oci8 to /usr/lib/php - command: mv /tmp/oracle_x64_11_2_0_3_0_oci8_so_php_4_5 /usr/lib/php/20131226/oci8.so + - name: Move oci8 to /usr/lib/php + command: mv /tmp/oracle_x64_11_2_0_3_0_oci8_so_php_4_5 /usr/lib/php/20131226/oci8.so - - name: Change ownership for Oracle InstantClient - file: - path: '{{ item }}' - owner: root - group: root - recurse: yes - follow: no - with_items: - - /usr/local/lib/instantclient_11_2 + - name: Change ownership for Oracle InstantClient + file: + path: '{{ item }}' + owner: root + group: root + recurse: yes + follow: no + with_items: + - /usr/local/lib/instantclient_11_2 - - name: Ensure log directories - file: - path: /usr/local/lib/instantclient_11_2/log/diag/clients - owner: www-data - group: root - state: directory - mode: 0775 - follow: no + - name: Ensure log directories + file: + path: /usr/local/lib/instantclient_11_2/log/diag/clients + owner: www-data + group: root + state: directory + mode: 0775 + follow: no - - name: Set permissions in log directories - file: - path: /usr/local/lib/instantclient_11_2/log - owner: www-data - group: root - mode: 0775 - recurse: yes - follow: no + - name: Set permissions in log directories + file: + path: /usr/local/lib/instantclient_11_2/log + owner: www-data + group: root + mode: 0775 + recurse: yes + follow: no - - name: Make available libclntsh.so - file: - src: /usr/local/lib/instantclient_11_2/libclntsh.so.11.1 - dest: /usr/local/lib/instantclient_11_2/libclntsh.so - state: link + - name: Make available libclntsh.so + file: + src: /usr/local/lib/instantclient_11_2/libclntsh.so.11.1 + dest: /usr/local/lib/instantclient_11_2/libclntsh.so + state: link when: not oci_file.stat.exists diff --git a/tasks/oci-7.0.yml b/tasks/oci-7.0.yml index b7bf02a..2fd349b 100644 --- a/tasks/oci-7.0.yml +++ b/tasks/oci-7.0.yml @@ -8,74 +8,74 @@ - block: - - name: Enable OCI for PHP - copy: - content: extension={{ item }}.so - dest: /etc/{{ php_base_dir }}/{{ php_conf_dir }}/{{ item }}.ini - owner: root - group: root - mode: 0644 - with_items: - - oci8 + - name: Enable OCI for PHP + copy: + content: extension={{ item }}.so + dest: /etc/{{ php_base_dir }}/{{ php_conf_dir }}/{{ item }}.ini + owner: root + group: root + mode: 0644 + with_items: + - oci8 - - name: Remove possible components in /tmp - file: - path: /tmp/{{ item }} - state: absent - with_items: - - instantclient_11_2 - - oracle_x64_11_2_0_3_0_oci8_so_php_7 + - name: Remove possible components in /tmp + file: + path: /tmp/{{ item }} + state: absent + with_items: + - instantclient_11_2 + - oracle_x64_11_2_0_3_0_oci8_so_php_7 - - name: Make available Oracle InstantClient - command: scp -r {{ repository }}{{ item }} /tmp/ - become: no - with_items: - - instantclient_11_2 - - oracle_x64_11_2_0_3_0_oci8_so_php_7 + - name: Make available Oracle InstantClient + command: scp -r {{ repository }}{{ item }} /tmp/ + become: no + with_items: + - instantclient_11_2 + - oracle_x64_11_2_0_3_0_oci8_so_php_7 - - name: Remove /usr/local/lib/instantclient_11_2 - file: - path: /usr/local/lib/instantclient_11_2 - state: absent + - name: Remove /usr/local/lib/instantclient_11_2 + file: + path: /usr/local/lib/instantclient_11_2 + state: absent - - name: Move Oracle InstantClient to /usr/local/lib - command: mv /tmp/instantclient_11_2 /usr/local/lib/ + - name: Move Oracle InstantClient to /usr/local/lib + command: mv /tmp/instantclient_11_2 /usr/local/lib/ - - name: Move oci8 to /usr/lib/php - command: mv /tmp/oracle_x64_11_2_0_3_0_oci8_so_php_7 /usr/lib/php/20151012/oci8.so + - name: Move oci8 to /usr/lib/php + command: mv /tmp/oracle_x64_11_2_0_3_0_oci8_so_php_7 /usr/lib/php/20151012/oci8.so - - name: Change ownership for Oracle InstantClient - file: - path: '{{ item }}' - owner: root - group: root - recurse: yes - follow: no - with_items: - - /usr/local/lib/instantclient_11_2 + - name: Change ownership for Oracle InstantClient + file: + path: '{{ item }}' + owner: root + group: root + recurse: yes + follow: no + with_items: + - /usr/local/lib/instantclient_11_2 - - name: Ensure log directories - file: - path: /usr/local/lib/instantclient_11_2/log/diag/clients - owner: www-data - group: root - state: directory - mode: 0775 - follow: no + - name: Ensure log directories + file: + path: /usr/local/lib/instantclient_11_2/log/diag/clients + owner: www-data + group: root + state: directory + mode: 0775 + follow: no - - name: Set permissions in log directories - file: - path: /usr/local/lib/instantclient_11_2/log - owner: www-data - group: root - mode: 0775 - recurse: yes - follow: no + - name: Set permissions in log directories + file: + path: /usr/local/lib/instantclient_11_2/log + owner: www-data + group: root + mode: 0775 + recurse: yes + follow: no - - name: Make available libclntsh.so - file: - src: /usr/local/lib/instantclient_11_2/libclntsh.so.11.1 - dest: /usr/local/lib/instantclient_11_2/libclntsh.so - state: link + - name: Make available libclntsh.so + file: + src: /usr/local/lib/instantclient_11_2/libclntsh.so.11.1 + dest: /usr/local/lib/instantclient_11_2/libclntsh.so + state: link when: not oci_file.stat.exists diff --git a/tasks/php53.yml b/tasks/php53.yml index 67f9706..e6e9c82 100644 --- a/tasks/php53.yml +++ b/tasks/php53.yml @@ -16,99 +16,99 @@ changed_when: no - block: - - name: Package Preferences - template: - src: preferences/{{ item }} - dest: /etc/apt/preferences.d/{{ item }}-pin - owner: root - group: root - mode: 0644 - with_items: - - openssl - - libssl - - - name: Install Packages - apt: - pkg: '{{ packages }}' - state: present - vars: - packages: - - autoconf2.13 - - automake1.4 - - build-essential - - libc-client2007e - - libc-client2007e-dev - - libfcgi-dev - - libfcgi0ldbl - - libfreetype6-dev - - libgif-dev - - libgif4 - - libjpeg-progs - - libjpeg62-dbg - - libjpeg8 - - libjpeg8-dev - - libmcrypt-dev - - libmysqlclient-dev - - libpcre++-dev - - libpcre3-dev - - libpng-dev - - libssl-dev - - libx11-dev - - libxau-dev - - libxcb1-dev - - libxdmcp-dev - - libxml2-dev - - libxml2-dev - - libxpm-dev - - x11proto-core-dev - - x11proto-input-dev - - x11proto-kb-dev - - xtrans-dev - - - name: Link Client Lib - file: - src: /usr/lib/libc-client.a - dest: /usr/lib/x86_64-linux-gnu/libc-client.a - state: link - - - name: Make sure an empty directory /tmp/php53 exists - file: - path: /tmp/php53 - state: '{{ item }}' - with_items: - - absent - - directory - - - name: Download PHP 5.3 - get_url: - url: http://in1.php.net/distributions/php-5.3.29.tar.bz2 - dest: /tmp/php-5.3.29.tar.bz2 - - - name: Unpack PHP 5.3 - unarchive: - src: /tmp/php-5.3.29.tar.bz2 - dest: /tmp/php53 - copy: no - - - name: Compile PHP 5.3 - shell: '{{ item }}' - args: - chdir: /tmp/php53/php-5.3.29 - with_items: - - ./configure --with-libdir=/lib/x86_64-linux-gnu --enable-fpm --enable-mbstring --enable-sockets --with-zlib --enable-zip --with-imap-ssl --with-imap --with-curl --with-mcrypt --with-gd --with-mysql --with-pdo-mysql --with-mysqli --with-gettext --with-jpeg-dir=/usr --with-png-dir=/usr --with-kerberos --with-openssl --disable-cgi - - make - - make install - - - name: Create PHP53 Start Script - template: - src: etc-init-d-php53-fpm - dest: /etc/init.d/php-fpm - owner: root - group: root - mode: 0755 - - - name: Add PHP-FPM to Boot-List - command: update-rc.d php-fpm defaults + - name: Package Preferences + template: + src: preferences/{{ item }} + dest: /etc/apt/preferences.d/{{ item }}-pin + owner: root + group: root + mode: 0644 + with_items: + - openssl + - libssl + + - name: Install Packages + apt: + pkg: '{{ packages }}' + state: present + vars: + packages: + - autoconf2.13 + - automake1.4 + - build-essential + - libc-client2007e + - libc-client2007e-dev + - libfcgi-dev + - libfcgi0ldbl + - libfreetype6-dev + - libgif-dev + - libgif4 + - libjpeg-progs + - libjpeg62-dbg + - libjpeg8 + - libjpeg8-dev + - libmcrypt-dev + - libmysqlclient-dev + - libpcre++-dev + - libpcre3-dev + - libpng-dev + - libssl-dev + - libx11-dev + - libxau-dev + - libxcb1-dev + - libxdmcp-dev + - libxml2-dev + - libxml2-dev + - libxpm-dev + - x11proto-core-dev + - x11proto-input-dev + - x11proto-kb-dev + - xtrans-dev + + - name: Link Client Lib + file: + src: /usr/lib/libc-client.a + dest: /usr/lib/x86_64-linux-gnu/libc-client.a + state: link + + - name: Make sure an empty directory /tmp/php53 exists + file: + path: /tmp/php53 + state: '{{ item }}' + with_items: + - absent + - directory + + - name: Download PHP 5.3 + get_url: + url: http://in1.php.net/distributions/php-5.3.29.tar.bz2 + dest: /tmp/php-5.3.29.tar.bz2 + + - name: Unpack PHP 5.3 + unarchive: + src: /tmp/php-5.3.29.tar.bz2 + dest: /tmp/php53 + copy: no + + - name: Compile PHP 5.3 + shell: '{{ item }}' + args: + chdir: /tmp/php53/php-5.3.29 + with_items: + - ./configure --with-libdir=/lib/x86_64-linux-gnu --enable-fpm --enable-mbstring --enable-sockets --with-zlib --enable-zip --with-imap-ssl --with-imap --with-curl --with-mcrypt --with-gd --with-mysql --with-pdo-mysql --with-mysqli --with-gettext --with-jpeg-dir=/usr --with-png-dir=/usr --with-kerberos --with-openssl --disable-cgi + - make + - make install + + - name: Create PHP53 Start Script + template: + src: etc-init-d-php53-fpm + dest: /etc/init.d/php-fpm + owner: root + group: root + mode: 0755 + + - name: Add PHP-FPM to Boot-List + command: update-rc.d php-fpm defaults when: php_version_available and 'PHP 5.3.29' not in php_version_available.stdout -- GitLab