2020-08-28 13:32:16 +02:00
|
|
|
---
|
2023-06-14 02:25:15 +02:00
|
|
|
- name: Update repo-cache for debian/ubuntu
|
2020-11-11 00:39:13 +01:00
|
|
|
become: true
|
2021-03-12 22:18:54 +01:00
|
|
|
ansible.builtin.apt:
|
2021-01-18 10:47:52 +01:00
|
|
|
update_cache: true
|
2020-11-11 01:23:46 +01:00
|
|
|
cache_valid_time: 3600
|
2020-11-11 00:39:13 +01:00
|
|
|
when:
|
2021-03-12 22:18:54 +01:00
|
|
|
- ansible_pkg_mgr == "apt"
|
2020-11-11 00:39:13 +01:00
|
|
|
|
2023-06-14 02:25:15 +02:00
|
|
|
- name: Update repo-cache for debian/ubuntu
|
2020-11-11 00:39:13 +01:00
|
|
|
become: true
|
2021-03-12 22:18:54 +01:00
|
|
|
ansible.builtin.dnf:
|
2021-01-18 10:47:52 +01:00
|
|
|
update_cache: true
|
2020-11-11 00:39:13 +01:00
|
|
|
when:
|
2020-11-11 11:11:17 +01:00
|
|
|
- ansible_os_family == 'RedHat' and ansible_distribution_version | float >= 8
|
2020-11-11 00:39:13 +01:00
|
|
|
|
2023-06-14 02:25:15 +02:00
|
|
|
- name: Install base packages for all operating systems
|
2020-08-28 13:32:16 +02:00
|
|
|
become: true
|
2021-03-12 22:18:54 +01:00
|
|
|
ansible.builtin.package:
|
2020-08-28 13:32:16 +02:00
|
|
|
name: "{{ base__packages }}"
|
|
|
|
state: "{{ base__package_state }}"
|
|
|
|
|
2023-06-14 02:25:15 +02:00
|
|
|
- name: Install python3 for all non-legacy systems
|
2020-08-29 15:00:05 +02:00
|
|
|
become: true
|
2021-03-12 22:18:54 +01:00
|
|
|
ansible.builtin.package:
|
2020-08-29 15:00:05 +02:00
|
|
|
name: "{{ base__python3_packages }}"
|
|
|
|
state: "{{ base__package_state }}"
|
|
|
|
when: |
|
|
|
|
ansible_distribution == 'Ubuntu' and ansible_distribution_version | float >= 16.0 or
|
|
|
|
ansible_os_family == 'RedHat' and ansible_distribution_version | float >= 7 or
|
|
|
|
ansible_distribution == 'Debian' and ansible_distribution_version | float >= 7
|
|
|
|
|
2023-06-14 02:25:15 +02:00
|
|
|
- name: Install python for systems where python3 packages are renamed to python
|
2020-08-29 15:00:05 +02:00
|
|
|
become: true
|
2021-03-12 22:18:54 +01:00
|
|
|
ansible.builtin.package:
|
2020-08-29 15:00:05 +02:00
|
|
|
name: "{{ base__python_packages }}"
|
|
|
|
state: "{{ base__package_state }}"
|
|
|
|
when: ansible_os_family == 'Archlinux'
|
|
|
|
|
2023-06-14 02:25:15 +02:00
|
|
|
- name: Install packages for all non-legacy systems
|
2020-08-28 13:32:16 +02:00
|
|
|
become: true
|
2021-03-12 22:18:54 +01:00
|
|
|
ansible.builtin.package:
|
2020-08-28 13:32:16 +02:00
|
|
|
name: "{{ base__modern_packages }}"
|
|
|
|
state: "{{ base__package_state }}"
|
|
|
|
when: |
|
2020-08-28 13:46:31 +02:00
|
|
|
ansible_distribution == 'Ubuntu' and ansible_distribution_version | float >= 16.0 or
|
|
|
|
ansible_os_family == 'RedHat' and ansible_distribution_version | float >= 7 or
|
2020-08-28 13:32:16 +02:00
|
|
|
ansible_distribution == 'Debian' and ansible_distribution_version | float >= 8 or
|
|
|
|
ansible_os_family == 'Archlinux'
|
2020-08-28 13:41:58 +02:00
|
|
|
|
2023-06-14 02:25:15 +02:00
|
|
|
- name: Install packages for all non-legacy Debian/Ububntu systems
|
2020-08-28 13:41:58 +02:00
|
|
|
become: true
|
2021-03-12 22:18:54 +01:00
|
|
|
ansible.builtin.package:
|
2020-08-28 13:41:58 +02:00
|
|
|
name: "{{ base__debian_packages }}"
|
|
|
|
state: "{{ base__package_state }}"
|
|
|
|
when: |
|
2020-08-28 13:46:31 +02:00
|
|
|
ansible_distribution == 'Ubuntu' and ansible_distribution_version | float >= 16.0 or
|
2020-08-28 13:41:58 +02:00
|
|
|
ansible_distribution == 'Debian' and ansible_distribution_version | float >= 8
|
2020-08-28 13:46:31 +02:00
|
|
|
|
2023-06-14 02:25:15 +02:00
|
|
|
- name: Install packages for all reasonable non-legacy systems
|
2020-08-28 13:46:31 +02:00
|
|
|
become: true
|
2021-03-12 22:18:54 +01:00
|
|
|
ansible.builtin.package:
|
2020-08-28 13:46:31 +02:00
|
|
|
name: "{{ base__linux_packages }}"
|
|
|
|
state: "{{ base__package_state }}"
|
|
|
|
when: |
|
2020-08-28 15:44:26 +02:00
|
|
|
ansible_distribution == 'Ubuntu' and ansible_distribution_version | float >= 18.0 or
|
2020-08-28 13:46:31 +02:00
|
|
|
ansible_distribution == 'Fedora' and ansible_distribution_version | float >= 32 or
|
2020-08-28 15:44:26 +02:00
|
|
|
ansible_distribution == 'Debian' and ansible_distribution_version | float >= 9 or
|
2020-08-28 13:46:31 +02:00
|
|
|
ansible_os_family == 'Archlinux'
|
2021-02-10 14:46:06 +01:00
|
|
|
|
2023-06-14 02:25:15 +02:00
|
|
|
- name: Install mailx on debian
|
2021-02-10 14:46:06 +01:00
|
|
|
become: true
|
2021-03-12 22:18:54 +01:00
|
|
|
ansible.builtin.package:
|
2021-02-10 14:46:06 +01:00
|
|
|
name:
|
|
|
|
- bsd-mailx
|
|
|
|
state: "{{ base__package_state }}"
|
|
|
|
when: ansible_distribution == 'Debian' and ansible_distribution_version | float >= 7 and base__install_mailx | bool
|