Skip to content

Commit e11efd3

Browse files
committed
Merge branch 'php-fpm-environment'
2 parents ee3fbb1 + 88f9575 commit e11efd3

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ Here is a list of all the default variables for this role, which are also availa
4747
system_environment_file: /etc/environment
4848
4949
# Set this to ennable php-fpm environment variables
50-
php_fpm_environmnet_file:
50+
php_fpm_environment_file: ''
5151
# Set this if you want the php-fpm service restarted
52-
php_fpm_service_name:
52+
php_fpm_service_name: ''
5353
5454
# The environment file owner
5555
environment_file_owner: root
@@ -82,7 +82,7 @@ This is an example playbook:
8282
- franklinkim.environment
8383
vars:
8484
php_fpm_environment_file: /etc/php-fpm.www.conf
85-
php_fpm_service_name: # Specify this to restart the php-fpm service
85+
php_fpm_service_name: '' # Specify this to restart the php-fpm service
8686
environment_config:
8787
LC_ALL: en_US.UTF-8 # Added to system environment
8888
APP_ENV:

defaults/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
system_environment_file: /etc/environment
55

66
# Set this to ennable php-fpm environment variables
7-
php_fpm_environmnet_file:
7+
php_fpm_environment_file: ''
88
# Set this if you want the php-fpm service restarted
9-
php_fpm_service_name:
9+
php_fpm_service_name: ''
1010

1111
# The environment file owner
1212
environment_file_owner: root

tasks/config.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
state: touch
1818
register: environment_file_result
1919
changed_when: environment_file_result.diff.before.state != "file"
20-
when: php_fpm_environment_file is defined
20+
when: php_fpm_environment_file != ''
2121

2222
- name: Remove previous system values
2323
lineinfile:
@@ -44,7 +44,7 @@
4444
regexp: '^env\[{{ item.key }}\]?\ ='
4545
state: absent
4646
with_dict: "{{ environment_config }}"
47-
when: php_fpm_environment_file is defined and (item.value.environments is defined and 'php-fpm' in item.value.environments)
47+
when: php_fpm_environment_file != '' and (item.value.environments is defined and 'php-fpm' in item.value.environments)
4848

4949
# The config goes into the php-fpm environment file if:
5050
# * the value is a dict that contains
@@ -55,11 +55,11 @@
5555
dest: "{{ php_fpm_environment_file }}"
5656
line: 'env[{{ item.key }}] = "{{ item.value.value }}"'
5757
with_dict: "{{ environment_config }}"
58-
when: php_fpm_environment_file is defined and (item.value.environments is defined and 'php-fpm' in item.value.environments)
58+
when: php_fpm_environment_file != '' and (item.value.environments is defined and 'php-fpm' in item.value.environments)
5959

6060
- name: restart php-fpm
6161
systemd:
6262
name: "{{ php_fpm_service_name }}"
6363
state: restarted
64-
when: php_fpm_service_name is defined
64+
when: php_fpm_service_name != ''
6565

tests/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
- franklinkim.environment
66
vars:
77
php_fpm_environment_file: /etc/php-fpm.www.conf
8-
php_fpm_service_name: # Specify this to restart the php-fpm service
8+
php_fpm_service_name: '' # Specify this to restart the php-fpm service
99
environment_config:
1010
LC_ALL: en_US.UTF-8 # Added to system environment
1111
APP_ENV:

0 commit comments

Comments
 (0)