Skip to content

Commit 92a4456

Browse files
author
nb
committed
feat(ng): promote NG formula
1 parent d033381 commit 92a4456

File tree

206 files changed

+4140
-5211
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+4140
-5211
lines changed

docs/README.rst

+103-308
Large diffs are not rendered by default.

php/adodb.sls

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
{%- from "php/map.jinja" import php with context %}
2-
3-
include:
4-
- php.deprecated
5-
- php
6-
7-
php-adodb:
8-
pkg.installed:
9-
- name: {{ php.adodb_pkg }}
1+
{%- set tplroot = tpldir.split('/')[0] %}
2+
{%- set state = 'adodb' %}
3+
{%- include tplroot ~ "/installed.jinja" %}

php/ng/apache2/files/mod_php.conf.jinja php/apache2/files/mod_php.conf.jinja

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
{% from "php/ng/map.jinja" import php with context %}
2-
{% from "php/ng/map.jinja" import phpng_version with context %}
3-
{% set major = phpng_version.split('.')|first %}
1+
{%- set tplroot = tpldir.split('/')[0] %}
2+
{%- from tplroot ~ "/map.jinja" import php with context %}
3+
{%- from tplroot ~ "/map.jinja" import php_version with context %}
4+
{%- set major = php_version.split('.')|first %}
45

56
LoadModule php{{ major }}_module /usr/local/libexec/{{ php.lookup.apache2.name }}/libphp{{ major }}.so
67

php/ng/apache2/ini.sls php/apache2/ini.sls

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Manages the main Apache2 ini file
2-
{% from "php/ng/map.jinja" import php with context %}
3-
{% from "php/ng/ini.jinja" import php_ini %}
2+
{%- set tplroot = tpldir.split('/')[0] %}
3+
{%- from tplroot ~ "/map.jinja" import php with context %}
4+
{%- from tplroot ~ "/ini.jinja" import php_ini %}
45

56
{% set settings = php.ini.defaults %}
67
{% do settings.update(php.apache2.ini.settings) %}

php/apache2/init.sls

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{%- if grains['os_family'] in ["Debian", "FreeBSD"] %}
2+
include:
3+
- php.apache2.install
4+
{%- endif %} #END: os = Debian|FreeBSD
5+
{%- if grains['os_family'] == "Debian" %}
6+
- php.apache2.ini
7+
8+
extend:
9+
php_apache2_ini:
10+
file:
11+
- require:
12+
- sls: php.apache2.install
13+
{%- endif %} #END: os = debian

php/apache2/install.sls

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{%- set tplroot = tpldir.split('/')[0] %}
2+
{%- from tplroot ~ "/map.jinja" import php with context %}
3+
4+
{%- set state = 'apache2' %}
5+
{%- include tplroot ~ "/installed.jinja" %}
6+
7+
{%- if grains['os_family'] == "FreeBSD" %}
8+
{{ php.lookup.apache2.module_config }}:
9+
file.managed:
10+
- source: salt://php/apache2/files/mod_php.conf.jinja
11+
- template: jinja
12+
{%- if salt['pillar.get']('php:use_apache_formula', True) %}
13+
- makedirs: true
14+
- require_in:
15+
- sls: apache
16+
- watch_in:
17+
- module: apache-restart
18+
{%- endif %} #END: use apache formula
19+
{%- endif %} #END: os = debian

php/apc.sls

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
{%- from "php/map.jinja" import php with context %}
2-
3-
include:
4-
- php.deprecated
5-
- php
6-
7-
php-apc:
8-
pkg.installed:
9-
- name: {{ php.apc_pkg }}
1+
{%- set tplroot = tpldir.split('/')[0] %}
2+
{%- set state = 'apc' %}
3+
{%- include tplroot ~ "/installed.jinja" %}

php/apcu.sls

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
{%- from "php/map.jinja" import php with context %}
2-
3-
include:
4-
- php.deprecated
5-
- php
6-
7-
php-apcu:
8-
pkg.installed:
9-
- name: {{ php.apcu_pkg }}
1+
{%- set tplroot = tpldir.split('/')[0] %}
2+
{%- set state = 'apcu' %}
3+
{%- include tplroot ~ "/installed.jinja" %}

php/auth-sasl.sls

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{%- set tplroot = tpldir.split('/')[0] %}
2+
{%- set state = 'auth-sasl' %}
3+
{%- include tplroot ~ "/installed.jinja" %}

php/bcmath.sls

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
{%- from "php/map.jinja" import php with context %}
2-
3-
include:
4-
- php.deprecated
5-
- php
6-
7-
php-bcmath:
8-
pkg.installed:
9-
- name: {{ php.bcmath_pkg }}
1+
{%- set tplroot = tpldir.split('/')[0] %}
2+
{%- set state = 'bcmath' %}
3+
{%- include tplroot ~ "/installed.jinja" %}

php/bz2.sls

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{%- set tplroot = tpldir.split('/')[0] %}
2+
{%- set state = 'bz2' %}
3+
{%- include tplroot ~ "/installed.jinja" %}

