Skip to content

Commit 2348269

Browse files
committed
install packages in batch so yum can work out the dependencies
1 parent 0b3300c commit 2348269

File tree

2 files changed

+14
-17
lines changed

2 files changed

+14
-17
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ This role has multiple variables. The descriptions and defaults for all these va
5555
Dependencies
5656
------------
5757

58-
Since this role uses the [package_facts](https://docs.ansible.com/ansible/latest/modules/package_facts_module.html) module, on debian-based systems the `python-apt` package must be installed on targeted hosts.
58+
- Since this role uses the [package_facts](https://docs.ansible.com/ansible/latest/modules/package_facts_module.html) module, on debian-based systems the `python-apt` package must be installed on targeted hosts.
59+
60+
- NGINX+ R18-R20 must already be installed on the target system
5961

6062
Example Playbook
6163
----------------

tasks/install-app-protect-linux.yml

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,26 +73,21 @@
7373
use_regex: true
7474
patterns:
7575
- "^(?!.*nginx-plus-{{ app_protect_version }}).*\\.rpm$"
76-
register: rpm_files
76+
register: rpm_files_dict
7777

78-
- name: Install f5 packages
79-
package:
80-
name: "{{ rpm_files | select('match', '^f5.*.rpm$') | list }}"
81-
state: present
82-
83-
- name: Install app-protect dependency packages
84-
package:
85-
name: "{{ rpm_files | select('match', '^app-protect-[^\\d].*\\.rpm$') | list }}"
86-
state: present
78+
- name: Remap list to just filenames
79+
set_fact:
80+
key_value: "" # appeasing the linter
81+
rpm_files: "{{ rpm_files_dict.files | map(attribute='path' | basename) | list }}"
8782

88-
- name: Install app-protect NGINX+ module package
89-
package:
90-
name: "{{ rpm_files | select('match', '^nginx-plus-module-appprotect-.*\\.rpm$') | list }}"
91-
state: present
83+
- name: Debug rpm files found
84+
debug:
85+
msg: "rpm files found: {{ rpm_files }}"
86+
verbosity: 2
9287

93-
- name: Install app-protect core package
88+
- name: Install packages
9489
package:
95-
name: "{{ rpm_files | select('match', '^app-protect-\\d{2,3}.*\\.rpm$') | list }}"
90+
name: "{{ rpm_files }}"
9691
state: present
9792

9893
- name: Disable SELinux

0 commit comments

Comments
 (0)