summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/setup_deb_repo
diff options
context:
space:
mode:
authorJordan Borean <jborean93@gmail.com>2019-01-15 00:02:32 +0100
committerGitHub <noreply@github.com>2019-01-15 00:02:32 +0100
commit2fcc3593ccf7c865723c46ce8b3b7964b7ab7022 (patch)
tree73b919d08d027ba38a70f9004fd4fe31b993f453 /test/integration/targets/setup_deb_repo
parentUpdated test constraints for mock assert_called() and assert_called_once() (diff)
downloadansible-2fcc3593ccf7c865723c46ce8b3b7964b7ab7022.tar.xz
ansible-2fcc3593ccf7c865723c46ce8b3b7964b7ab7022.zip
ansible-test setup_dep_repo trust package repo (#50795)
Diffstat (limited to 'test/integration/targets/setup_deb_repo')
-rw-r--r--test/integration/targets/setup_deb_repo/tasks/main.yml19
1 files changed, 16 insertions, 3 deletions
diff --git a/test/integration/targets/setup_deb_repo/tasks/main.yml b/test/integration/targets/setup_deb_repo/tasks/main.yml
index 84c0f909a3..9660416cba 100644
--- a/test/integration/targets/setup_deb_repo/tasks/main.yml
+++ b/test/integration/targets/setup_deb_repo/tasks/main.yml
@@ -28,9 +28,22 @@
args:
chdir: "{{ repodir }}"
+ # Can't use apt_repository as it doesn't expose a trusted=yes option
- name: Install the repo
- apt_repository:
- repo: "deb file:{{ repodir }} ./"
- validate_certs: no
+ copy:
+ content: deb [trusted=yes] file:{{ repodir }} ./
+ dest: /etc/apt/sources.list.d/file_tmp_repo.list
+
+ # Need to uncomment the deb-src for the universe component for build-dep state
+ - name: Ensure deb-src for the universe component
+ lineinfile:
+ path: /etc/apt/sources.list
+ backrefs: True
+ regexp: ^#\s*deb-src http://archive\.ubuntu\.com/ubuntu/ (\w*){{ item }} universe$
+ line: deb-src http://archive.ubuntu.com/ubuntu \1{{ item }} universe
+ state: present
+ with_items:
+ - ''
+ - -updates
when: ansible_distribution in ['Ubuntu', 'Debian']