--- - name: install repo key copy: src: repo.gpg dest: /etc/apt/trusted.gpg.d/blackmagic.gpg notify: update apt cache - name: configure repo authentication when: - ansible_distribution == "Debian" - (ansible_distribution_major_version | int) < 10 lineinfile: path: /etc/apt/auth.conf regexp: "^machine build.spreadspace.org " line: "machine build.spreadspace.org login {{ apt_repo_blackmagic_auth.username }} password {{ apt_repo_blackmagic_auth.password }}" create: yes mode: 0600 notify: update apt cache - name: configure repo authentication when: (ansible_distribution == "Ubuntu") or (ansible_distribution == "Debian" and (ansible_distribution_major_version | int) >= 10) block: - name: remove old repo authentication lineinfile: path: /etc/apt/auth.conf regexp: "^machine build.spreadspace.org " state: absent notify: update apt cache - name: configure repo authentication copy: content: | machine build.spreadspace.org login {{ apt_repo_blackmagic_auth.username }} password {{ apt_repo_blackmagic_auth.password }} dest: /etc/apt/auth.conf.d/blackmagic.conf mode: 0600 notify: update apt cache - name: add repository entry copy: content: | deb https://build.spreadspace.org/ {{ ansible_distribution_release }} blackmagic dest: /etc/apt/sources.list.d/blackmagic.list notify: update apt cache - name: update apt cache meta: flush_handlers