Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
apt.yml 3.84 KiB
---
- hosts: "{{ host_list }}"
  remote_user: root

  tasks:

    - name: INCLUDE_VARS | base
      ansible.builtin.include_vars: "main.yml"

    - name: INCLUDE_VARS | OS
      ansible.builtin.include_vars: "{{ ansible_distribution }}.yml"

    - name: INCLUDE_VARS | Gnome
      when: "'gnome' in group_names"
      ansible.builtin.include_vars: "Gnome.yml"

    - name: INCLUDE_VARS | Mate
      when: "'mate' in group_names"
      ansible.builtin.include_vars: "Mate.yml"

    - name: APT | uninstall packages
      when: inventory_hostname not in groups.workstat
      ansible.builtin.apt:
        pkg: "{{ lookup('flattened', base_uninstall_pkg, os_uninstall_pkg) }}"
        state: absent

    - name: APT | install base & os packages
      ansible.builtin.apt:
        cache_valid_time: 3600
        force_apt_get: true
        pkg: "{{ lookup('flattened', base_pkg, os_pkg) }}"
        state: present
        update_cache: true

    - name: SNAP  | remove snap packages
      when: snap_uninstall_pkg is defined
      community.general.snap:
        name: "{{ snap_uninstall_pkg }}"
        state: absent

    - name: FLATPAK | add remote
      when: inventory_hostname in groups.station
      community.general.flatpak_remote:
        name: flathub
        flatpakrepo_url: https://flathub.org/repo/flathub.flatpakrepo
        state: present

    - name: FLATPAK | add packages
      when: inventory_hostname in groups.station
      community.general.flatpak:
        name: com.brave.Browser
        state: present
        remote: flathub

    - name: APT | install station packages
      when: inventory_hostname in groups.station
      ansible.builtin.apt:
        cache_valid_time: 3600
        force_apt_get: true
        pkg: "{{ lookup('flattened', station_pkg, station_os_pkg, station_wm_pkg) }}"
        state: present
        update_cache: true

    - name: APT | install workstat packages
      when: inventory_hostname in groups.workstat
      ansible.builtin.apt:
        cache_valid_time: 3600
        force_apt_get: true
        pkg: "{{ lookup('flattened', workstat_pkg, workstat_os_pkg, workstat_wm_pkg) }}"
        state: present