Skip to content

Commit 0431364

Browse files
committed
Updated ActiveMQ url
1 parent e5dbd4f commit 0431364

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

activemq-22-04/activemq.yaml

+22-5
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,24 @@
2727
create_home: no
2828
system: yes
2929

30+
- name: Get the directory listing
31+
shell: |
32+
curl -s https://dlcdn.apache.org/activemq/ \
33+
| grep -oP '(?<=<a href=")[^/]+(?=/")' \
34+
| grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' \
35+
| sort -V \
36+
| head -n 1
37+
register: latest_version
38+
3039
- name: Download activemq files
3140
ansible.builtin.unarchive:
32-
src: https://dlcdn.apache.org/activemq/5.17.4/apache-activemq-5.17.4-bin.tar.gz
41+
src: https://dlcdn.apache.org/activemq/{{ latest_version.stdout }}/apache-activemq-{{ latest_version.stdout }}-bin.tar.gz
3342
dest: /opt/
3443
remote_src: yes
3544

3645
- name: Change ownership of a directory
3746
ansible.builtin.file:
38-
path: /opt/apache-activemq-5.17.4
47+
path: /opt/apache-activemq-{{ latest_version.stdout }}
3948
state: directory
4049
recurse: yes
4150
owner: activemq
@@ -58,9 +67,17 @@
5867
- name: Replacing localhost in the configuration file
5968
shell: "{{ item }}"
6069
with_items:
61-
- "sed -i 's/127.0.0.1/0.0.0.0/g' /opt/apache-activemq-5.17.4/conf/jetty.xml"
62-
- "sed -i 's/admin: admin, admin/admin: {{ activemqadminpassword.stdout }}, admin/g' /opt/apache-activemq-5.17.4/conf/jetty-realm.properties"
63-
- "sed -i 's/user: user, user//g' /opt/apache-activemq-5.17.4/conf/jetty-realm.properties"
70+
- "sed -i 's/127.0.0.1/0.0.0.0/g' /opt/apache-activemq-{{ latest_version.stdout }}/conf/jetty.xml"
71+
- "sed -i 's/admin: admin, admin/admin: {{ activemqadminpassword.stdout }}, admin/g' /opt/apache-activemq-{{ latest_version.stdout }}/conf/jetty-realm.properties"
72+
- "sed -i 's/user: user, user//g' /opt/apache-activemq-{{ latest_version.stdout }}/conf/jetty-realm.properties"
73+
74+
- name: change the version name on the activemq.service
75+
replace:
76+
path: /usr/local/src/activemq-22-04/etc/systemd/system/activemq.service
77+
regexp: '5.17.4'
78+
replace: '{{ latest_version.stdout }}'
79+
80+
6481

6582
- name: Copy files for shell script
6683
copy:

0 commit comments

Comments
 (0)