ansible/test/integration/targets/setup_deb_repo/tasks/main.yml
Martin Krizek 296ad80002
apt: allow for integration tests using fake repo (#37639)
* apt: allow for integration tests using fake repo

* Add integration test for 19102

* Clean up packages and repo

* Fix indentation
2018-03-22 19:14:40 +01:00

36 lines
805 B
YAML

- block:
- name: Install needed packages
apt:
name: "{{ item }}"
with_items:
- dpkg-dev
- equivs
- libfile-fcntllock-perl # to silence warning by equivs-build
- set_fact:
repodir: /tmp/repo/
- name: Create repo dir
file:
path: "{{ repodir }}"
state: directory
mode: 0755
- name: Create deb files
shell: "equivs-build {{ item }}"
args:
chdir: "{{ repodir }}"
with_fileglob:
- "files/package_specs/*"
- name: Create repo
shell: dpkg-scanpackages --multiversion . /dev/null | gzip -9c > Packages.gz
args:
chdir: "{{ repodir }}"
- name: Install the repo
apt_repository:
repo: "deb file:{{ repodir }} ./"
validate_certs: no
when: ansible_distribution in ['Ubuntu', 'Debian']