Commit | Line | Data |
---|---|---|
599b56d0 MJ |
1 | --- |
2 | - name: Ensure lttng-ust build dependencies are installed. | |
58e747d8 | 3 | zypper: "name={{ lttng_ust_packages }} state=installed update_cache=yes" |
a7bec865 | 4 | |
a464f33e KS |
5 | - name: Ensure log4j-1.2.jar exists |
6 | when: ansible_distribution_major_version == "12" | |
7 | ansible.builtin.file: | |
8 | state: link | |
9 | src: '/usr/share/java/log4j-1.2.jar' | |
10 | dest: '/usr/share/java/log4j.jar' | |
11 | ||
a7bec865 KS |
12 | # log4j2 is required for testing all the java agents, but is not available |
13 | # on SLES12SP5 via packages. | |
14 | - name: Manually install log4j2 | |
15 | when: lttng_ust_manual_log4j2_installation|default(false) | |
16 | block: | |
17 | - name: Check if download required | |
18 | ansible.builtin.command: | |
19 | argv: ['test', '-L', '/usr/share/java/log4j-core.jar', '-a', | |
20 | '-e', '/usr/share/java/log4j-core.jar', '-a', | |
21 | '-L', '/usr/share/java/log4j-api.jar', '-a', | |
22 | '-e', '/usr/share/java/log4j-api.jar', '-a', | |
23 | '-f', "/usr/share/java/apache-log4j-{{lttng_ust_log4j2_version}}-bin/log4j-api-{{lttng_ust_log4j2_version}}.jar", '-a', | |
24 | '-f', "/usr/share/java/apache-log4j-{{lttng_ust_log4j2_version}}-bin/log4j-core-{{lttng_ust_log4j2_version}}.jar" | |
25 | ] | |
26 | ignore_errors: true | |
27 | register: log4j2_download_required | |
28 | - when: "log4j2_download_required.rc != 0" | |
29 | block: | |
30 | - ansible.builtin.tempfile: | |
31 | state: file | |
32 | register: log4j2_asc_tempfile | |
33 | - ansible.builtin.get_url: | |
34 | url: "https://archive.apache.org/dist/logging/log4j/{{lttng_ust_log4j2_version}}/apache-log4j-{{lttng_ust_log4j2_version}}-bin.tar.gz.asc" | |
35 | dest: "{{log4j2_asc_tempfile.path}}" | |
36 | force: true | |
37 | - ansible.builtin.tempfile: | |
38 | state: file | |
39 | register: log4j2_tempfile | |
40 | - name: Download log4j2 binary release | |
41 | ansible.builtin.get_url: | |
42 | checksum: "sha256:https://archive.apache.org/dist/logging/log4j/{{lttng_ust_log4j2_version}}/apache-log4j-{{lttng_ust_log4j2_version}}-bin.tar.gz.sha256" | |
43 | url: "https://archive.apache.org/dist/logging/log4j/{{lttng_ust_log4j2_version}}/apache-log4j-{{lttng_ust_log4j2_version}}-bin.tar.gz" | |
44 | dest: "{{log4j2_tempfile.path}}" | |
45 | force: true | |
46 | - ansible.builtin.tempfile: | |
47 | state: file | |
48 | register: log4j2_keys_tempfile | |
49 | - ansible.builtin.get_url: | |
50 | url: "https://downloads.apache.org/logging/KEYS" | |
51 | dest: "{{log4j2_keys_tempfile.path}}" | |
52 | force: true | |
53 | - name: Import Apache developer keys | |
54 | ansible.builtin.command: | |
55 | argv: ['gpg', '--import', "{{log4j2_keys_tempfile.path}}"] | |
56 | # gpg returns non-zero exit codes if only some of the keys | |
57 | # fail to import. | |
58 | ignore_errors: true | |
59 | - name: Verify PGP signature | |
60 | ansible.builtin.command: | |
61 | argv: ['gpg', '--verify', "{{log4j2_asc_tempfile.path}}", "{{log4j2_tempfile.path}}"] | |
62 | - name: Unpack | |
63 | ansible.builtin.unarchive: | |
64 | remote_src: true | |
65 | src: "{{log4j2_tempfile.path}}" | |
66 | dest: "/usr/share/java" | |
67 | include: | |
68 | - "apache-log4j-{{lttng_ust_log4j2_version}}-bin/log4j-api-{{lttng_ust_log4j2_version}}.jar" | |
69 | - "apache-log4j-{{lttng_ust_log4j2_version}}-bin/log4j-core-{{lttng_ust_log4j2_version}}.jar" | |
70 | - name: Setup symlinks | |
71 | ansible.builtin.file: | |
72 | state: link | |
73 | src: "/usr/share/java/apache-log4j-{{lttng_ust_log4j2_version}}-bin/log4j-{{item}}-{{lttng_ust_log4j2_version}}.jar" | |
74 | dest: '/usr/share/java/log4j-{{item}}.jar' | |
75 | with_items: | |
76 | - api | |
77 | - core | |
78 | # block: | |
79 | # - ansible.builtin.file: | |
80 | # state: link | |
81 | # src: "/usr/share/java/log4j-api-{{lttng_ust_log4j2_version}}.jar" | |
82 | # dest: '/usr/share/java/log4j-api.jar' | |
83 | # - ansible.builtin.file: | |
84 | # state: link | |
85 | # src: "/usr/share/java/log4j-core-{{lttng_ust_log4j2_version}}.jar" | |
86 | # dest: '/usr/share/java/log4j-core.jar' |