Changeset - 4dc3b09894e9
[Not reviewed]
0 5 0
Branko Majic (branko) - 7 years ago 2016-11-26 20:10:17
branko@majic.rs
MAR-69: Introduced configuration option to php_website for providing additional PHP FPM settings. Updated testsite phpinfo role to use it. Updated usage and role reference documentation.
5 files changed with 17 insertions and 0 deletions:
0 comments (0 inline, 0 general)
docs/rolereference.rst
Show inline comments
 
@@ -1234,6 +1234,11 @@ Depends on the following roles:
 
Parameters
 
~~~~~~~~~~
 

	
 
**additional_fpm_config** (dict, optional, ``{}``)
 
  Additional PHP FPM configuration options that should be included for PHP
 
  website's pool. Keys are parameter names, values are associated values. Don't
 
  forget to include quotes in the value itself if expected value type is string.
 

	
 
**additional_nginx_config** (list, optional, ``[]``)
 
  List providing additional Nginx configuration options to include. This can be
 
  useful for specifying things like error pages. Options are applied inside of a
 
@@ -1345,6 +1350,8 @@ running *ownCloud* and *The Bug Genie* applications):
 
          value: error_page 403 /core/templates/403.php;
 
        - comment: Use custom page for non-existing locations/files.
 
          value: error_page 404 /core/templates/404.php;
 
      additional_fpm_config:
 
        "env[PATH]": "\"/usr/local/bin:/usr/bin:/bin\""
 
    - role: php_website
 
      deny_files_regex:
 
        - ^\..*
docs/usage.rst
Show inline comments
 
@@ -1229,6 +1229,9 @@ Before we start, here is a couple of useful pointers regarding the
 
  ``admin-tbg_example_com``. Administrative user does not have a dedicated
 
  group, and instead belongs to same group as the application user.
 
* PHP applications are executed via FastCGI, using the ``php5-fpm`` package.
 
* If you ever need to set some additional PHP FPM settings, this can easily be
 
  done via the ``additional_fpm_config`` role parameter. This particular example
 
  does not set any, though.
 
* Static content (non-PHP) is served directly by *Nginx*.
 
* Each web application gets distinct sub-directory under ``/var/www``, named
 
  after the FQDN. All sub-directories created under there are created with
roles/php_website/defaults/main.yml
Show inline comments
 
@@ -10,3 +10,4 @@ php_rewrite_urls: []
 
rewrites: []
 
https_tls_certificate: "{{ lookup('file', tls_certificate_dir + '/' + fqdn + '_https.pem') }}"
 
https_tls_key: "{{ lookup('file', tls_private_key_dir + '/' + fqdn + '_https.key') }}"
 
additional_fpm_config: {}
 
\ No newline at end of file
roles/php_website/templates/fpm_site.conf.j2
Show inline comments
 
@@ -26,3 +26,7 @@ chdir = /
 
; Redirect worker stdout/stder into main error log. This will also allow Nginx
 
; to log errors in site-specific log file.
 
catch_workers_output = yes
 

	
 
{% for var, val in additional_fpm_config.iteritems() %}
 
{{ var }} = {{ val }}
 
{% endfor %}
testsite/playbooks/roles/phpinfo/meta/main.yml
Show inline comments
 
@@ -10,6 +10,8 @@ dependencies:
 
    enforce_https: False
 
    https_tls_key: "{{ lookup('file', inventory_dir + '/tls/phpinfo.' + testsite_domain + '_https.key') }}"
 
    https_tls_certificate: "{{ lookup('file', inventory_dir + '/tls/phpinfo.' + testsite_domain + '_https.pem') }}"
 
    additional_fpm_config:
 
      "env[PATH]": "\"/usr/local/bin:/usr/bin:/bin\""
 
  - role: database
 
    db_name: phpinfo_{{ testsite_domain_underscores }}
 
    db_password: phpinfo_{{ testsite_domain_underscores }}
 
\ No newline at end of file
0 comments (0 inline, 0 general)