First rework of php formula to bring it up to standards.

This commit is contained in:
Forrest Alvarez 2013-11-27 05:55:10 +00:00
parent 6993687c57
commit ea5ee43cc6
9 changed files with 67 additions and 57 deletions

View File

@ -1,10 +1,9 @@
{% from "php/map.jinja" import php with context %}
include:
- apt
{% if grains['os']=="Ubuntu" %}
php-apc:
pkg.installed:
- order: 180
{% endif %}
pkg:
- installed
- name: {{ php.apc-pkg }}

View File

@ -1,11 +1,9 @@
{% from "php/map.jinja" import php with context %}
include:
- apt
{% if grains['os']=="Ubuntu" %}
php-curl:
pkg.installed:
- name: php5-curl
- order: 180
{% endif %}
pkg
- installed
- name: {{ curl-pkg }}

View File

@ -1,15 +1,13 @@
{{% from "php/map.jinja" import php with context %}
include:
- apt
{% if grains['os']=="Ubuntu" %}
php-fpm:
pkg.installed:
- name: php5-fpm
- order: 175
service.running:
- name: php5-fpm
pkg:
- installed
- name: {{ fpm-pkg }}
service:
- running
- name: {{ fpm-service }}
- enable: True
- order: 455
{% endif %}

View File

@ -1,11 +1,9 @@
{{% from "php/map.jinja" import php with context %}
include:
- apt
{% if grains['os']=="Ubuntu" %}
php-gd:
pkg.installed:
- name: php5-gd
- order: 180
{% endif %}
pkg:
- installed
- name: {{ gd-pkg }}

View File

@ -1,11 +1,9 @@
{% from "php/map.jinja import php with context %}
include:
- apt
{% if grains['os']=="Ubuntu" %}
php:
pkg.installed:
- name: php5
- order: 175
{% endif %}
pkg:
- installed
- name: {{ php-pkg }}

24
php/map.jinja Normal file
View File

@ -0,0 +1,24 @@
{% set map = salt['grains.filter_by']({
'Ubuntu': {
'php-pkg': 'php5',
'apc-pkg': 'php-apc',
'curl-pkg': 'php-curl',
'fpm-pkg': 'php5-fpm',
'gd-pkg': 'php5-gd',
'mcrypt-pkg': 'php5-mcrypt',
'mysql-pkg': 'php5-mysql',
'pear-pkg': ' php-pear',
'fpm-service': 'php5-fpm',
},
'RedHat': {
'php-pkg': 'php5',
'apc-pkg': 'php-apc',
'curl-pkg': 'php-curl',
'fpm-pkg': 'php5-fpm',
'gd-pkg': 'php5-gd',
'mcrypt-pkg': 'php5-mcrypt',
'mysql-pkg': 'php5-mysql',
'pear-pkg': ' php-pear',
'fpm-service': 'php5-fpm',
},
}, merge=salt['pillar.get']('php:lookup')) $}

View File

@ -1,11 +1,9 @@
{% from "php/map.jinja" import php with context %}
include:
- apt
{% if grains['os']=="Ubuntu" %}
php-mcrypt:
pkg.installed:
- name: php5-mcrypt
- order: 180
{% endif %}
pkg:
- installed
- name: {{ mcrpyt-pkg }}

View File

@ -1,11 +1,9 @@
{% from "php/map.jinja import php with context %}
include:
- apt
{% if grains['os']=="Ubuntu" %}
php-mysql:
pkg.installed:
- name: php5-mysql
- order: 180
{% endif %}
pkg:
- installed
- name: {{ mysql-pkg }}

View File

@ -1,10 +1,9 @@
{% from "php/map.jinja" import php with context %}
include:
- apt
{% if grains['os']=="Ubuntu" %}
php-pear:
pkg.installed:
- order: 180
{% endif %}
pkg:
- installed
- name : {{ pear-pkg }}