|
2 | 2 | - name: Converge |
3 | 3 | hosts: localhost |
4 | 4 | gather_facts: no |
5 | | - vars: |
6 | | - client_id: "{{ lookup('env', 'PROD_JBOSSNETWORK_API_CLIENTID') }}" |
7 | | - client_secret: "{{ lookup('env', 'PROD_JBOSSNETWORK_API_SECRET') }}" |
8 | 5 | tasks: |
9 | | - - name: Execute scenario if staging credentials are provided |
10 | | - when: |
11 | | - - client_id is defined and client_password is defined |
12 | | - block: |
13 | | - - name: "Ensures required secret are provided." |
14 | | - ansible.builtin.assert: |
15 | | - that: |
16 | | - - client_id is defined and client_id | length > 0 |
17 | | - - client_secret is defined and client_secret | length > 0 |
18 | | - fail_msg: "Missing required env vars PROD_JBOSSNETWORK_API_CLIENTID and/or PROD_JBOSSNETWORK_API_SECRET" |
| 6 | + - name: "Ensures required secret are provided." |
| 7 | + ansible.builtin.assert: |
| 8 | + that: |
| 9 | + - client_id is defined and client_id | length > 0 |
| 10 | + - client_secret is defined and client_secret | length > 0 |
| 11 | + fail_msg: "Missing required env vars PROD_JBOSSNETWORK_API_CLIENTID and/or PROD_JBOSSNETWORK_API_SECRET" |
19 | 12 |
|
20 | | - - name: Search EAP Product |
21 | | - middleware_automation.common.product_search: |
22 | | - client_id: "{{ client_id }}" |
23 | | - client_secret: "{{ client_secret }}" |
24 | | - product_type: DISTRIBUTION |
25 | | - product_version: '7.4' |
26 | | - product_category: appplatform |
27 | | - register: rhn_products |
28 | | - no_log: false |
| 13 | + - name: Search EAP Product |
| 14 | + middleware_automation.common.product_search: |
| 15 | + client_id: "{{ lookup('env', 'PROD_JBOSSNETWORK_API_CLIENTID') }}" |
| 16 | + client_secret: "{{ lookup('env', 'PROD_JBOSSNETWORK_API_SECRET') }}" |
| 17 | + product_type: DISTRIBUTION |
| 18 | + product_version: '7.4' |
| 19 | + product_category: appplatform |
| 20 | + register: rhn_products |
| 21 | + no_log: false |
29 | 22 |
|
30 | | - - name: Search install zipfile |
31 | | - ansible.builtin.set_fact: |
32 | | - rhn_filtered_products: "{{ rhn_products.results | selectattr('file_path', 'match', '[^/]*/jboss-eap-7.4.0.zip$') }}" |
| 23 | + - name: Search install zipfile |
| 24 | + ansible.builtin.set_fact: |
| 25 | + rhn_filtered_products: "{{ rhn_products.results | selectattr('file_path', 'match', '[^/]*/jboss-eap-7.4.0.zip$') }}" |
33 | 26 |
|
34 | | - - name: Retrieve product download using JBossNetwork API |
35 | | - middleware_automation.common.product_search: |
36 | | - client_id: "{{ client_id }}" |
37 | | - client_secret: "{{ client_secret }}" |
38 | | - product_type: BUGFIX |
39 | | - product_version: '7.4' |
40 | | - product_category: appplatform |
41 | | - register: rhn_products |
42 | | - no_log: true |
| 27 | + - name: Retrieve product download using JBossNetwork API |
| 28 | + middleware_automation.common.product_search: |
| 29 | + client_id: "{{ client_id }}" |
| 30 | + client_secret: "{{ client_secret }}" |
| 31 | + product_type: BUGFIX |
| 32 | + product_version: '7.4' |
| 33 | + product_category: appplatform |
| 34 | + register: rhn_products |
| 35 | + no_log: true |
43 | 36 |
|
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 }}" |
| 37 | + - name: Determine patch versions list |
| 38 | + ansible.builtin.set_fact: |
| 39 | + 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 | 40 |
|
48 | | - - name: Determine latest version |
49 | | - ansible.builtin.debug: |
50 | | - msg: "JBoss EAP 7.4 most recent CP is version {{ filtered_versions | middleware_automation.common.version_sort | last }}" |
| 41 | + - name: Determine latest version |
| 42 | + ansible.builtin.debug: |
| 43 | + msg: "JBoss EAP 7.4 most recent CP is version {{ filtered_versions | middleware_automation.common.version_sort | last }}" |
0 commit comments