Various fixes to support debian 9.

This commit is contained in:
Andrea Dell'Amico 2018-09-16 13:51:34 +02:00
parent b1c9dd9ead
commit 2d6676df50
16 changed files with 60 additions and 57 deletions

View File

@ -6,5 +6,6 @@
- name: Install python-software-properties - name: Install python-software-properties
apt: pkg=python-software-properties state=present update_cache=yes cache_valid_time=3600 apt: pkg=python-software-properties state=present update_cache=yes cache_valid_time=3600
when: is_not_debian9
tags: pythonapt tags: pythonapt

View File

@ -12,7 +12,5 @@
creates: '{{ pki_dir }}/haproxy/haproxy.pem' creates: '{{ pki_dir }}/haproxy/haproxy.pem'
tags: [ 'pki', 'ssl', 'letsencrypt', 'haproxy', 'letsencrypt_acme_sh' ] tags: [ 'pki', 'ssl', 'letsencrypt', 'haproxy', 'letsencrypt_acme_sh' ]
when: when: letsencrypt_acme_sh_install
- haproxy_letsencrypt_managed
- letsencrypt_acme_sh_install
tags: [ 'haproxy', 'letsencrypt', 'letsencrypt_acme_sh' ] tags: [ 'haproxy', 'letsencrypt', 'letsencrypt_acme_sh' ]

View File

@ -12,7 +12,5 @@
creates: '{{ pki_dir }}/haproxy/haproxy.pem' creates: '{{ pki_dir }}/haproxy/haproxy.pem'
tags: [ 'pki', 'ssl', 'letsencrypt', 'haproxy' ] tags: [ 'pki', 'ssl', 'letsencrypt', 'haproxy' ]
when: when: letsencrypt_acme_install
- haproxy_letsencrypt_managed
- letsencrypt_acme_install
tags: [ 'haproxy', 'letsencrypt' ] tags: [ 'haproxy', 'letsencrypt' ]

View File

@ -58,5 +58,6 @@
sysctl: name={{ item }} value={{ haproxy_sysctl_conntrack_max }} reload=yes state=present sysctl: name={{ item }} value={{ haproxy_sysctl_conntrack_max }} reload=yes state=present
with_items: with_items:
- net.nf_conntrack_max - net.nf_conntrack_max
when: is_not_debian9
tags: [ 'haproxy', 'haproxy_sysctl' ] tags: [ 'haproxy', 'haproxy_sysctl' ]

View File

@ -3,11 +3,11 @@
- import_tasks: haproxy-letsencrypt-acme-sh.yml - import_tasks: haproxy-letsencrypt-acme-sh.yml
when: when:
- haproxy_letsencrypt_managed - haproxy_letsencrypt_managed
- letsencrypt_acme_sh_install is defined and letsencrypt_acme_sh_install - letsencrypt_acme_sh_install
- import_tasks: haproxy-letsencrypt-acmetool.yml - import_tasks: haproxy-letsencrypt-acmetool.yml
when: when:
- haproxy_letsencrypt_managed - haproxy_letsencrypt_managed
- letsencrypt_acme_install is defined and letsencrypt_acme_install - letsencrypt_acme_install
- import_tasks: haproxy-ssl.yml - import_tasks: haproxy-ssl.yml
when: when:
- haproxy_letsencrypt_managed - haproxy_letsencrypt_managed
@ -27,7 +27,7 @@
service: name=rsyslog state=restarted service: name=rsyslog state=restarted
when: when:
- haproxy_enabled - haproxy_enabled
- ( install_haproxy | changed ) - install_haproxy is changed
tags: haproxy tags: haproxy
- name: Ensure that haproxy is stopped and disabled if needed - name: Ensure that haproxy is stopped and disabled if needed

View File

@ -13,7 +13,7 @@
tags: [ 'memcache', 'memcached' ] tags: [ 'memcache', 'memcached' ]
- name: Enable memcached - name: Enable memcached
action: configfile path=/etc/default/memcached key=ENABLE_MEMCACHED value='yes' syntax=shell copy: content="ENABLE_MEMCACHED='yes'" dest=/etc/default/memcached
when: mc_enabled when: mc_enabled
tags: [ 'memcache', 'memcached' ] tags: [ 'memcache', 'memcached' ]

View File

@ -15,6 +15,11 @@
with_items: '{{ php_fpm_packages }}' with_items: '{{ php_fpm_packages }}'
tags: php tags: php
- name: Install additional php packages
apt: pkg={{ item }} state=present update_cache=yes cache_valid_time=3600
with_items: '{{ php_additional_packages | default([]) }}'
tags: php
- name: Set the timezone if we have one - name: Set the timezone if we have one
ini_file: dest={{ phpfpm_base_dir }}/php.ini section=Date option=date.timezone value={{ timezone }} backup=yes ini_file: dest={{ phpfpm_base_dir }}/php.ini section=Date option=date.timezone value={{ timezone }} backup=yes
when: timezone is defined when: timezone is defined

