Changeset - 467a66f3ec65
[Not reviewed]
0 3 0
Branko Majic (branko) - 11 years ago 2015-05-09 23:07:18
branko@majic.rs
MAR-5: Added handler for reloading systemd configuration to common role. Dropped installation of supervisor as part of web server role. Updted web server role to create directory for storing WSGI application sockets. Updated web server role to use correct directory for storing PHP website sockets.
3 files changed with 13 insertions and 10 deletions:
0 comments (0 inline, 0 general)
docs/rolereference.rst
Show inline comments
 
@@ -855,8 +855,8 @@ The role implements the following:
 
  index page.
 
* Deploys the HTTPS TLS private key and certificate (for default vhost).
 
* Configures firewall to allow incoming connections to the web server.
 
* Installs and configures supervisor, virtualenv, and virtualenvwrapper as a
 
  common base for Python apps.
 
* Installs and configures virtualenv and virtualenvwrapper as a common base for
 
  Python apps.
 
* Installs and configures PHP FPM as a common base for PHP apps.
 

	
 

	
roles/common/handlers/main.yml
Show inline comments
 
@@ -10,4 +10,7 @@
 
  command: /usr/sbin/update-ca-certificates --fresh
 

	
 
- name: Restart ferm
 
  service: name=ferm state=restarted
 
\ No newline at end of file
 
  service: name=ferm state=restarted
 

	
 
- name: Reload systemd
 
  command: systemctl daemon-reload
 
\ No newline at end of file
roles/web_server/tasks/main.yml
Show inline comments
 
@@ -55,17 +55,20 @@
 
- name: Install base packages for Python web applications
 
  apt: name="{{ item }}" state=installed
 
  with_items:
 
    - supervisor
 
    - virtualenv
 
    - virtualenvwrapper
 

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

	
 
- 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="/var/run/php5-fpm/" state="directory"
 
  file: path="/run/php5-fpm/" state="directory"
 
        owner="root" group="www-data" mode="770"
 

	
 
- name: Create directory for storing PHP FPM service configuration overrides
 
@@ -78,11 +81,8 @@
 
  notify:
 
    - Restart php5-fpm
 

	
 
- name: Enable services used for running web applications
 
  service: name="{{ item }}" enabled=yes state=started
 
  with_items:
 
    - php5-fpm
 
    - supervisor
 
- name: Enable service used for running PHP web applications
 
  service: name="php5-fpm" enabled=yes state=started
 

	
 
- name: Read timezone on server
 
  slurp: src=/etc/timezone
0 comments (0 inline, 0 general)