summaryrefslogtreecommitdiff
path: root/roles/apt-repo/aptly
diff options
context:
space:
mode:
Diffstat (limited to 'roles/apt-repo/aptly')
-rw-r--r--roles/apt-repo/aptly/handlers/main.yml4
-rw-r--r--roles/apt-repo/aptly/tasks/main.yml9
2 files changed, 6 insertions, 7 deletions
diff --git a/roles/apt-repo/aptly/handlers/main.yml b/roles/apt-repo/aptly/handlers/main.yml
deleted file mode 100644
index 03ed878a..00000000
--- a/roles/apt-repo/aptly/handlers/main.yml
+++ /dev/null
@@ -1,4 +0,0 @@
----
-- name: update apt cache
- apt:
- update_cache: yes
diff --git a/roles/apt-repo/aptly/tasks/main.yml b/roles/apt-repo/aptly/tasks/main.yml
index e11d610e..7a482549 100644
--- a/roles/apt-repo/aptly/tasks/main.yml
+++ b/roles/apt-repo/aptly/tasks/main.yml
@@ -3,14 +3,17 @@
copy:
src: repo.gpg
dest: /etc/apt/trusted.gpg.d/aptly.gpg
- notify: update apt cache
+ register: apt_repo_aptly_key
- name: add repository entry
copy:
content: |
deb http://repo.aptly.info/ squeeze main
dest: /etc/apt/sources.list.d/aptly.list
- notify: update apt cache
+ register: apt_repo_aptly_sources
- name: update apt cache
- meta: flush_handlers
+ when: apt_repo_aptly_key is changed or
+ apt_repo_aptly_sources is changed
+ apt:
+ update_cache: yes