-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(tofs): implementation for all file.managed
- Implementation of libtofs on ini macro, pools_config and apache2 mod_php.conf + Introduction of tplroot on modified files + `{%-` consistency when possible
- Loading branch information
Showing
13 changed files
with
834 additions
and
102 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
# Manages the main Apache2 ini file | ||
{% from "php/map.jinja" import php with context %} | ||
{% from "php/ini.jinja" import php_ini %} | ||
{#- Manages the main Apache2 ini file #} | ||
{%- set tplroot = tpldir.split('/')[0] %} | ||
{%- from tplroot ~ "/map.jinja" import php with context %} | ||
{%- from tplroot ~ "/ini.jinja" import php_ini %} | ||
|
||
{% set settings = php.ini.defaults %} | ||
{% do settings.update(php.apache2.ini.settings) %} | ||
{%- set settings = php.ini.defaults %} | ||
{%- do settings.update(php.apache2.ini.settings) %} | ||
|
||
php_apache2_ini: | ||
{{ php_ini(php.lookup.apache2.ini, php.apache2.ini.opts, settings) }} | ||
{{ php_ini(php.lookup.apache2.ini, | ||
'php_apache2_ini', | ||
php.apache2.ini.opts, | ||
settings | ||
) }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
{% from "php/map.jinja" import php with context %} | ||
{%- set tplroot = tpldir.split('/')[0] %} | ||
{%- from tplroot ~ "/map.jinja" import php with context %} | ||
{%- from tplroot ~ "/libtofs.jinja" import files_switch with context %} | ||
{% set state = 'apache2' %} | ||
{% include "php/installed.jinja" %} | ||
{%- set state = 'apache2' %} | ||
{%- include tplroot ~ "/installed.jinja" %} | ||
{% if grains['os_family'] == "FreeBSD" %} | ||
{%- if grains['os_family'] == "FreeBSD" %} | ||
{{ php.lookup.apache2.module_config }}: | ||
file.managed: | ||
- source: salt://php/apache2/files/mod_php.conf.jinja | ||
- source: {{ files_switch(['mod_php.conf.jinja'], | ||
lookup='php_apache2_module_config', | ||
use_subpath=True | ||
) }} | ||
- template: jinja | ||
{% if salt['pillar.get']('php:use_apache_formula', True) %} | ||
{%- if salt['pillar.get']('php:use_apache_formula', True) %} | ||
- makedirs: true | ||
- require_in: | ||
- sls: apache | ||
- watch_in: | ||
- module: apache-restart | ||
{% endif %} #END: use apache formula | ||
{% endif %} #END: os = debian | ||
{%- endif %} #END: use apache formula | ||
{%- endif %} #END: os = debian |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,35 @@ | ||
# Manages the php cli main ini file | ||
{% from "php/map.jinja" import php with context %} | ||
{% from "php/ini.jinja" import php_ini %} | ||
{#- Manages the php cli main ini file #} | ||
{%- set tplroot = tpldir.split('/')[0] %} | ||
{%- from tplroot ~ "/map.jinja" import php with context %} | ||
{%- from tplroot ~ "/ini.jinja" import php_ini %} | ||
{% set settings = php.ini.defaults %} | ||
{% for key, value in php.cli.ini.settings.items() %} | ||
{% if settings[key] is defined %} | ||
{% do settings[key].update(value) %} | ||
{% else %} | ||
{% do settings.update({key: value}) %} | ||
{% endif %} | ||
{% endfor %} | ||
{%- set settings = php.ini.defaults %} | ||
{%- for key, value in php.cli.ini.settings.items() %} | ||
{%- if settings[key] is defined %} | ||
{%- do settings[key].update(value) %} | ||
{%- else %} | ||
{%- do settings.update({key: value}) %} | ||
{%- endif %} | ||
{%- endfor %} | ||
{% set pillar_php_version = salt['pillar.get']('php:version', '7.0') %} | ||
{% if pillar_php_version is iterable and pillar_php_version is not string %} | ||
{% for version in pillar_php_version %} | ||
{% set first_version = pillar_php_version[0]|string %} | ||
{% set ini = php.lookup.cli.ini|replace(first_version, version) %} | ||
{%- set pillar_php_version = salt['pillar.get']('php:version', '7.0') %} | ||
{%- if pillar_php_version is iterable and pillar_php_version is not string %} | ||
{%- for version in pillar_php_version %} | ||
{%- set first_version = pillar_php_version[0]|string %} | ||
{%- set ini = php.lookup.cli.ini|replace(first_version, version) %} | ||
php_cli_ini_{{ version }}: | ||
{{ php_ini(ini, php.cli.ini.opts, settings) }} | ||
{% endfor %} | ||
{% else %} | ||
{{ php_ini(ini, | ||
'php_cli_ini_' ~ version, | ||
php.cli.ini.opts, | ||
settings | ||
) }} | ||
{%- endfor %} | ||
{%- else %} | ||
php_cli_ini: | ||
{{ php_ini(php.lookup.cli.ini, php.cli.ini.opts, settings) }} | ||
{% endif %} | ||
{{ php_ini(php.lookup.cli.ini, | ||
'php_cli_ini', | ||
php.cli.ini.opts, | ||
settings | ||
) }} | ||
{%- endif %} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,24 @@ | ||
# Manages the php-hhvm main ini file | ||
{% from "php/map.jinja" import php with context %} | ||
{% from "php/ini.jinja" import php_ini %} | ||
{%- set tplroot = tpldir.split('/')[0] %} | ||
{%- from tplroot ~ "/map.jinja" import php with context %} | ||
{%- from tplroot ~ "/ini.jinja" import php_ini %} | ||
{% set server_settings = php.lookup.hhvm.server %} | ||
{% do server_settings.update(php.hhvm.config.server.settings) %} | ||
{%- set server_settings = php.lookup.hhvm.server %} | ||
{%- do server_settings.update(php.hhvm.config.server.settings) %} | ||
{% set php_settings = php.lookup.hhvm.php %} | ||
{% do php_settings.update(php.hhvm.config.php.settings) %} | ||
{%- set php_settings = php.lookup.hhvm.php %} | ||
{%- do php_settings.update(php.hhvm.config.php.settings) %} | ||
php_hhvm_ini_config: | ||
{{ php_ini(php.lookup.hhvm.conf, php.hhvm.config.server.opts, server_settings) }} | ||
{{ php_ini(php.lookup.hhvm.conf, | ||
'php_hhvm_ini_config', | ||
php.hhvm.config.server.opts, | ||
server_settings | ||
) }} | ||
php_hhvm_conf_config: | ||
{{ php_ini(php.lookup.hhvm.ini, php.hhvm.config.php.opts, php_settings) }} | ||
{{ php_ini(php.lookup.hhvm.ini, | ||
'php_hhvm_conf_config', | ||
php.hhvm.config.php.opts, | ||
php_settings | ||
) }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.