summaryrefslogtreecommitdiff
path: root/roles/apt-repo
diff options
context:
space:
mode:
authorChristian Pointner <equinox@spreadspace.org>2020-02-07 20:23:19 +0100
committerChristian Pointner <equinox@spreadspace.org>2020-02-07 20:23:19 +0100
commit8b113cfbd1068ba63c7021dac03b37aecabe4ffc (patch)
tree8e639e9c4918d3f2439ca0c11165ff67cbc04fa1 /roles/apt-repo
parentkubernetes/kubeadm: haproxy logging (diff)
fix blackmagic repo auth
Diffstat (limited to 'roles/apt-repo')
-rw-r--r--roles/apt-repo/blackmagic/tasks/main.yml38
1 files changed, 31 insertions, 7 deletions
diff --git a/roles/apt-repo/blackmagic/tasks/main.yml b/roles/apt-repo/blackmagic/tasks/main.yml
index 7eb99dac..01cf9c99 100644
--- a/roles/apt-repo/blackmagic/tasks/main.yml
+++ b/roles/apt-repo/blackmagic/tasks/main.yml
@@ -10,17 +10,41 @@
dest: /etc/apt/trusted.gpg.d/blackmagic.gpg
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
- dest: /etc/apt/auth.conf.d/blackmagic.conf
+ 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: |