mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 13:20:23 -07:00
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
This commit is contained in:
parent
3a5a0fed06
commit
296ad80002
6 changed files with 110 additions and 0 deletions
|
@ -0,0 +1,10 @@
|
|||
Section: misc
|
||||
Priority: optional
|
||||
Standards-Version: 2.3.3
|
||||
|
||||
Package: foo
|
||||
Version: 1.0.0
|
||||
Section: system
|
||||
Maintainer: John Doe <john@doe.com>
|
||||
Architecture: all
|
||||
Description: Dummy package
|
|
@ -0,0 +1,10 @@
|
|||
Section: misc
|
||||
Priority: optional
|
||||
Standards-Version: 2.3.3
|
||||
|
||||
Package: foo
|
||||
Version: 1.0.1
|
||||
Section: system
|
||||
Maintainer: John Doe <john@doe.com>
|
||||
Architecture: all
|
||||
Description: Dummy package
|
36
test/integration/targets/setup_deb_repo/tasks/main.yml
Normal file
36
test/integration/targets/setup_deb_repo/tasks/main.yml
Normal file
|
@ -0,0 +1,36 @@
|
|||
- 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']
|
Loading…
Add table
Add a link
Reference in a new issue