Path: blob/devel/test/integration/targets/apt/tasks/url-with-deps.yml
4751 views
- block:1- name: Install https transport for apt2apt:3name: apt-transport-https45- name: Ensure echo-hello is not installed6apt:7name: echo-hello8state: absent9purge: yes1011# Note that this .deb is just a stupidly tiny one that has a dependency12# on vim-tiny. Really any .deb will work here so long as it has13# dependencies that exist in a repo and get brought in.14# The source and files for building this .deb can be found here:15# https://ansible-ci-files.s3.amazonaws.com/test/integration/targets/apt/echo-hello-source.tar.gz16- name: Install deb file with dependencies from URL (check_mode)17apt:18deb: https://ansible-ci-files.s3.amazonaws.com/test/integration/targets/apt/echo-hello_1.0_all.deb19check_mode: true20register: apt_url_deps_check_mode2122- name: check to make sure we didn't install the package due to check_mode23shell: dpkg-query -l echo-hello24failed_when: false25register: dpkg_result_check_mode2627- name: verify check_mode installation of echo-hello28assert:29that:30- apt_url_deps_check_mode is changed31- dpkg_result_check_mode.rc != 03233- name: Install deb file with dependencies from URL (for real this time)34apt:35deb: https://ansible-ci-files.s3.amazonaws.com/test/integration/targets/apt/echo-hello_1.0_all.deb36register: apt_url_deps3738- name: check to make sure we installed the package39shell: dpkg-query -l echo-hello40failed_when: False41register: dpkg_result4243- name: verify real installation of echo-hello44assert:45that:46- apt_url_deps is changed47- dpkg_result is successful48- dpkg_result.rc == 04950always:51- name: uninstall echo-hello with apt52apt:53pkg: echo-hello54state: absent55purge: yes565758