Merge pull request #2372 from xrousset78800/PHRAS-1723/vagrant-deploy-fix-paths-and-varnames

PHRAS-1723 Fix some paths, variable namings
This commit is contained in:
Nicolas Maillat
2017-11-21 15:09:40 +01:00
committed by GitHub
11 changed files with 67 additions and 49 deletions

View File

@@ -1,5 +1,5 @@
--- ---
# Application tasks to be customized and to run after the main provision #Application tasks to be customized and to run after the main provision
- name: Install global npm packages - name: Install global npm packages
become: yes become: yes
become_user: vagrant become_user: vagrant
@@ -32,7 +32,7 @@
- name: Run application setup - name: Run application setup
become: yes become: yes
become_user: vagrant become_user: vagrant
shell: 'bin/setup system:install --email=admin@{{ hostname }}.vb --password=admin --db-host=127.0.0.1 --db-port=3306 --db-user={{ mariadb.user }} --db-password={{ mariadb.password }} --db-template=fr --appbox={{ mariadb.database }} --databox={{ mariadb.databox_db }} --server-name=www.{{ hostname }}.vb --data-path=/vagrant/datas -y' shell: 'bin/setup system:install --email=admin@{{ hostname }}.vb --password=admin --db-host=127.0.0.1 --db-port=3306 --db-user={{ mariadb.user }} --db-password={{ mariadb.password }} --db-template=fr --appbox={{ mariadb.appbox_db }} --databox={{ mariadb.databox_db }} --server-name=www.{{ hostname }}.vb --data-path=/vagrant/datas -y'
args: args:
chdir: /vagrant/ chdir: /vagrant/

View File

@@ -42,9 +42,9 @@
- name: mariadb | Create databases - name: mariadb | Create databases
mysql_db: name={{ item }} state=present login_user=root login_password={{ mariadb.root_password }} mysql_db: name={{ item }} state=present login_user=root login_password={{ mariadb.root_password }}
with_items: with_items:
- "{{ mariadb.appbox_db }}" - "{{ mariadb.appbox_db }}"
- "{{ mariadb.databox_db }}" - "{{ mariadb.databox_db }}"
- "{{ mariadb.alt_databox_db }}" - "{{ mariadb.alt_databox_db }}"
- name: mariadb | Import dump - name: mariadb | Import dump
mysql_db: name={{ mariadb.database }} state=import login_user=root login_password={{ mariadb.root_password }} target=/vagrant/{{ mariadb.dump }} mysql_db: name={{ mariadb.database }} state=import login_user=root login_password={{ mariadb.root_password }} target=/vagrant/{{ mariadb.dump }}

View File

@@ -25,7 +25,7 @@ server {
location ~ ^/(index|index_dev|api|api_dev)\.php(/|$) { location ~ ^/(index|index_dev|api|api_dev)\.php(/|$) {
root {{ nginx.docroot }}/www; root {{ nginx.docroot }}/www;
fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_pass unix:/var/run/php/php5.6-fpm.sock;
fastcgi_index index.php; fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH /usr/local/bin:/usr/bin:/bin; fastcgi_param PATH /usr/local/bin:/usr/bin:/bin;
@@ -63,7 +63,7 @@ server {
location ~ ^/(index|index_dev|api)\.php(/|$) { location ~ ^/(index|index_dev|api)\.php(/|$) {
root {{ nginx.docroot }}/www; root {{ nginx.docroot }}/www;
fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock; fastcgi_pass unix:/var/run/php/php5.6-fpm.sock;
fastcgi_index index.php; fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH /usr/local/bin:/usr/bin:/bin; fastcgi_param PATH /usr/local/bin:/usr/bin:/bin;

View File

@@ -1,3 +1,3 @@
--- ---
- name: restart php5-fpm - name: restart php5.6-fpm
service: name=php5-fpm enabled=yes state=restarted service: name=php5.6-fpm enabled=yes state=restarted

View File

@@ -1,11 +1,11 @@
--- ---
- stat: path=/etc/php5/apache2/php.ini - stat: path=/etc/php/5.6/apache2/php.ini
register: modphp register: modphp
- stat: path=/etc/php5/fpm/php.ini - stat: path=/etc/php/5.6/fpm/php.ini
register: phpfpm register: phpfpm
- stat: path=/etc/php5/cli/php.ini - stat: path=/etc/php/5.6/cli/php.ini
register: phpcli register: phpcli
- include: php-fpm.yml - include: php-fpm.yml

View File

@@ -7,9 +7,9 @@
sudo: yes sudo: yes
apt: pkg=php5 state=latest apt: pkg=php5 state=latest
- name: Install php5-fpm - name: Install php5.6-fpm
sudo: yes sudo: yes
apt: pkg=php5-fpm state=latest apt: pkg=php5.6-fpm state=latest
- name: Install PHP Packages - name: Install PHP Packages
sudo: yes sudo: yes

View File

@@ -1,30 +1,30 @@
--- ---
- name: ensure timezone is set in apache2 php.ini - name: ensure timezone is set in apache2 php.ini
lineinfile: dest=/etc/php5/apache2/php.ini lineinfile: dest=/etc/php/5.6/apache2/php.ini
regexp='date.timezone =' regexp='date.timezone ='
line='date.timezone = {{ server.timezone }}' line='date.timezone = {{ server.timezone }}'
- name: enabling opcache - name: enabling opcache
lineinfile: dest=/etc/php5/apache2/php.ini lineinfile: dest=/etc/php/5.6/apache2/php.ini
regexp=';?opcache.enable=\d' regexp=';?opcache.enable=\d'
line='opcache.enable=1' line='opcache.enable=1'
- name: Disable PHP cache limiter - name: Disable PHP cache limiter
lineinfile: dest=/etc/php5/apache2/php.ini lineinfile: dest=/etc/php/5.6/apache2/php.ini
regexp=';?\s*session.cache_limiter\s*=\s*' regexp=';?\s*session.cache_limiter\s*=\s*'
line='session.cache_limiter = ""' line='session.cache_limiter = ""'
- name: set post_max_size - name: set post_max_size
lineinfile: dest=/etc/php5/apache2/php.ini lineinfile: dest=/etc/php/5.6/apache2/php.ini
regexp=';?post_max_size\s*=\s*' regexp=';?post_max_size\s*=\s*'
line='post_max_size = 2G' line='post_max_size = 2G'
- name: set upload_max_filesize - name: set upload_max_filesize
lineinfile: dest=/etc/php5/apache2/php.ini lineinfile: dest=/etc/php/5.6/apache2/php.ini
regexp=';?upload_max_filesize\s*=\s*' regexp=';?upload_max_filesize\s*=\s*'
line='upload_max_filesize = 2G' line='upload_max_filesize = 2G'
- name: set max_input_vars - name: set max_input_vars
lineinfile: dest=/etc/php5/apache2/php.ini lineinfile: dest=/etc/php/5.6/apache2/php.ini
regexp=';?max_input_vars\s*=\s*' regexp=';?max_input_vars\s*=\s*'
line='max_input_vars = 12000' line='max_input_vars = 12000'

View File

@@ -1,5 +1,5 @@
- name: Install - name: Install
apt: pkg="php5-dev" state=present apt: pkg="php5.6-dev" state=present
when: php.pecl_packages is defined when: php.pecl_packages is defined
- name: Install Package - name: Install Package
@@ -13,7 +13,7 @@
- name: Create extension .ini file - name: Create extension .ini file
template: > template: >
src="extension.tpl" src="extension.tpl"
dest="/etc/php5/mods-available/{{ item.name }}.ini" dest="/etc/php/5.6/mods-available/{{ item.name }}.ini"
owner="root" owner="root"
group="root" group="root"
mode=0644 mode=0644

View File

@@ -1,30 +1,30 @@
--- ---
- name: ensure timezone is set in cli php.ini - name: ensure timezone is set in cli php.ini
lineinfile: dest=/etc/php5/cli/php.ini lineinfile: dest=/etc/php/5.6/cli/php.ini
regexp='date.timezone =' regexp='date.timezone ='
line='date.timezone = {{ server.timezone }}' line='date.timezone = {{ server.timezone }}'
- name: enabling opcache cli - name: enabling opcache cli
lineinfile: dest=/etc/php5/cli/php.ini lineinfile: dest=/etc/php/5.6/cli/php.ini
regexp=';?opcache.enable_cli=\d' regexp=';?opcache.enable_cli=\d'
line='opcache.enable_cli=1' line='opcache.enable_cli=1'
- name: Disable PHP cache limiter - name: Disable PHP cache limiter
lineinfile: dest=/etc/php5/cli/php.ini lineinfile: dest=/etc/php/5.6/cli/php.ini
regexp=';?\s*session.cache_limiter\s*=\s*' regexp=';?\s*session.cache_limiter\s*=\s*'
line='session.cache_limiter = ""' line='session.cache_limiter = ""'
- name: set post_max_size - name: set post_max_size
lineinfile: dest=/etc/php5/cli/php.ini lineinfile: dest=/etc/php/5.6/cli/php.ini
regexp=';?post_max_size\s*=\s*' regexp=';?post_max_size\s*=\s*'
line='post_max_size = 2G' line='post_max_size = 2G'
- name: set upload_max_filesize - name: set upload_max_filesize
lineinfile: dest=/etc/php5/cli/php.ini lineinfile: dest=/etc/php/5.6/cli/php.ini
regexp=';?upload_max_filesize\s*=\s*' regexp=';?upload_max_filesize\s*=\s*'
line='upload_max_filesize = 2G' line='upload_max_filesize = 2G'
- name: set max_input_vars - name: set max_input_vars
lineinfile: dest=/etc/php5/cli/php.ini lineinfile: dest=/etc/php/5.6/cli/php.ini
regexp=';?max_input_vars\s*=\s*' regexp=';?max_input_vars\s*=\s*'
line='max_input_vars = 12000' line='max_input_vars = 12000'

View File

@@ -1,48 +1,48 @@
--- ---
- name: Set permissions on socket - owner - name: Set permissions on socket - owner
lineinfile: "dest=/etc/php5/fpm/pool.d/www.conf state=present regexp='^;?listen.owner' line='listen.owner = www-data'" lineinfile: "dest=/etc/php/5.6/fpm/pool.d/www.conf state=present regexp='^;?listen.owner' line='listen.owner = www-data'"
notify: restart php5-fpm notify: restart php5.6-fpm
- name: Set permissions on socket - group - name: Set permissions on socket - group
lineinfile: "dest=/etc/php5/fpm/pool.d/www.conf state=present regexp='^;?listen.group' line='listen.group = www-data'" lineinfile: "dest=/etc/php/5.6/fpm/pool.d/www.conf state=present regexp='^;?listen.group' line='listen.group = www-data'"
notify: restart php5-fpm notify: restart php5.6-fpm
- name: Set permissions on socket - mode - name: Set permissions on socket - mode
lineinfile: "dest=/etc/php5/fpm/pool.d/www.conf state=present regexp='^;?listen.mode' line='listen.mode = 0660'" lineinfile: "dest=/etc/php/5.6/fpm/pool.d/www.conf state=present regexp='^;?listen.mode' line='listen.mode = 0660'"
notify: restart php5-fpm notify: restart php5.6-fpm
- name: ensure timezone is set in fpm php.ini - name: ensure timezone is set in fpm php.ini
lineinfile: dest=/etc/php5/fpm/php.ini lineinfile: dest=/etc/php/5.6/fpm/php.ini
regexp='date.timezone =' regexp='date.timezone ='
line='date.timezone = {{ server.timezone }}' line='date.timezone = {{ server.timezone }}'
notify: restart php5-fpm notify: restart php5.6-fpm
- name: enabling opcache - name: enabling opcache
lineinfile: dest=/etc/php5/fpm/php.ini lineinfile: dest=/etc/php/5.6/fpm/php.ini
regexp=';?opcache.enable=\d' regexp=';?opcache.enable=\d'
line='opcache.enable=1' line='opcache.enable=1'
notify: restart php5-fpm notify: restart php5.6-fpm
- name: Disable PHP cache limiter - name: Disable PHP cache limiter
lineinfile: dest=/etc/php5/fpm/php.ini lineinfile: dest=/etc/php/5.6/fpm/php.ini
regexp=';?\s*session.cache_limiter\s*=\s*' regexp=';?\s*session.cache_limiter\s*=\s*'
line='session.cache_limiter = ""' line='session.cache_limiter = ""'
notify: restart php5-fpm notify: restart php5.6-fpm
- name: set post_max_size - name: set post_max_size
lineinfile: dest=/etc/php5/fpm/php.ini lineinfile: dest=/etc/php/5.6/fpm/php.ini
regexp=';?post_max_size\s*=\s*' regexp=';?post_max_size\s*=\s*'
line='post_max_size = 2G' line='post_max_size = 2G'
notify: restart php5-fpm notify: restart php5.6-fpm
- name: set upload_max_filesize - name: set upload_max_filesize
lineinfile: dest=/etc/php5/fpm/php.ini lineinfile: dest=/etc/php/5.6/fpm/php.ini
regexp=';?upload_max_filesize\s*=\s*' regexp=';?upload_max_filesize\s*=\s*'
line='upload_max_filesize = 2G' line='upload_max_filesize = 2G'
notify: restart php5-fpm notify: restart php5.6-fpm
- name: set max_input_vars - name: set max_input_vars
lineinfile: dest=/etc/php5/fpm/php.ini lineinfile: dest=/etc/php/5.6/fpm/php.ini
regexp=';?max_input_vars\s*=\s*' regexp=';?max_input_vars\s*=\s*'
line='max_input_vars = 12000' line='max_input_vars = 12000'
notify: restart php5-fpm notify: restart php5.6-fpm

View File

@@ -43,7 +43,7 @@ mariadb:
root_password: toor root_password: toor
database: ab_master database: ab_master
databox_db: db_master databox_db: db_master
alt_db: db_alt alt_databox_db: db_alt
user: phraseanet user: phraseanet
password: phraseanet password: phraseanet
dump: '' dump: ''
@@ -55,8 +55,26 @@ elasticsearch:
- {name: 'elasticsearch/elasticsearch-analysis-icu', version: '2.7.0'} - {name: 'elasticsearch/elasticsearch-analysis-icu', version: '2.7.0'}
php: php:
install: '1' install: '1'
ppa: php5 ppa: php
packages: [php5-cli, php5-intl, php5-mcrypt, php5-enchant, php5-gd, php5-imagick, php5-memcache, php5-memcached, php5-curl, php5-mysql, php5-sqlite] packages:
- 'php5.6-cli'
- 'php5.6-fpm'
- 'php5.6-intl'
- 'php5.6-mcrypt'
- 'php5.6-enchant'
- 'php5.6-gd'
- 'php5.6-memcache'
- 'php5.6-xml'
- 'php5.6-xmlrpc'
- 'php5.6-memcached'
- 'php5.6-mbstring'
- 'php5.6-curl'
- 'php5.6-mysql'
- 'php5.6-imagick'
- 'php5.6-zip'
- 'php5.6-sqlite3'
- 'php5.6-bcmath'
- 'php-pear'
pecl_packages: pecl_packages:
- {name: zmq, package: zmq-beta} - {name: zmq, package: zmq-beta}
- {name: amqp, package: amqp-1.4.0} - {name: amqp, package: amqp-1.4.0}