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
 
@@ -852,14 +852,14 @@ web applications.
 
The role implements the following:
 

	
 
* Installs and configures nginx with a single, default vhost with a small static
 
  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.
 

	
 

	
 
Parameters
 
~~~~~~~~~~
 

	
roles/common/handlers/main.yml
Show inline comments
 
@@ -7,7 +7,10 @@
 
  service: name=ssh state=restarted
 

	
 
- name: Update CA certificate cache
 
  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
 
@@ -52,40 +52,40 @@
 
- name: Enable nginx service
 
  service: name=nginx enabled=yes state=started
 

	
 
- 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
 
  file: path="/etc/systemd/system/php5-fpm.service.d/" state=directory
 
        owner=root group=root mode=755
 

	
 
- name: Configure php5-fpm service to run with umask 0007
 
  copy: src="php5_fpm_umask.conf" dest="/etc/systemd/system/php5-fpm.service.d/umask.conf"
 
        owner=root group=root mode=644
 
  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
 
  register: server_timezone
 

	
 
- name: Configure timezone for PHP
0 comments (0 inline, 0 general)