Skip to content

Commit 88f9575

Browse files
committed
Fix tests for restarting php-fpm
1 parent 0d84489 commit 88f9575

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
@@ -45,9 +45,9 @@ Here is a list of all the default variables for this role, which are also availa
4545
system_environment_file: /etc/environment
4646
4747
# Set this to ennable php-fpm environment variables
48-
php_fpm_environmnet_file:
48+
php_fpm_environment_file: ''
4949
# Set this if you want the php-fpm service restarted
50-
php_fpm_service_name:
50+
php_fpm_service_name: ''
5151
5252
# The environment file owner
5353
environment_file_owner: root
@@ -80,7 +80,7 @@ This is an example playbook:
8080
- franklinkim.environment
8181
vars:
8282
php_fpm_environment_file: /etc/php-fpm.www.conf
83-
php_fpm_service_name: # Specify this to restart the php-fpm service
83+
php_fpm_service_name: '' # Specify this to restart the php-fpm service
8484
environment_config:
8585
LC_ALL: en_US.UTF-8 # Added to system environment
8686
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)