From 467a66f3ec65b8e58a32b5aa813f2db41f88cbca 2015-05-09 23:07:18 From: Branko Majic Date: 2015-05-09 23:07:18 Subject: [PATCH] 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. --- diff --git a/docs/rolereference.rst b/docs/rolereference.rst index a052cd6e44a6ab30ad892ffd134aeec468ce31d4..3ec43a8204b4a5a82d57cdba71bc445d8a26fbd5 100644 --- a/docs/rolereference.rst +++ b/docs/rolereference.rst @@ -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. diff --git a/roles/common/handlers/main.yml b/roles/common/handlers/main.yml index 6f862a1672d5a51670680633b2bac74a2fe21c7c..fbacdcc72c3824bb65973acd10fbd28eb7250c2b 100644 --- a/roles/common/handlers/main.yml +++ b/roles/common/handlers/main.yml @@ -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 diff --git a/roles/web_server/tasks/main.yml b/roles/web_server/tasks/main.yml index 1c9e57cb2c9b972818b99eaf37168c3a4c2fe045..1f596b8c03bdef06beea28bca0019c8aa067276f 100644 --- a/roles/web_server/tasks/main.yml +++ b/roles/web_server/tasks/main.yml @@ -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