|
2 | 2 | - name: Converge |
3 | 3 | hosts: all |
4 | 4 | gather_facts: yes |
5 | | - tasks: |
6 | | - - name: Search EAP Product |
7 | | - middleware_automation.common.product_search: |
8 | | - api_url: "https://jbossnetwork.stage.api.redhat.com" |
9 | | - sso_url: "https://sso.stage.redhat.com" |
| 5 | + vars: |
10 | 6 | client_id: "{{ lookup('env', 'STAGE_JBOSSNETWORK_API_CLIENTID') }}" |
11 | 7 | client_secret: "{{ lookup('env', 'STAGE_JBOSSNETWORK_API_SECRET') }}" |
12 | | - product_type: DISTRIBUTION |
13 | | - product_version: '7.4' |
14 | | - product_category: appplatform |
15 | | - register: rhn_products |
16 | | - no_log: false |
| 8 | + tasks: |
| 9 | + - name: Execute scenario if staging credentials are provided |
| 10 | + when: |
| 11 | + - client_id is defined and client_password is defined |
| 12 | + block: |
17 | 13 |
|
18 | | - - name: Search install zipfile |
19 | | - ansible.builtin.set_fact: |
20 | | - rhn_filtered_products: "{{ rhn_products.results | selectattr('file_path', 'match', '[^/]*/jboss-eap-7.4.0.zip$') }}" |
| 14 | + - name: Search EAP Product |
| 15 | + middleware_automation.common.product_search: |
| 16 | + api_url: "https://jbossnetwork.stage.api.redhat.com" |
| 17 | + sso_url: "https://sso.stage.redhat.com" |
| 18 | + client_id: "{{ lookup('env', 'STAGE_JBOSSNETWORK_API_CLIENTID') }}" |
| 19 | + client_secret: "{{ lookup('env', 'STAGE_JBOSSNETWORK_API_SECRET') }}" |
| 20 | + product_type: DISTRIBUTION |
| 21 | + product_version: '7.4' |
| 22 | + product_category: appplatform |
| 23 | + register: rhn_products |
| 24 | + no_log: false |
21 | 25 |
|
22 | | - - name: Retrieve product download using JBossNetwork API |
23 | | - middleware_automation.common.product_search: |
24 | | - api_url: "https://jbossnetwork.stage.api.redhat.com" |
25 | | - sso_url: "https://sso.stage.redhat.com" |
26 | | - client_id: "{{ lookup('env', 'STAGE_JBOSSNETWORK_API_CLIENTID') }}" |
27 | | - client_secret: "{{ lookup('env', 'STAGE_JBOSSNETWORK_API_SECRET') }}" |
28 | | - product_type: BUGFIX |
29 | | - product_version: '7.4' |
30 | | - product_category: appplatform |
31 | | - register: rhn_products |
32 | | - no_log: true |
33 | | - |
34 | | - - name: Patch |
35 | | - block: |
36 | | - - name: Determine patch versions list |
| 26 | + - name: Search install zipfile |
37 | 27 | ansible.builtin.set_fact: |
38 | | - filtered_versions: "{{ rhn_products.results | map(attribute='file_path') | select('match', '^[^/]*/jboss-eap-.*[0-9]*[.][0-9]*[.][0-9]*.*$') | map('regex_replace','[^/]*/jboss-eap-([0-9]*[.][0-9]*[.][0-9]*)-.*','\\1' ) | list | unique }}" |
39 | | - - name: Determine latest version |
40 | | - ansible.builtin.debug: |
41 | | - msg: "JBoss EAP 7.4 most recent CP is version {{ filtered_versions | middleware_automation.common.version_sort | last }}" |
42 | | - rescue: |
43 | | - - name: No patches on staging |
44 | | - ansible.builtin.debug: |
45 | | - msg: "JBoss EAP 7.4 has no patches" |
| 28 | + rhn_filtered_products: "{{ rhn_products.results | selectattr('file_path', 'match', '[^/]*/jboss-eap-7.4.0.zip$') }}" |
| 29 | + |
| 30 | + - name: Retrieve product download using JBossNetwork API |
| 31 | + middleware_automation.common.product_search: |
| 32 | + api_url: "https://jbossnetwork.stage.api.redhat.com" |
| 33 | + sso_url: "https://sso.stage.redhat.com" |
| 34 | + client_id: "{{ lookup('env', 'STAGE_JBOSSNETWORK_API_CLIENTID') }}" |
| 35 | + client_secret: "{{ lookup('env', 'STAGE_JBOSSNETWORK_API_SECRET') }}" |
| 36 | + product_type: BUGFIX |
| 37 | + product_version: '7.4' |
| 38 | + product_category: appplatform |
| 39 | + register: rhn_products |
| 40 | + no_log: true |
| 41 | + |
| 42 | + - name: Patch |
| 43 | + block: |
| 44 | + - name: Determine patch versions list |
| 45 | + ansible.builtin.set_fact: |
| 46 | + filtered_versions: "{{ rhn_products.results | map(attribute='file_path') | select('match', '^[^/]*/jboss-eap-.*[0-9]*[.][0-9]*[.][0-9]*.*$') | map('regex_replace','[^/]*/jboss-eap-([0-9]*[.][0-9]*[.][0-9]*)-.*','\\1' ) | list | unique }}" |
| 47 | + - name: Determine latest version |
| 48 | + ansible.builtin.debug: |
| 49 | + msg: "JBoss EAP 7.4 most recent CP is version {{ filtered_versions | middleware_automation.common.version_sort | last }}" |
| 50 | + rescue: |
| 51 | + - name: No patches on staging |
| 52 | + ansible.builtin.debug: |
| 53 | + msg: "JBoss EAP 7.4 has no patches" |
0 commit comments