View File

@ -2,7 +2,7 @@
pg_use_postgresql_org_repo: True pg_use_postgresql_org_repo: True
psql_postgresql_install: False psql_postgresql_install: False
psql_pkg_state: installed psql_pkg_state: present
postgresql_enabled: True postgresql_enabled: True
psql_pgpool_install: False psql_pgpool_install: False
psql_pgpool_service_install: False psql_pgpool_service_install: False

View File

@ -83,5 +83,5 @@
service: name=postgresql state=restarted service: name=postgresql state=restarted
when: when:
- postgresql_enabled - postgresql_enabled
- ( restart_postgresql is defined ) and ( restart_postgresql | changed ) - ( restart_postgresql is defined ) and ( restart_postgresql is changed )
tags: [ 'postgresql', 'postgres', 'pg_hba', 'pg_conf' ] tags: [ 'postgresql', 'postgres', 'pg_hba', 'pg_conf' ]

View File

@ -14,15 +14,15 @@ revive_automatic_maintenance: True
revive_domain: example.com revive_domain: example.com
revive_ad_php_modules: revive_ad_php_modules:
- php-xml-parser - php-xml
- php5-memcache - php-memcache
- php5-memcached - php-memcached
- php5-apcu - php-apcu
- libphp-pclzip - php-pclzip
revive_db_server: pgsql revive_db_server: pgsql
revive_ad_php_db_server_modules: revive_ad_php_db_server_modules:
- 'php5-{{ revive_db_server }}' - 'php{{ php_version }}-{{ revive_db_server }}'
revive_writable_dirs: revive_writable_dirs:
- var - var

View File

@ -46,23 +46,25 @@
- revive_adserver - revive_adserver
- name: Give the revive user the permission to write inside a list of directories - name: Give the revive user the permission to write inside a list of directories
command: chown -R {{ revive_ad_user }} {{ revive_ad_dest_dir }}/{{ item }} command: chown -R {{ revive_ad_user }} {{ revive_ad_dest_dir }}/{{ item }} warn=false
with_items: revive_writable_dirs with_items: '{{ revive_writable_dirs }}'
#when: ad_download is changed when: ad_download is changed
tags: tags:
- revive - revive
- revive_adserver - revive_adserver
- name: Give the revive user the permission to write inside the images directories - name: Give the revive user the permission to write inside the images directories
command: chown -R {{ revive_ad_user }} {{ revive_ad_images_dest_dir }} shell: chown -R {{ revive_ad_user }} {{ revive_ad_images_dest_dir }} ; touch /srv/.s3_permissions
#when: ad_download is changed args:
creates: /srv/.s3_permissions
when: ad_download is changed
tags: tags:
- revive - revive
- revive_adserver - revive_adserver
- name: Install the php required modules - name: Install the php required modules
apt: name={{ item }} state={{ revive_pkg_state }} apt: name={{ item }} state={{ revive_pkg_state }}
with_items: revive_ad_php_modules with_items: '{{ revive_ad_php_modules }}'
notify: Reload php-fpm notify: Reload php-fpm
tags: tags:
- php - php
@ -71,7 +73,7 @@
- name: Install the php modules to access the db servers - name: Install the php modules to access the db servers
apt: name={{ item }} state={{ revive_pkg_state }} apt: name={{ item }} state={{ revive_pkg_state }}
with_items: revive_ad_php_db_server_modules with_items: '{{ revive_ad_php_db_server_modules }}'
notify: Reload php-fpm notify: Reload php-fpm
tags: tags:
- php - php

View File

@ -30,12 +30,16 @@ common_packages:
- nano - nano
- xmlstarlet - xmlstarlet
- bsdutils - bsdutils
- less
default_python_packages: default_python_packages_trusty:
- python-software-properties - python-software-properties
- python-lxml - python-lxml
- python-boto - python-boto
default_python_packages:
- python-lxml
- python-boto
# Set this variable in your playbook # Set this variable in your playbook
# additional_packages: # additional_packages:
@ -151,6 +155,8 @@ has_apt: "('{{ ansible_distribution }}' == 'Debian' or '{{ ansible_distribution
has_fail2ban: "(('{{ ansible_distribution }}' == 'Ubuntu') and ({{ ansible_distribution_major_version }} >= 14)) or (('{{ ansible_distribution }}' == 'Debian') and ({{ ansible_distribution_major_version }} >= 8))" has_fail2ban: "(('{{ ansible_distribution }}' == 'Ubuntu') and ({{ ansible_distribution_major_version }} >= 14)) or (('{{ ansible_distribution }}' == 'Debian') and ({{ ansible_distribution_major_version }} >= 8))"
is_debian: "'{{ ansible_distribution }}' == 'Debian'" is_debian: "'{{ ansible_distribution }}' == 'Debian'"
is_not_debian9: "'{{ ansible_distribution_release }}' != 'stretch'"
is_debian9: "'{{ ansible_distribution_release }}' == 'stretch'"
is_debian8: "'{{ ansible_distribution_release }}' == 'jessie'" is_debian8: "'{{ ansible_distribution_release }}' == 'jessie'"
is_debian7: "'{{ ansible_distribution_release }}' == 'wheezy'" is_debian7: "'{{ ansible_distribution_release }}' == 'wheezy'"
is_debian6: "('{{ ansible_distribution }}' == 'Debian' and {{ ansible_distribution_major_version }} == 6)" is_debian6: "('{{ ansible_distribution }}' == 'Debian' and {{ ansible_distribution_major_version }} == 6)"

