diff options
author | Christian Pointner <equinox@spreadspace.org> | 2020-10-08 22:44:54 +0200 |
---|---|---|
committer | Christian Pointner <equinox@spreadspace.org> | 2020-10-08 22:44:54 +0200 |
commit | 905b31acaa286c18b8914bdd3f06fd2d00932230 (patch) | |
tree | 39a4223ce08e16883a936699bdc49d1952d732ed /roles/apt-repo/blackmagic | |
parent | remove ch-oulu (testhost) (diff) |
no more flush-handlers for apt-repos
Diffstat (limited to 'roles/apt-repo/blackmagic')
-rw-r--r-- | roles/apt-repo/blackmagic/handlers/main.yml | 4 | ||||
-rw-r--r-- | roles/apt-repo/blackmagic/tasks/main.yml | 44 |
2 files changed, 25 insertions, 23 deletions
diff --git a/roles/apt-repo/blackmagic/handlers/main.yml b/roles/apt-repo/blackmagic/handlers/main.yml deleted file mode 100644 index 03ed878a..00000000 --- a/roles/apt-repo/blackmagic/handlers/main.yml +++ /dev/null @@ -1,4 +0,0 @@ ---- -- name: update apt cache - apt: - update_cache: yes diff --git a/roles/apt-repo/blackmagic/tasks/main.yml b/roles/apt-repo/blackmagic/tasks/main.yml index 3152d7b8..c2652ed3 100644 --- a/roles/apt-repo/blackmagic/tasks/main.yml +++ b/roles/apt-repo/blackmagic/tasks/main.yml @@ -3,7 +3,7 @@ copy: src: repo.gpg dest: /etc/apt/trusted.gpg.d/blackmagic.gpg - notify: update apt cache + register: apt_repo_blackmagic_key - name: configure repo authentication @@ -16,28 +16,28 @@ 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 + register: apt_repo_blackmagic_auth_legacy - 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: remove old repo authentication + lineinfile: + path: /etc/apt/auth.conf + regexp: "^machine build.spreadspace.org " + state: absent + register: apt_repo_blackmagic_auth_legacy_remove - - 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: 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 + register: apt_repo_blackmagic_auth - name: add repository entry @@ -45,7 +45,13 @@ content: | deb https://build.spreadspace.org/ {{ ansible_distribution_release }} blackmagic dest: /etc/apt/sources.list.d/blackmagic.list - notify: update apt cache + register: apt_repo_blackmagic_sources - name: update apt cache - meta: flush_handlers + when: apt_repo_blackmagic_key is changed or + apt_repo_blackmagic_auth_legacy is changed or + apt_repo_blackmagic_auth_legacy_remove is changed or + apt_repo_blackmagic_auth is changed or + apt_repo_blackmagic_sources is changed + apt: + update_cache: yes |