improve NTP package conflict handling (#12212)

Signed-off-by: bo.jiang <bo.jiang@daocloud.io>
This commit is contained in:
ERIK
2025-05-16 18:55:14 +08:00
committed by GitHub
parent bca5a4ce3b
commit e4c0c427a3
9 changed files with 53 additions and 24 deletions

View File

@@ -65,14 +65,19 @@
tags:
- bootstrap_os
- name: Install packages requirements
- name: Manage packages
package:
name: "{{ pkgs | dict2items | selectattr('value', 'ansible.builtin.all') | map(attribute='key') }}"
state: present
name: "{{ item.packages | dict2items | selectattr('value', 'ansible.builtin.all') | map(attribute='key') }}"
state: "{{ item.state }}"
register: pkgs_task_result
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)
loop:
- { packages: "{{ pkgs_to_remove }}", state: "absent", action_label: "remove" }
- { packages: "{{ pkgs }}", state: "present", action_label: "install" }
loop_control:
label: "{{ item.action_label }}"
tags:
- bootstrap_os