Changeset - 0bab7aaa84d6
[Not reviewed]
0 2 0
Branko Majic (branko) - 8 years ago 2016-01-20 00:10:20
branko@majic.rs
MAR-48: Fixed creation and handling of web server directories where unix sockets are created for PHP5 FPM and WSGI apps. Improved some permissions while at it.
2 files changed with 12 insertions and 10 deletions:
0 comments (0 inline, 0 general)
roles/web_server/tasks/main.yml
Show inline comments
 
@@ -64,19 +64,25 @@
 
    - virtualenv
 
    - virtualenvwrapper
 

	
 
- name: Create directory where WSGI will store per-site socket files
 
- name: Create directories for storing per-site socket files
 
  file: path="/run/wsgi/" state="directory"
 
        owner="root" group="www-data" mode="771"
 
        owner="root" group="www-data" mode="750"
 
  with_items:
 
    - "/run/wsgi/"
 
    - "/run/php5-fpm/"
 

	
 
- name: Create directories for storing per-site socket files on boot
 
  copy: content="d /run/{{ item }}/ 0750 root www-data - -" dest="/etc/tmpfiles.d/{{ item }}.conf"
 
        owner="root" group="root" mode=644
 
  with_items:
 
    - wsgi
 
    - php5-fpm
 

	
 
- name: Install base packages for PHP web applications
 
  apt: name="{{ item }}" state=installed
 
  with_items:
 
    - php5-fpm
 

	
 
- name: Create directory where PHP FPM will store per-site socket files
 
  file: path="/run/php5-fpm/" state="directory"
 
        owner="root" group="www-data" mode="770"
 

	
 
- name: Create directory for storing PHP FPM service configuration overrides
 
  file: path="/etc/systemd/system/php5-fpm.service.d/" state=directory
 
        owner=root group=root mode=755
roles/wsgi_website/tasks/main.yml
Show inline comments
 
@@ -23,10 +23,6 @@
 
- name: Add admin to website group
 
  user: name="{{ admin }}" groups="{{ user }}" append="yes"
 

	
 
- name: Create directory for storing socket file
 
  file: path="/var/run/wsgi/{{ fqdn }}" state="directory"
 
        owner="{{ user }}" group="www-data" mode="750"
 

	
 
- name: Install extra packages for website
 
  apt: name="{{ item }}" state=present
 
  with_items: packages
0 comments (0 inline, 0 general)