|
27 | 27 | create_home: no
|
28 | 28 | system: yes
|
29 | 29 |
|
| 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 | + |
30 | 39 | - name: Download activemq files
|
31 | 40 | 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 |
33 | 42 | dest: /opt/
|
34 | 43 | remote_src: yes
|
35 | 44 |
|
36 | 45 | - name: Change ownership of a directory
|
37 | 46 | ansible.builtin.file:
|
38 |
| - path: /opt/apache-activemq-5.17.4 |
| 47 | + path: /opt/apache-activemq-{{ latest_version.stdout }} |
39 | 48 | state: directory
|
40 | 49 | recurse: yes
|
41 | 50 | owner: activemq
|
|
58 | 67 | - name: Replacing localhost in the configuration file
|
59 | 68 | shell: "{{ item }}"
|
60 | 69 | 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 | + |
64 | 81 |
|
65 | 82 | - name: Copy files for shell script
|
66 | 83 | copy:
|
|
0 commit comments