php/cache-lite.sls

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{%- set tplroot = tpldir.split('/')[0] %}
2+
{%- set state = 'cache-lite' %}
3+
{%- include tplroot ~ "/installed.jinja" %}

php/cgi.sls

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
{%- from "php/map.jinja" import php with context %}
2-
3-
include:
4-
- php.deprecated
5-
- php
6-
7-
php-cgi:
8-
pkg.installed:
9-
- name: {{ php.cgi_pkg }}
1+
{%- set tplroot = tpldir.split('/')[0] %}
2+
{%- set state = 'cgi' %}
3+
{%- include tplroot ~ "/installed.jinja" %}

php/cli.sls

-9
This file was deleted.

php/cli/ini.sls

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Manages the php cli main ini file
2+
{%- set tplroot = tpldir.split('/')[0] %}
3+
{%- from tplroot ~ "/map.jinja" import php with context %}
4+
{%- from tplroot ~ "/ini.jinja" import php_ini %}
5+
6+
{%- set settings = php.ini.defaults %}
7+
{%- for key, value in php.cli.ini.settings.items() %}
8+
{%- if settings[key] is defined %}
9+
{%- do settings[key].update(value) %}
10+
{%- else %}
11+
{%- do settings.update({key: value}) %}
12+
{%- endif %}
13+
{%- endfor %}
14+
15+
php_cli_ini:
16+
{{ php_ini(php.lookup.cli.ini, php.cli.ini.opts, settings) }}
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Installs php-cli and manages the associated php.ini
22

33
include:
4-
- php.ng.cli.install
5-
- php.ng.cli.ini
4+
- php.cli.install
5+
- php.cli.ini
66

77
extend:
88
php_cli_ini:
99
file:
1010
- require:
11-
- sls: php.ng.cli.install
11+
- sls: php.cli.install

php/cli/install.sls

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{%- set tplroot = tpldir.split('/')[0] %}
2+
{%- set state = 'cli' %}
3+
{%- include tplroot ~ "/installed.jinja" %}
4+
5+
{%- if salt['grains.get']('os_family') == "Debian" %}
6+
{%- set current_php = salt['alternatives.show_current']('php') %}
7+
{%- set php_version = salt['pillar.get']('php:version', '7.0')|string %}
8+
9+
php_{{ php_version }}_link:
10+
alternatives.set:
11+
- name: php
12+
- path: /usr/bin/php{{ php_version }}
13+
- require_in:
14+
- pkg: php_install_{{ state }}
15+
- onlyif:
16+
- which php
17+
- test {{ current_php }} != $(which php{{ php_version }})
18+
{%- endif %}

php/composer.sls

+26-10
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,30 @@
1-
{%- from "php/map.jinja" import php with context %}
1+
{%- set tplroot = tpldir.split('/')[0] %}
2+
{% from tplroot ~ "/map.jinja" import php with context %}
23
3-
{%- set install_file = php.local_bin + '/' + php.composer_bin %}
4+
{% set install_file = php.lookup.pkgs.local_bin + '/' + php.lookup.pkgs.composer_bin %}
45
5-
{%- if not salt['config.get']('sudo_user') %}
6-
{%- set salt_user = salt['config.get']('user', 'root') %}
7-
{%- else %}
8-
{%- set salt_user = salt['config.get']('sudo_user', 'root') %}
9-
{%- endif %}
6+
{% if not salt['config.get']('sudo_user') %}
7+
{% set salt_user = salt['config.get']('user', 'root') %}
8+
{% else %}
9+
{% set salt_user = salt['config.get']('sudo_user', 'root') %}
10+
{% endif %}
1011
11-
{%- set salt_user_home = salt['user.info'](salt_user).get('home', '/root') %}
12+
{% set salt_user_home = salt['user.info'](salt_user).get('home', '/root') %}
1213
1314
include:
14-
- php.deprecated
1515
- php
16+
{% if grains['os_family'] == 'FreeBSD' %}
17+
- php.filter
18+
- php.hash
19+
- php.json
20+
- php.mbstring
21+
- php.openssl
22+
- php.phar
23+
{% endif %}
1624
1725
get-composer:
1826
file.managed:
19-
- name: {{ php.temp_dir }}/installer
27+
- name: {{ php.lookup.pkgs.temp_dir }}/installer
2028
- mode: 0755
2129
- unless: test -f {{ install_file }}
2230
- source: https://getcomposer.org/installer
@@ -26,7 +34,11 @@ get-composer:
2634
2735
install-composer:
2836
cmd.run:
37+
<<<<<<< HEAD
2938
- name: php {{ php.temp_dir }}/installer --filename={{ php.composer_bin }} --install-dir={{ php.local_bin }}
39+
=======
40+
- name: php {{ php.lookup.pkgs.temp_dir }}/installer --filename={{ php.lookup.pkgs.composer_bin }} --install-dir={{ php.lookup.pkgs.local_bin }}
41+
>>>>>>> c31e513... feat(ng): promote NG formula
3042
- unless: test -f {{ install_file }}
3143
- env:
3244
- HOME: {{ salt_user_home }}
@@ -47,7 +59,11 @@ update-composer:
4759
{% else %}
4860
- unless: test $(date -d "60 days $({{ install_file }} --version | cut -d ' ' -f 4,5)" "+%s") -gt $(date "+%s")
4961
{% endif %}
62+
<<<<<<< HEAD
5063
- cwd: {{ php.local_bin }}
64+
=======
65+
- cwd: {{ php.lookup.pkgs.local_bin }}
66+
>>>>>>> c31e513... feat(ng): promote NG formula
5167
- env:
5268
- HOME: {{ salt_user_home }}
5369
- require:

