Skip to content

Commit 8104b1d

Browse files
authored
Merge pull request #1412 from roots/improve-composer-authentication-password-default
Improve composer authentications password default
2 parents 2decc06 + 7357bf3 commit 8104b1d

File tree

3 files changed

+5
-11
lines changed

3 files changed

+5
-11
lines changed

group_vars/all/helpers.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,4 @@ ssl_stapling_enabled: "{{ item.value.ssl is defined and item.value.ssl.stapling_
2020
cron_enabled: "{{ site_env.disable_wp_cron and (not item.value.multisite.enabled | default(false) or (item.value.multisite.enabled | default(false) and item.value.multisite.cron | default(true))) }}"
2121
sites_use_ssl: "{{ wordpress_sites.values() | map(attribute='ssl') | selectattr('enabled') | list | count > 0 }}"
2222

23-
# For backward compatibility, to be removed in Trellis v2.
24-
site_packagist_org_authentications:
25-
- { hostname: repo.packagist.com, username: token, password: "{{ vault_wordpress_sites[site].packagist_token | default('') }}" }
26-
site_composer_authentications: "{{ vault_wordpress_sites[site].composer_authentications | default([]) }}"
27-
composer_authentications: "{{ site_packagist_org_authentications + site_composer_authentications }}"
23+
composer_authentications: "{{ vault_wordpress_sites[site].composer_authentications | default([]) }}"

roles/deploy/hooks/build-after.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@
1212
- name: Setup composer authentications
1313
composer:
1414
command: config
15-
arguments: --auth http-basic.{{ composer_authentication.hostname }} {{ composer_authentication.username }} {{ composer_authentication.password }}
15+
arguments: --auth http-basic.{{ composer_authentication.hostname | quote }} {{ composer_authentication.username | quote }} {{ composer_authentication.password | default("") | quote }}
1616
working_dir: "{{ deploy_helper.new_release_path }}"
1717
no_log: true
1818
changed_when: false
1919
when:
2020
- composer_authentication.hostname is defined and composer_authentication.hostname != ""
2121
- composer_authentication.username is defined and composer_authentication.username != ""
22-
- composer_authentication.password is defined and composer_authentication.password != ""
2322
loop: "{{ composer_authentications | default([]) }}"
2423
loop_control:
2524
loop_var: composer_authentication

roles/wordpress-install/tasks/composer-authentications.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
- name: "Setup composer authentications - {{ site }}"
33
composer:
44
command: config
5-
arguments: --auth http-basic.{{ composer_authentication.hostname }} {{ composer_authentication.username }} {{ composer_authentication.password }}
5+
arguments: --auth http-basic.{{ composer_authentication.hostname | quote }} {{ composer_authentication.username | quote }} {{ composer_authentication.password | default("") | quote }}
66
working_dir: "{{ working_dir }}"
77
no_log: true
88
changed_when: false
99
when:
10-
- not (not composer_authentication.hostname)
11-
- not (not composer_authentication.username)
12-
- not (not composer_authentication.password)
10+
- composer_authentication.hostname is defined and composer_authentication.hostname != ""
11+
- composer_authentication.username is defined and composer_authentication.username != ""
1312
loop: "{{ composer_authentications | default([]) }}"
1413
loop_control:
1514
loop_var: composer_authentication

0 commit comments

Comments
 (0)