GeezerVison is showing github.com — devops-resources/resources/ansible.md at master · SudyLiu/devops-resources
60 lines (44 loc) · 1.97 KB
File metadata and controls
60 lines (44 loc) · 1.97 KB
Copy raw file
Download raw file
OutlineEdit and raw actions
- Check if list has elements
when: my_list | length > 0
- name: Update system packages
package:
state: latest
name: "*"
- Update packages informations and display packages informations
- name: Update packages informations
package_facts:
manager: "auto"
- name: Display all installed packages informations
debug:
msg: "{{ ansible_facts.packages }}"
- name: Display all Chromium package informations
debug:
msg: "{{ ansible_facts.packages['chromium'] }}"
when: "'chromium' in ansible_facts.packages"