Debian Codegraph @

test/integration/targets/apt/tasks/url-with-deps.yml

raw
1 - block:
2 - name: Install https transport for apt
3 apt:
4 name: apt-transport-https
5
6 - name: Ensure echo-hello is not installed
7 apt:
8 name: echo-hello
9 state: absent
10 purge: yes
11
12 # Note that this .deb is just a stupidly tiny one that has a dependency
13 # on vim-tiny. Really any .deb will work here so long as it has
14 # dependencies that exist in a repo and get brought in.
15 # The source and files for building this .deb can be found here:
16 # https://ci-files.testing.ansible.com/test/integration/targets/apt/echo-hello-source.tar.gz
17 - name: Install deb file with dependencies from URL (check_mode)
18 apt:
19 deb: https://ci-files.testing.ansible.com/test/integration/targets/apt/echo-hello_1.0_all.deb
20 check_mode: true
21 register: apt_url_deps_check_mode
22
23 - name: check to make sure we didn't install the package due to check_mode
24 shell: dpkg-query -l echo-hello
25 failed_when: false
26 register: dpkg_result_check_mode
27
28 - name: verify check_mode installation of echo-hello
29 assert:
30 that:
31 - apt_url_deps_check_mode is changed
32 - dpkg_result_check_mode.rc != 0
33
34 - name: Install deb file with dependencies from URL (for real this time)
35 apt:
36 deb: https://ci-files.testing.ansible.com/test/integration/targets/apt/echo-hello_1.0_all.deb
37 register: apt_url_deps
38
39 - name: check to make sure we installed the package
40 shell: dpkg-query -l echo-hello
41 failed_when: False
42 register: dpkg_result
43
44 - name: verify real installation of echo-hello
45 assert:
46 that:
47 - apt_url_deps is changed
48 - dpkg_result is successful
49 - dpkg_result.rc == 0
50
51 - name: Install package from local repo
52 apt:
53 deb: "{{ repodir }}/dists/stable/main/binary-all/baz_1.0.0_all.deb"
54 install_recommends: yes
55 register: apt_url_deps
56
57 - name: check to make sure we installed the package
58 shell: dpkg-query -l baz
59 failed_when: False
60 register: baz_dpkg_result
61
62 - name: check to make sure we installed the package's recommends (rolldice)
63 shell: dpkg-query -l rolldice
64 failed_when: False
65 register: rolldice_dpkg_result
66
67 - name: check to make sure we installed the package's recommends (uidmap)
68 shell: dpkg-query -l uidmap
69 failed_when: False
70 register: uidmap_dpkg_result
71
72 - name: verify real installation of bar
73 assert:
74 that:
75 - apt_url_deps is changed
76 - baz_dpkg_result is successful
77 - baz_dpkg_result.rc == 0
78 - rolldice_dpkg_result is successful
79 - rolldice_dpkg_result.rc == 0
80 - uidmap_dpkg_result is successful
81 - uidmap_dpkg_result.rc == 0
82
83 always:
84 - name: uninstall packages with apt
85 apt:
86 pkg:
87 - echo-hello
88 - rolldice
89 - baz
90 - uidmap
91 state: absent
92 purge: yes