... | ... |
@@ -2,7 +2,6 @@ |
2 | 2 |
|
3 | 3 |
- set_fact: |
4 | 4 |
test_ppa_name: 'ppa:menulibre-dev/devel' |
5 |
- test_ppa_filename: 'menulibre-dev' |
|
6 | 5 |
test_ppa_spec: 'deb http://ppa.launchpad.net/menulibre-dev/devel/ubuntu {{ansible_distribution_release}} main' |
7 | 6 |
test_ppa_key: 'A7AD98A1' # http://keyserver.ubuntu.com:11371/pks/lookup?search=0xD06AAF4C11DAB86DF421421EFE6B20ECA7AD98A1&op=index |
8 | 7 |
|
... | ... |
@@ -146,47 +145,6 @@ |
146 | 146 |
apt_key: id='{{test_ppa_key}}' state=absent |
147 | 147 |
|
148 | 148 |
# |
149 |
-# TEST: apt_repository: repo=<spec> filename=<filename> |
|
150 |
-# |
|
151 |
-- include: 'cleanup.yml' |
|
152 |
- |
|
153 |
-- name: 'record apt cache mtime' |
|
154 |
- stat: path='/var/cache/apt/pkgcache.bin' |
|
155 |
- register: cache_before |
|
156 |
- |
|
157 |
-- name: 'name=<spec> filename=<filename> (expect: pass)' |
|
158 |
- apt_repository: repo='{{test_ppa_spec}}' filename='{{test_ppa_filename}}' state=present |
|
159 |
- register: result |
|
160 |
- |
|
161 |
-- assert: |
|
162 |
- that: |
|
163 |
- - 'result.changed' |
|
164 |
- - 'result.state == "present"' |
|
165 |
- - 'result.repo == "{{test_ppa_spec}}"' |
|
166 |
- |
|
167 |
-- name: 'examine source file' |
|
168 |
- stat: path='/etc/apt/sources.list.d/{{test_ppa_filename}}.list' |
|
169 |
- register: source_file |
|
170 |
- |
|
171 |
-- name: 'assert source file exists' |
|
172 |
- assert: |
|
173 |
- that: |
|
174 |
- - 'source_file.stat.exists == True' |
|
175 |
- |
|
176 |
-- name: 'examine apt cache mtime' |
|
177 |
- stat: path='/var/cache/apt/pkgcache.bin' |
|
178 |
- register: cache_after |
|
179 |
- |
|
180 |
-- name: 'assert the apt cache did change' |
|
181 |
- assert: |
|
182 |
- that: |
|
183 |
- - 'cache_before.stat.mtime != cache_after.stat.mtime' |
|
184 |
- |
|
185 |
-# When installing a repo with the spec, the key is *NOT* added |
|
186 |
-- name: 'ensure ppa key is absent (expect: pass)' |
|
187 |
- apt_key: id='{{test_ppa_key}}' state=absent |
|
188 |
- |
|
189 |
-# |
|
190 | 149 |
# TEARDOWN |
191 | 150 |
# |
192 | 151 |
- include: 'cleanup.yml' |