-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Give the user the possibility to deactivate dependency check (#911)
* fix typo * Give the user the possibility to deactivate dependency check * Create dependency_check_control.yml --------- Co-authored-by: Tom Page <[email protected]> Co-authored-by: Tom Page <[email protected]>
- Loading branch information
1 parent
ce41d8e
commit 726b31f
Showing
4 changed files
with
34 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
minor_changes: | ||
- Add ability to disable dependency check | ||
... |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
controller_dependency_check: true | ||
... |
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,23 +1,33 @@ | ||
--- | ||
# tasks file for meta_dependency_check | ||
|
||
- name: Check awx.awx is installed | ||
ansible.builtin.command: ansible-galaxy collection verify awx.awx | ||
failed_when: false | ||
changed_when: false | ||
register: upstream_dep | ||
- name: Print dependency check status | ||
ansible.builtin.debug: | ||
msg: "{{ controller_dependency_check | bool | ternary(__depdency_check_active_msg, __depdency_check_inactive_msg) }}" | ||
vars: | ||
__depdency_check_active_msg: 'Dependency check is active. Required collections presence will be verified.' | ||
__depdency_check_inactive_msg: 'Dependency check is deactivated. Required collections presence will not be verified. This might cause failure in the next tasks.' | ||
|
||
- name: Check ansible.controller is installed | ||
ansible.builtin.command: ansible-galaxy collection verify ansible.controller | ||
failed_when: false | ||
changed_when: false | ||
register: downstream_dep | ||
- name: Dependency check block | ||
when: controller_dependency_check | bool | ||
block: | ||
- name: Check awx.awx is installed | ||
ansible.builtin.command: ansible-galaxy collection verify awx.awx | ||
failed_when: false | ||
changed_when: false | ||
register: upstream_dep | ||
|
||
- name: Ensure one is installed | ||
ansible.builtin.fail: | ||
msg: One of awx.awx or ansible.controller must be installed | ||
when: | ||
- "'ERROR!' in upstream_dep.stderr" | ||
- "'ERROR!' in downstream_dep.stderr" | ||
- name: Check ansible.controller is installed | ||
ansible.builtin.command: ansible-galaxy collection verify ansible.controller | ||
failed_when: false | ||
changed_when: false | ||
register: downstream_dep | ||
|
||
- name: Ensure one is installed | ||
ansible.builtin.fail: | ||
msg: One of awx.awx or ansible.controller must be installed | ||
when: | ||
- "'ERROR!' in upstream_dep.stderr" | ||
- "'ERROR!' in downstream_dep.stderr" | ||
|
||
... |