Skip to content
Snippets Groups Projects
Commit 818f21d4 authored by Klaus Frank's avatar Klaus Frank
Browse files

Add ubuntu

parent c3254df3
No related branches found
No related tags found
No related merge requests found
ansible_prerequirements_packages: minimal_ansible_version: 2.10.2
- python
- lsb-release
- name: PREREQUIREMENTS | Update package index - name: "Check local ansible version >= {{ minimal_ansible_version }}"
raw: pacman -Sy delegate_to: localhost
register: command_res vars:
ansible_connection: local
run_once: true
assert:
msg: "Ansible must be {{ minimal_ansible_version }} or higher"
that:
- ansible_version.string is version(minimal_ansible_version, ">=")
- name: PREREQUIREMENTS | Get os-release
raw: cat /etc/os-release
register: os_release
changed_when: false changed_when: false
- name: PREREQUIREMENTS | Install packages - name: PREREQUIREMENTS | ArchLinux
raw: pacman --needed --noconfirm -S {{ item }} when: os_release.stdout.find("ID=arch") != -1
with_items: '{{ ansible_prerequirements_packages }}' block:
register: command_res - name: PREREQUIREMENTS | Update package index (pacman)
changed_when: "'there is nothing to do' not in command_res.stdout" raw: pacman -Sy
changed_when: false
- name: PREREQUIREMENTS | Install packages (pacman)
raw: pacman --needed --noconfirm -S {{ archlinux_prerequirements_packages|join(" ") }}
register: command_res
changed_when: command_res.stdout.find('there is nothing to do') == -1
- name: PREREQUIREMENTS | Ubuntu
when: os_release.stdout.find("ID=ubuntu")
block:
- name: PREREQUIREMENTS | Update package index (apt)
raw: apt update
changed_when: false
- name: PREREQUIREMENTS | Install packages (apt)
raw: apt install -y {{ ubuntu_prerequirements_packages|join(" ") }}
register: command_res
changed_when: command_res.stdout.find('0 upgraded, 0 newly installed, 0 to remove and ') == -1
- name: PREREQUIREMENTS | Gather facts - name: PREREQUIREMENTS | Gather facts
setup: null setup: null
......
archlinux_prerequirements_packages:
- python
- lsb-release
ubuntu_prerequirements_packages:
- python3
- lsb-release
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment