Skip to content

Commit d4363f1

Browse files
authored
OPSEXP-3205 Handle extra amps in upgrade checks (#1223)
1 parent bba1d0e commit d4363f1

File tree

5 files changed

+39
-2
lines changed

5 files changed

+39
-2
lines changed

.secrets.baseline

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@
159159
"filename": "playbooks/acs.yml",
160160
"hashed_secret": "0ca8f28152882e5edb182fc3f7d4ae10a5b10dc5",
161161
"is_verified": false,
162-
"line_number": 628
162+
"line_number": 639
163163
}
164164
],
165165
"roles/activemq/molecule/default/tests/test_activemq.py": [
@@ -203,5 +203,5 @@
203203
}
204204
]
205205
},
206-
"generated_at": "2025-05-23T12:57:23Z"
206+
"generated_at": "2025-07-03T14:21:08Z"
207207
}

docs/deployment-guide.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -687,12 +687,17 @@ in the commented example below:
687687
```yml
688688
acs_play_repository_extra_amp_downloads: []
689689
# - url: "https://your.repo.com/path/to/your/artifacts/your-amp.amp"
690+
# name: your-amp # optional, name is used for upgrade checks
691+
# version: 1.0.0 # optional, version is used for upgrade checks
690692
# checksum: "sha1:2aae6c35c94fcfb415dbe95f408b9ce91ee846ed"
691693
# dest: "{{ repository_content_folder }}/<amps_repo|amps_share>/your-amp.amp"
692694
# url_username: your_username_to_repo
693695
# url_password: your_password_to_repo
694696
```
695697
698+
> :warning: `name` and `version` are not mandatory but highly recommended to
699+
> use, they are used in the upgrade checks to avoid unsupported upgrades.
700+
696701
### JVM Options
697702
698703
Each Java based service deployed by the playbook is configured with some default settings, including memory settings.

playbooks/acs.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -402,6 +402,17 @@
402402
}) }}
403403
when: acs_is_enterprise
404404

405+
- name: Add extra amps if provided and required properties are set
406+
ansible.builtin.set_fact:
407+
amps: >-
408+
{{ amps | combine({
409+
item.name: {
410+
'version': item.version
411+
}
412+
}) }}
413+
loop: "{{ acs_play_repository_extra_amp_downloads | default([]) }}"
414+
when: item.version is defined and item.name is defined
415+
405416
- name: Update installation status file with ACS
406417
become: true
407418
vars:

playbooks/group_vars/repository.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ acs_play_repository_amp_aos_module_archive_url: "{{ acs_play_repository_amp_aos_
4040
# additional list of amp downloads
4141
acs_play_repository_extra_amp_downloads: []
4242
# - url: "https://your.repo.com/path/to/your/artifacts/your-amp.amp"
43+
# name: your-amp # optional, name is used for upgrade checks
44+
# version: 1.0.0 # optional, version is used for upgrade checks
4345
# checksum: "sha1:2aae6c35c94fcfb415dbe95f408b9ce91ee846ed"
4446
# dest: "{{ repository_content_folder }}/<amps_repo|amps_share>/your-amp.amp"
4547
# url_username: your_username_to_repo

playbooks/prerun-upgrade-checks.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,25 @@
7070
}) }}
7171
when: acs_play_repository_acs_edition == 'Enterprise'
7272

73+
- name: Add extra amps if provided and required properties are set
74+
vars:
75+
# Vars commonly used in the list that are not accessible by this
76+
# playbook as they are not defined in the repository group_vars
77+
# file. Nexus credentials are comming from common role which
78+
# eventually will be moved to global secrets.
79+
repository_content_folder: ""
80+
nexus_user: ""
81+
nexus_password: ""
82+
ansible.builtin.set_fact:
83+
amps: >-
84+
{{ amps | combine({
85+
item.name: {
86+
'version': item.version
87+
}
88+
}) }}
89+
loop: "{{ acs_play_repository_extra_amp_downloads | default([]) }}"
90+
when: item.name is defined and item.version is defined
91+
7392
- name: Fail on unsupported AMPS upgrades
7493
ansible.builtin.fail:
7594
when: |

0 commit comments

Comments
 (0)