View File

@ -1,7 +1,14 @@
--- ---
- name: Install the basic packages - name: Install the basic python packages
apt: pkg={{ item }} state=present update_cache=yes cache_valid_time=1800 apt: pkg={{ item }} state=present update_cache=yes cache_valid_time=1800
with_items: '{{ default_python_packages }}' with_items: '{{ default_python_packages }}'
when: not is_trusty
tags: packages
- name: Install the basic python packages on trusty
apt: pkg={{ item }} state=present update_cache=yes cache_valid_time=1800
with_items: '{{ default_python_packages_trusty }}'
when: is_trusty
tags: packages tags: packages
- name: Install software-properties-common if needed - name: Install software-properties-common if needed

View File

@ -1,11 +1,11 @@
--- ---
varnish_version: 4 varnish_version: 5
varnish_compact_ver: 41 varnish_compact_ver: '{{ varnish_version }}1'
varnish_repo: True varnish_repo: True
varnish_repo_requirements: varnish_repo_requirements:
- apt-transport-https - apt-transport-https
- debian-archive-keyring - debian-archive-keyring
varnish_repo_url: "deb https://packagecloud.io/varnishcache/varnish{{ varnish_compact_ver }}/ubuntu/ {{ ansible_distribution_release }} main" varnish_repo_url: "deb https://packagecloud.io/varnishcache/varnish{{ varnish_compact_ver }}/{{ ansible_distribution | lower }}/ {{ ansible_distribution_release }} main"
varnish_pkg_name: varnish varnish_pkg_name: varnish
varnish_pkg_state: present varnish_pkg_state: present
varnish_enabled: True varnish_enabled: True

View File

@ -3,8 +3,8 @@
# Note: in the index.php directory, the path to the yii distribution will be something like # Note: in the index.php directory, the path to the yii distribution will be something like
# $yii='{{ yii_install_dir }}/yii/framework/yii.php'; # $yii='{{ yii_install_dir }}/yii/framework/yii.php';
# #
yii_version: 1.1.19 yii_version: 1.1.20
yii_release: 5790cb yii_release: 6ed384
yii_installs: yii_installs:
- { version: '{{ yii_version }}', release: '{{ yii_release }}' } - { version: '{{ yii_version }}', release: '{{ yii_release }}' }
@ -13,19 +13,15 @@ yii_download_url: 'https://github.com/yiisoft/yii/releases/download/{{ yii_versi
yii_install_dir: '/opt' yii_install_dir: '/opt'
yii_framework_dir: '{{ yii_install_dir }}/yii-{{ yii_version }}' yii_framework_dir: '{{ yii_install_dir }}/yii-{{ yii_version }}'
yii_php_modules: php_additional_packages:
- php-xml-dtd - php-xml
- php-xml-parser - php-imagick
- php5-imagick - php-memcache
- php5-memcache - php-gd
- php5-xcache - php-mcrypt
- php5-gd - php-curl
- php5-mcrypt - php-pgsql
- php5-curl - 'php{{ php_version }}-opcache'
yii_php_db_server_modules:
- php5-pgsql
- php5-mysqlnd
yii_unneeded_files: yii_unneeded_files:
- CHANGELOG - CHANGELOG

View File

@ -31,14 +31,3 @@
with_items: '{{ yii_unneeded_files }}' with_items: '{{ yii_unneeded_files }}'
tags: [ 'yii', 'yii-framework' ] tags: [ 'yii', 'yii-framework' ]
- name: Install the php required modules
apt: name={{ item }} state=present
with_items: '{{ yii_php_modules }}'
notify: Reload php-fpm
tags: [ 'yii', 'yii-framework' ]
- name: Install the php modules to access the db servers
apt: name={{ item }} state=present
with_items: '{{ yii_php_db_server_modules }}'
notify: Reload php-fpm
tags: [ 'yii', 'yii-framework' ]