-
-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1413 from TangRufus/composer-auth-principles
- Loading branch information
Showing
3 changed files
with
74 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 35 additions & 7 deletions
42
roles/wordpress-install/tasks/composer-authentications.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,44 @@ | ||
--- | ||
- name: "Setup composer authentications - {{ site }}" | ||
- name: "Setup composer authentications (HTTP Basic) - {{ site }}" | ||
composer: | ||
command: config | ||
arguments: --auth http-basic.{{ composer_authentication.hostname | quote }} {{ composer_authentication.username | quote }} {{ composer_authentication.password | default("") | quote }} | ||
arguments: --auth http-basic.{{ item.hostname | quote }} {{ item.username | quote }} {{ item.password | default("") | quote }} | ||
working_dir: "{{ working_dir }}" | ||
become: no | ||
no_log: true | ||
changed_when: false | ||
when: | ||
- composer_authentication.hostname is defined and composer_authentication.hostname != "" | ||
- composer_authentication.username is defined and composer_authentication.username != "" | ||
loop: "{{ composer_authentications | default([]) }}" | ||
- item.hostname is defined and item.hostname != "" | ||
- item.username is defined and item.username != "" | ||
loop: "{{ composer_authentications_using_basic_auth }}" | ||
loop_control: | ||
loop_var: composer_authentication | ||
label: "{{ composer_authentication.hostname }}" | ||
label: "{{ item.type | default('default-type') }}.{{ item.hostname }}" | ||
|
||
- name: "Setup composer authentications (BitBucket OAuth) - {{ site }}" | ||
composer: | ||
command: config | ||
arguments: --auth bitbucket-oauth.{{ item.hostname | quote }} {{ item.consumer_key | quote }} {{ item.consumer_secret | quote }} | ||
working_dir: "{{ working_dir }}" | ||
no_log: true | ||
changed_when: false | ||
when: | ||
- item.hostname is defined and item.hostname != "" | ||
- item.consumer_key is defined and item.consumer_key != "" | ||
- item.consumer_secret is defined and item.consumer_secret != "" | ||
loop: "{{ composer_authentications_using_bitbucket_oauth }}" | ||
loop_control: | ||
label: "{{ item.type }}.{{ item.hostname }}" | ||
|
||
- name: "Setup composer authentications (Other Tokens) - {{ site }}" | ||
composer: | ||
command: config | ||
arguments: --auth {{ item.type | quote }}.{{ item.hostname | quote }} {{ item.token | quote }} | ||
working_dir: "{{ working_dir }}" | ||
no_log: true | ||
changed_when: false | ||
when: | ||
- item.hostname is defined and item.hostname != "" | ||
- item.token is defined and item.token != "" | ||
loop: "{{ composer_authentications_using_other_token }}" | ||
loop_control: | ||
label: "{{ item.type }}.{{ item.hostname }}" |