php/console-table.sls

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{%- set tplroot = tpldir.split('/')[0] %}
2+
{%- set state = 'console-table' %}
3+
{%- include tplroot ~ "/installed.jinja" %}

php/ctype.sls

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{%- set tplroot = tpldir.split('/')[0] %}
2+
{%- set state = 'ctype' %}
3+
{%- include tplroot ~ "/installed.jinja" %}

php/curl.sls

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
{%- from "php/map.jinja" import php with context %}
2-
3-
include:
4-
- php.deprecated
5-
- php
6-
7-
php-curl:
8-
pkg.installed:
9-
- name: {{ php.curl_pkg }}
1+
{%- set tplroot = tpldir.split('/')[0] %}
2+
{%- set state = 'curl' %}
3+
{%- include tplroot ~ "/installed.jinja" %}

php/dba.sls

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{%- set tplroot = tpldir.split('/')[0] %}
2+
{%- set state = 'dba' %}
3+
{%- include tplroot ~ "/installed.jinja" %}

php/dev.sls

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
{%- from "php/map.jinja" import php with context %}
2-
3-
include:
4-
- php.deprecated
5-
- php
6-
7-
php-dev:
8-
pkg.installed:
9-
- name: {{ php.dev_pkg }}
1+
{%- set tplroot = tpldir.split('/')[0] %}
2+
{%- set state = 'dev' %}
3+
{%- include tplroot ~ "/installed.jinja" %}

php/dom.sls

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{%- set tplroot = tpldir.split('/')[0] %}
2+
{%- set state = 'dom' %}
3+
{%- include tplroot ~ "/installed.jinja" %}

php/fileinfo.sls

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{%- set tplroot = tpldir.split('/')[0] %}
2+
{%- set state = 'fileinfo' %}
3+
{%- include tplroot ~ "/installed.jinja" %}
File renamed without changes.

php/filter.sls

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{%- set tplroot = tpldir.split('/')[0] %}
2+
{%- set state = 'filter' %}
3+
{%- include tplroot ~ "/installed.jinja" %}

php/fpm.sls

-11
This file was deleted.

php/ng/fpm/config.sls php/fpm/config.sls

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Manages the php-fpm main ini file
2-
{% from 'php/ng/map.jinja' import php with context %}
3-
{% from "php/ng/ini.jinja" import php_ini %}
2+
{%- set tplroot = tpldir.split('/')[0] %}
3+
{%- from tplroot ~ "/map.jinja" import php with context %}
4+
{%- from tplroot ~ "/ini.jinja" import php_ini %}
45
56
{% set ini_settings = php.ini.defaults %}
67
{% for key, value in php.fpm.config.ini.settings.items() %}

php/ng/fpm/init.sls php/fpm/init.sls

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Meta-state to fully install php.fpm
22

33
include:
4-
- php.ng.fpm.config
5-
- php.ng.fpm.service
6-
- php.ng.fpm.pools
4+
- php.fpm.config
5+
- php.fpm.service
6+
- php.fpm.pools
77

88
extend:
99
php_fpm_service:
@@ -12,7 +12,7 @@ extend:
1212
- file: php_fpm_ini_config
1313
- file: php_fpm_conf_config
1414
- require:
15-
- sls: php.ng.fpm.config
15+
- sls: php.fpm.config
1616
php_fpm_ini_config:
1717
file:
1818
- require:

php/fpm/install.sls

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{%- set tplroot = tpldir.split('/')[0] %}
2+
{% set state = 'fpm' %}
3+
{% include tplroot ~ "/installed.jinja" %}

php/ng/fpm/pools.sls php/fpm/pools.sls

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Manages the php-fpm pools config files
2-
{% from "php/ng/map.jinja" import php with context %}
3-
{% from "php/ng/macro.jinja" import sls_block %}
4-
{% from "php/ng/fpm/pools_config.sls" import pool_states with context %}
2+
{%- set tplroot = tpldir.split('/')[0] %}
3+
{%- from tplroot ~ "/map.jinja" import php with context %}
4+
{%- from tplroot ~ "/macro.jinja" import sls_block %}
5+
{%- from tplroot ~ "/fpm/pools_config.sls" import pool_states with context %}
56
67
{% macro file_requisites(states) %}
78
{%- for state in states %}
@@ -10,8 +11,8 @@
1011
{% endmacro %}
1112
1213
include:
13-
- php.ng.fpm.service
14-
- php.ng.fpm.pools_config
14+
- php.fpm.service
15+
- php.fpm.pools_config
1516
1617
{% if pool_states %}
1718
extend:

0 commit comments

Comments
 (0)