Skip to content
Snippets Groups Projects
Select Git revision
  • d5cd31eb3ac20112916f8348104d56a554b0ce6c
  • master default
  • v1
  • btrfs-backup
4 results

main.yml

Blame
  • main.yml 4.51 KiB
    ---
    - name: Verify assertions
      assert:
        that:
          - ansible_distribution == "Debian"
          - ansible_distribution_major_version|int >= 10
    
    - name: Disable cgroup2 for Docker
      lineinfile:
        backup: true
        line: |-
          GRUB_CMDLINE_LINUX_DEFAULT="quiet systemd.unified_cgroup_hierarchy=0"
        path: /etc/default/grub
      notify:
        - Update GRUB
    
    - name: Enable the backports repo
      loop:
        - deb
        - deb-src
      apt_repository:
        # yamllint disable-line rule:line-length
        repo: '{{ item }} http://deb.debian.org/debian {{ ansible_distribution_release }}-backports main contrib non-free'
        state: present
        update_cache: true
    
    - name: Set normal priority for the backports repo
      copy:
        content: |
          Package: *
          Pin: release  o=Debian Backports
          Pin-Priority: 500
        dest: /etc/apt/preferences.d/backports
        group: root
        mode: 0o644
        owner: root
    
    - name: Install packages
      apt:
        cache_valid_time: 3600
        name:
          - amd64-microcode
          - btrfs-progs
          - cryptsetup
          - curl
          - docker.io
          - fwupd
          - git
          - intel-microcode
          - libpam-mount-bin
          - make
          - python3-cryptography
          - rsync
          - tmux
          - ufw
        state: present
    
    - name: Copy the script to start stopped container after a restart
      copy:
        dest: /usr/share/docker.io/restart-containers
        mode: preserve
        src: docker-restart
    
    - name: Create a drop-in directory for the Docker service
      file:
        path: /etc/systemd/system/docker.service.d
        mode: 0o0755
        state: directory
    
    - name: Restart stopped containers after a restart