summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/setup_deb_repo/tasks/main.yml
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:04:21 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 16:04:21 +0000
commit8a754e0858d922e955e71b253c139e071ecec432 (patch)
tree527d16e74bfd1840c85efd675fdecad056c54107 /test/integration/targets/setup_deb_repo/tasks/main.yml
parentInitial commit. (diff)
downloadansible-core-8a754e0858d922e955e71b253c139e071ecec432.tar.xz
ansible-core-8a754e0858d922e955e71b253c139e071ecec432.zip
Adding upstream version 2.14.3.upstream/2.14.3upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'test/integration/targets/setup_deb_repo/tasks/main.yml')
-rw-r--r--test/integration/targets/setup_deb_repo/tasks/main.yml75
1 files changed, 75 insertions, 0 deletions
diff --git a/test/integration/targets/setup_deb_repo/tasks/main.yml b/test/integration/targets/setup_deb_repo/tasks/main.yml
new file mode 100644
index 0000000..471fb2a
--- /dev/null
+++ b/test/integration/targets/setup_deb_repo/tasks/main.yml
@@ -0,0 +1,75 @@
+- 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 dirs
+ file:
+ path: "{{ repodir }}/dists/{{ item }}/main/binary-all"
+ state: directory
+ mode: 0755
+ loop:
+ - stable
+ - testing
+
+ - name: Copy package specs to remote
+ copy:
+ src: package_specs
+ dest: "{{ remote_tmp_dir }}"
+
+ - name: Create deb files
+ shell: "find {{ remote_tmp_dir }}/package_specs/{{ item }} -type f -exec equivs-build {} \\;"
+ args:
+ chdir: "{{ repodir }}/dists/{{ item }}/main/binary-all"
+ loop:
+ - stable
+ - testing
+
+ - name: Create repo Packages
+ shell: dpkg-scanpackages --multiversion . /dev/null dists/{{ item }}/main/binary-all/ | gzip -9c > Packages.gz
+ args:
+ chdir: "{{ repodir }}/dists/{{ item }}/main/binary-all"
+ loop:
+ - stable
+ - testing
+
+ - name: Create repo Release
+ copy:
+ content: |
+ Codename: {{ item.0 }}
+ {% for k,v in item.1.items() %}
+ {{ k }}: {{ v }}
+ {% endfor %}
+ dest: "{{ repodir }}/dists/{{ item.0 }}/Release"
+ loop:
+ - [stable, {}]
+ - [testing, {NotAutomatic: "yes", ButAutomaticUpgrades: "yes"}]
+
+ - name: Install the repo
+ apt_repository:
+ repo: deb [trusted=yes arch=all] file:{{ repodir }} {{ item }} main
+ update_cache: false # interferes with task 'Test update_cache 1'
+ loop:
+ - stable
+ - testing
+
+ # 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']