Compare commits

...

2 Commits

Author SHA1 Message Date
Timothy Liao
d80983875c docs: remove outdated ansible-galaxy install from CONTRIBUTING.md (#13038) 2026-02-24 12:21:35 +05:30
Max Gautier
4ca7c2f5c5 system_packages: skip action if package set is empty (#13015)
We currently invoke the package module even if the set of package is
empty.

This apparently make the package manager of OpenEuler to regularly time
out.
2026-02-24 09:13:33 +05:30
2 changed files with 11 additions and 5 deletions

View File

@@ -12,7 +12,6 @@ To install development dependencies you can set up a python virtual env with the
virtualenv venv
source venv/bin/activate
pip install -r tests/requirements.txt
ansible-galaxy install -r tests/requirements.yml
```
#### Linting

View File

@@ -47,7 +47,7 @@
- name: Manage packages
package:
name: "{{ item.packages | dict2items | selectattr('value', 'ansible.builtin.all') | map(attribute='key') }}"
name: "{{ item.packages }}"
state: "{{ item.state }}"
update_cache: "{{ true if ansible_pkg_mgr in ['zypper', 'apt', 'dnf'] else omit }}"
cache_valid_time: "{{ 86400 if ansible_pkg_mgr == 'apt' else omit }}" # 24h
@@ -55,10 +55,17 @@
until: pkgs_task_result is succeeded
retries: "{{ pkg_install_retries }}"
delay: "{{ retry_stagger | random + 3 }}"
when: not (ansible_os_family in ["Flatcar", "Flatcar Container Linux by Kinvolk"] or is_fedora_coreos)
when:
- ansible_os_family not in ["Flatcar", "Flatcar Container Linux by Kinvolk"]
- not is_fedora_coreos
- item.packages != []
loop:
- { packages: "{{ pkgs_to_remove }}", state: "absent", action_label: "remove" }
- { packages: "{{ pkgs }}", state: "present", action_label: "install" }
- packages: "{{ pkgs_to_remove | dict2items | selectattr('value', 'ansible.builtin.all') | map(attribute='key') }}"
state: "absent"
action_label: "remove"
- packages: "{{ pkgs | dict2items | selectattr('value', 'ansible.builtin.all') | map(attribute='key') }}"
state: "present"
action_label: "install"
loop_control:
label: "{{ item.action_label }}"
tags: