1
- {%- from " php/map.jinja" import php with context % }
1
+ {%- set tplroot = tpldir.split(' /' )[0 ] %}
2
+ {% from tplroot ~ " /map.jinja" import php with context % }
2
3
3
- {%- set install_file = php.local_bin + ' /' + php.composer_bin % }
4
+ {% set install_file = php.lookup.pkgs. local_bin + ' /' + php.lookup.pkgs .composer_bin % }
4
5
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 % }
10
11
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' ) % }
12
13
13
14
include:
14
15
- 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 % }
15
24
16
25
get- composer:
17
26
file .managed:
18
- - name: {{ php.temp_dir }}/ installer
27
+ - name: {{ php.lookup.pkgs. temp_dir }}/ installer
19
28
- mode: 0755
20
29
- unless: test - f {{ install_file }}
21
30
- source: https:// getcomposer.org/ installer
@@ -25,7 +34,7 @@ get-composer:
25
34
26
35
install- composer:
27
36
cmd.run:
28
- - name: php {{ php.temp_dir }}/ installer -- filename= {{ php.composer_bin }} -- install- dir = {{ php.local_bin }}
37
+ - name: php {{ php.lookup.pkgs. temp_dir }}/ installer -- filename= {{ php.lookup.pkgs. composer_bin }} -- install- dir = {{ php.lookup.pkgs .local_bin }}
29
38
- unless: test - f {{ install_file }}
30
39
- env:
31
40
- HOME : {{ salt_user_home }}
@@ -46,7 +55,7 @@ update-composer:
46
55
{% else % }
47
56
- unless: test $ (date - d " 60 days $({{ install_file }} --version | cut -d ' ' -f 4,5)" " +%s " ) - gt $ (date " +%s " )
48
57
{% endif % }
49
- - cwd: {{ php.local_bin }}
58
+ - cwd: {{ php.lookup.pkgs. local_bin }}
50
59
- env:
51
60
- HOME : {{ salt_user_home }}
52
61
- require:
0 commit comments