Skip to content
Snippets Groups Projects
Select Git revision
  • e653a7f6ff89e8c9aacbce9877399566695fc8fe
  • master default protected
2 results

prepare.yml

Blame
  • prepare.yml 2.17 KiB
    ---
    - name: Prepare
      hosts: "*"
      gather_facts: true
      pre_tasks:
        - name: create group
          ansible.builtin.group:
            name: "lza"
          become: true
    
        - name: configure additional package repositories for Debian
          block: 
          - name: add 'contrib' repos to default Debian repos
            ansible.builtin.replace:
              path: "/etc/apt/sources.list"
              regexp: " main$"
              replace: " main contrib"
            become: true
          - name: install GPG
            ansible.builtin.apt:
              name: "gnupg"
              state: latest
              update_cache: true
            become: true
          - name: add GPG key for SLUB Debian repository
            ansible.builtin.apt_key:
              url: "https://sdvdebianrepo.slub-dresden.de/deb-repository/pub.gpg.key"
              state: present
            become: true
          - name: add repo URL to sources.list
            ansible.builtin.apt_repository:
              repo: "deb https://sdvdebianrepo.slub-dresden.de/deb-repository bullseye main"
              state: present
              update_cache: true
              mode: "0644"
            become: true
          when: ansible_os_family == "Debian"
    
        - name: configure additional package repositories for RedHat
          block:
          - name: add custom repositories
            ansible.builtin.yum_repository:
              name: "{{ item.name }}"
              description: "{{ item.description }}"
              baseurl: "{{ item.baseurl }}"
              gpgcheck: "{{ item.gpgcheck | default('true') }}"
              gpgkey: "{{ item.gpgkey | default(omit) }}"
            loop:
              - name: "epel"
                description: EPEL YUM repo
                baseurl: "https://download.fedoraproject.org/pub/epel/{{ ansible_distribution_major_version }}/x86_64/"
                gpgkey: "https://dl.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-{{ ansible_distribution_major_version }}"
              - name: "slub"
                description: SLUB YUM repo
                baseurl: "http://sdvrhelrepo.slub-dresden.de/"
                gpgcheck: "false"
          - name: remove legacy repo configuration to avoid double configuration for SLUB repo
            ansible.builtin.file:
              path: "/etc/yum.repos.d/SLUB.repo"
              state: absent
          when: ansible_os_family == "RedHat"