Skip to content
Snippets Groups Projects
Commit f2266566 authored by jurgenhaas's avatar jurgenhaas
Browse files

ansible-playbooks/general#85 Linting [skip-ci]

parent d97774d6
No related branches found
No related tags found
No related merge requests found
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
- mssql-tools - mssql-tools
- unixodbc-dev - unixodbc-dev
notify: notify:
- "Apache | Restart Apache" - "Restart Apache"
- name: PHP | Install PECL packages - name: PHP | Install PECL packages
shell: pecl install --soft {{ item }} shell: pecl install --soft {{ item }}
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
- sqlsrv - sqlsrv
- pdo_sqlsrv - pdo_sqlsrv
notify: notify:
- "Apache | Restart Apache" - "Restart Apache"
- name: Enable extensions - name: Enable extensions
shell: phpenmod {{ item }} shell: phpenmod {{ item }}
...@@ -60,4 +60,4 @@ ...@@ -60,4 +60,4 @@
- sqlsrv - sqlsrv
- pdo_sqlsrv - pdo_sqlsrv
notify: notify:
- "Apache | Restart Apache" - "Restart Apache"
--- ---
# file: roles/php/tasks/php.yml # file: roles/php/tasks/php.yml
- name: PHP | Apt Repository - name: Apt Repository
apt_repository: apt_repository:
repo='{{ item }}' repo: '{{ item }}'
state='present' state: present
mode='644' mode: 0644
with_items: '{{ php_repositories }}' with_items: '{{ php_repositories }}'
- name: PHP | Install required packages. - name: Install required packages.
apt: apt:
pkg={{ php_packages }} pkg: '{{ php_packages }}'
state=present state: present
force=yes force: yes
notify: notify:
- "Apache | Restart Apache" - "Restart Apache"
- name: PHP | Hold em all - name: Hold em all
shell: dpkg --get-selections | grep ^php | sed s/install/hold/g | sudo dpkg --set-selections shell: dpkg --get-selections | grep ^sed s/install/hold/g | sudo dpkg --set-selections
when: php_hold_version when: php_hold_version
- name: PHP | Install PECL packages - name: Install PECL packages
shell: pecl install --soft imagick-3.3.0 shell: pecl install --soft imagick-3.3.0
when: php_version_main|default('7') != '7' when: php_version_main|default('7') != '7'
ignore_errors: true ignore_errors: yes
# NOTE: If oauth is already installed and we install a new PHP 7 version then this fails and we need --force as well # NOTE: If oauth is already installed and we install a new PHP 7 version then this fails and we need --force as well
- name: PHP | Install PECL packages - name: Install PECL packages
shell: pecl install --soft --force oauth shell: pecl install --soft --force oauth
when: php_version_main|default('7') == '7' when: php_version_main|default('7') == '7'
ignore_errors: true ignore_errors: yes
- name: PHP | Ensure Apache config directory - name: Ensure Apache config directory
file: file:
dest=/etc/{{ php_base_dir }}/apache2 dest: /etc/{{ php_base_dir }}/apache2
state=directory state: directory
owner=root owner: root
group=root group: root
mode='755' mode: 0755
- name: PHP | Configuration file, php.ini - name: Configuration file, php.ini
template: template:
src=etc-php5-apache2-php.ini src: etc-php5-apache2-php.ini
dest=/etc/{{ php_base_dir }}/apache2/php.ini dest: /etc/{{ php_base_dir }}/apache2/php.ini
owner=root owner: root
group=root group: root
mode='644' mode: 0644
notify: notify:
- "Apache | Restart Apache" - "Restart Apache"
- import_tasks: php53.yml - import_tasks: php53.yml
when: php_version|default('5.5') == '5.3' when: php_version|default('5.5') == '5.3'
- name: PHP | Configuration file, fcgid.conf - name: Configuration file, fcgid.conf
template: template:
src=fcgid.conf src: fcgid.conf
dest=/etc/apache2/mods-available/fcgid.conf dest: /etc/apache2/mods-available/fcgid.conf
owner=root owner: root
group=root group: root
mode='644' mode: 0644
notify: notify:
- "Apache | Restart Apache" - "Restart Apache"
- name: PHP | Configuration files - name: Configuration files
template: template:
src=etc-php5-conf-d-{{ item }}.ini src: etc-php5-conf-d-{{ item }}.ini
dest=/etc/{{ php_base_dir }}/{{ php_conf_dir }}/{{ item }}.ini dest: /etc/{{ php_base_dir }}/{{ php_conf_dir }}/{{ item }}.ini
owner=root owner: root
group=root group: root
mode='644' mode: 0644
with_items: with_items:
- opcache - opcache
notify: notify:
- "Apache | Restart Apache" - "Restart Apache"
- name: PHP | Create extra directory for browscap - name: Create extra directory for browscap
file: file:
dest=/etc/{{ php_base_dir }}/apache2/extra dest: /etc/{{ php_base_dir }}/apache2/extra
state=directory state: directory
owner=root owner: root
group=root group: root
when: php_browscap when: php_browscap
- name: PHP | browscap.ini - name: browscap.ini
copy: copy:
src=browscap.ini src: browscap.ini
dest=/etc/{{ php_base_dir }}/apache2/extra/browscap.ini dest: /etc/{{ php_base_dir }}/apache2/extra/browscap.ini
owner=root owner: root
group=root group: root
when: php_browscap when: php_browscap
notify: notify:
- "Apache | Restart Apache" - "Restart Apache"
- name: PHP | Create htdocs directory for apc status - name: Create htdocs directory for apc status
file: file:
dest=/var/www/apc dest: /var/www/apc
state=directory state: directory
owner=www-data owner: www-data
group=www-data group: www-data
- name: PHP | Copy APC status php script - name: Copy APC status php script
copy: copy:
src=apc.php src: apc.php
dest=/var/www/apc dest: /var/www/apc
owner=www-data owner: www-data
group=www-data group: www-data
- include_tasks: oci-{{ php_version|default('5.5') }}.yml - include_tasks: oci-{{ php_version|default('5.5') }}.yml
when: repository is defined and php_needs_oci8 when: repository is defined and php_needs_oci8
...@@ -112,67 +112,69 @@ ...@@ -112,67 +112,69 @@
- import_tasks: msodbc.yml - import_tasks: msodbc.yml
when: php_needs_msodbc when: php_needs_msodbc
- name: PHP | Ensure ImageMagick config directory - name: Ensure ImageMagick config directory
file: file:
dest={{ php_imagick_config_dir }} dest: '{{ php_imagick_config_dir }}'
state=directory state: directory
owner=root owner: root
group=root group: root
mode='755' mode: 0755
- name: PHP | ImageMagick Policy File - name: ImageMagick Policy File
template: template:
src=etc-imagemagick-policy.xml src: etc-imagemagick-policy.xml
dest={{ php_imagick_config_dir }}/policy.xml dest: '{{ php_imagick_config_dir }}/policy.xml'
owner=root owner: root
group=root group: root
mode='644' mode: 0644
- block: - block:
- name: PHP | Apache FPM Socket Configuration - name: Apache FPM Socket Configuration
template: template:
src='etc-apache2-conf-available-php-fpm' src: etc-apache2-conf-available-php-fpm
dest='/etc/apache2/{{ apache_conf_dir }}/php{{ php_version_main }}-fpm.conf' dest: /etc/apache2/{{ apache_conf_dir }}/php{{ php_version_main }}-fpm.conf
owner='root' owner: root
group='root' group: root
mode='644' mode: 0644
notify: notify:
- "Apache | Restart Apache" - "Restart Apache"
- name: PHP | Enable Apache PHP FPM Configuration - name: Enable Apache PHP FPM Configuration
command: a2enconf php{{ php_version_main }}-fpm creates=/etc/apache2/conf-enabled/php{{ php_version_main }}-fpm{{ apache_conf_ext }} command: a2enconf php{{ php_version_main }}-fpm
notify: args:
- "Apache | Restart Apache" creates: /etc/apache2/conf-enabled/php{{ php_version_main }}-fpm{{ apache_conf_ext }}
notify:
- "Restart Apache"
when: php_fpm_socket when: php_fpm_socket
- name: PHP | FPM Default Pool Configuration - name: FPM Default Pool Configuration
template: template:
src=php_pool.conf src: php_pool.conf
dest=/etc/{{ php_base_dir }}/fpm/pool.d/www.conf dest: /etc/{{ php_base_dir }}/fpm/pool.d/www.conf
owner=root owner: root
group=root group: root
mode='644' mode: 0644
when: (php_version_main|default('7') == '7') and (jailkit is not defined or not jailkit) and (php_fpm) when: (php_version_main|default('7') == '7') and (jailkit is not defined or not jailkit) and (php_fpm)
- block: - block:
- set_fact: - set_fact:
phpLogRotatePrefix='{{php_version|default("7.0")}}' phpLogRotatePrefix: '{{php_version|default("7.0")}}'
phpLibPrefix='' phpLibPrefix: ''
when: php_version_main|default('7') == '7' when: php_version_main|default('7') == '7'
- set_fact: - set_fact:
phpLogRotatePrefix='5' phpLogRotatePrefix: '5'
phpLibPrefix='5' phpLibPrefix: '5'
when: php_version_main|default('7') != '7' when: php_version_main|default('7') != '7'
- name: Install logrotate script - name: Install logrotate script
template: template:
src=etc-logrotate-php src: etc-logrotate-php
dest=/etc/logrotate.d/php{{ phpLogRotatePrefix }}-fpm dest: /etc/logrotate.d/php{{ phpLogRotatePrefix }}-fpm
owner=root owner: root
group=root group: root
mode='644' mode: 0644
when: php_fpm when: php_fpm
tags: tags:
- logrotate - logrotate
...@@ -5,32 +5,32 @@ ...@@ -5,32 +5,32 @@
- name: Ensure PHP53 config directory - name: Ensure PHP53 config directory
file: file:
dest='{{ item }}' dest: '{{ item }}'
state='directory' state: directory
with_items: with_items:
- /etc/{{ php_base_dir }}/fpm/pool.d/ - /etc/{{ php_base_dir }}/fpm/pool.d/
- name: Check PHP 5.3 Requirement - name: Check PHP 5.3 Requirement
shell: php --version shell: php --version
register: php_version_available register: php_version_available
changed_when: false changed_when: no
- block: - block:
- name: Package Preferences - name: Package Preferences
template: template:
src='preferences/{{ item }}' src: preferences/{{ item }}
dest='/etc/apt/preferences.d/{{ item }}-pin' dest: /etc/apt/preferences.d/{{ item }}-pin
owner='root' owner: root
group='root' group: root
mode='644' mode: 0644
with_items: with_items:
- openssl - openssl
- libssl - libssl
- name: Install Packages - name: Install Packages
apt: apt:
pkg={{ packages }} pkg: '{{ packages }}'
state=present state: present
vars: vars:
packages: packages:
- autoconf2.13 - autoconf2.13
...@@ -67,31 +67,33 @@ ...@@ -67,31 +67,33 @@
- name: Link Client Lib - name: Link Client Lib
file: file:
src='/usr/lib/libc-client.a' src: /usr/lib/libc-client.a
dest='/usr/lib/x86_64-linux-gnu/libc-client.a' dest: /usr/lib/x86_64-linux-gnu/libc-client.a
state='link' state: link
- name: Make sure an empty directory /tmp/php53 exists - name: Make sure an empty directory /tmp/php53 exists
file: file:
path='/tmp/php53' path: /tmp/php53
state='{{ item }}' state: '{{ item }}'
with_items: with_items:
- absent - absent
- directory - directory
- name: Download PHP 5.3 - name: Download PHP 5.3
get_url: get_url:
url='http://in1.php.net/distributions/php-5.3.29.tar.bz2' url: http://in1.php.net/distributions/php-5.3.29.tar.bz2
dest='/tmp/php-5.3.29.tar.bz2' dest: /tmp/php-5.3.29.tar.bz2
- name: Unpack PHP 5.3 - name: Unpack PHP 5.3
unarchive: unarchive:
src='/tmp/php-5.3.29.tar.bz2' src: /tmp/php-5.3.29.tar.bz2
dest='/tmp/php53' dest: /tmp/php53
copy=no copy: no
- name: Compile PHP 5.3 - name: Compile PHP 5.3
shell: "{{ item }} chdir=/tmp/php53/php-5.3.29" shell: '{{ item }}'
args:
chdir: /tmp/php53/php-5.3.29
with_items: 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 - ./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
...@@ -99,11 +101,11 @@ ...@@ -99,11 +101,11 @@
- name: Create PHP53 Start Script - name: Create PHP53 Start Script
template: template:
src='etc-init-d-php53-fpm' src: etc-init-d-php53-fpm
dest='/etc/init.d/php-fpm' dest: /etc/init.d/php-fpm
owner='root' owner: root
group='root' group: root
mode='755' mode: 0755
- name: Add PHP-FPM to Boot-List - name: Add PHP-FPM to Boot-List
command: update-rc.d php-fpm defaults command: update-rc.d php-fpm defaults
...@@ -112,49 +114,49 @@ ...@@ -112,49 +114,49 @@
- name: Copy PHP53 Libraries - name: Copy PHP53 Libraries
copy: copy:
src='php53/libs/{{ item.file }}' src: php53/libs/{{ item.file }}
dest='{{ php53.libdir }}/{{ item.file }}' dest: '{{ php53.libdir }}/{{ item.file }}'
owner='root' owner: root
group='root' group: root
mode='644' mode: 0644
with_items: '{{ php53.libraries }}' with_items: '{{ php53.libraries }}'
- name: Ensure PHP53 Library Links - name: Ensure PHP53 Library Links
file: file:
src='{{ php53.libdir }}/{{ item.file }}' src: '{{ php53.libdir }}/{{ item.file }}'
dest='{{ php53.libdir }}/{{ item.link }}' dest: '{{ php53.libdir }}/{{ item.link }}'
state='link' state: link
owner='root' owner: root
group='root' group: root
mode='644' mode: 0644
with_items: '{{ php53.libraries }}' with_items: '{{ php53.libraries }}'
- name: Ensure extra Library Links - name: Ensure extra Library Links
file: file:
src='{{ item.src }}' src: '{{ item.src }}'
dest='{{ php53.libdir }}/{{ item.link }}' dest: '{{ php53.libdir }}/{{ item.link }}'
state='link' state: link
owner='root' owner: root
group='root' group: root
mode='644' mode: 0644
with_items: '{{ php53.liblinks }}' with_items: '{{ php53.liblinks }}'
- name: Copy PHP53 Modules - name: Copy PHP53 Modules
copy: copy:
src='php53/{{ item }}.so' src: php53/{{ item }}.so
dest='{{ php53.extdir }}/{{ item }}.so' dest: '{{ php53.extdir }}/{{ item }}.so'
owner='root' owner: root
group='root' group: root
mode='644' mode: 0644
with_items: '{{ php53.modules }}' with_items: '{{ php53.modules }}'
- name: Create PHP53 INI Files - name: Create PHP53 INI Files
template: template:
src='etc-php5-apache2-php.ini' src: etc-php5-apache2-php.ini
dest='/etc/{{ php_base_dir }}/{{ item }}/php.ini' dest: /etc/{{ php_base_dir }}/{{ item }}/php.ini
owner='root' owner: root
group='root' group: root
mode='644' mode: 0644
with_items: with_items:
- cgi53 - cgi53
- cli53 - cli53
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment