--- /dev/null
+---
+# tasks file for ci_run
+- name: Ensure python is installed
+ ansible.builtin.raw: zypper --non-interactive in python3
+
+- name: Ensure dependencies are installed
+ community.general.zypper:
+ name:
+ - autoconf
+ - automake
+ - byacc
+ - diffutils
+ - gawk
+ - gcc
+ - gettext-tools
+ - intltool
+ - libcmocka-devel
+ - libtool
+ - libxslt-tools
+ - make
+ - systemd-devel
+ state: present
+
+# Needed to use `zypper si`
+- name: Enable all repos
+ ansible.builtin.command:
+ zypper --non-interactive mr -ea
+
+- name: Ensure build dependencies are installed
+ ansible.builtin.command:
+ zypper --non-interactive si -d shadow
+ register: zypper_result
+ changed_when: '"Nothing to do" not in zypper_result.stdout'
+
+- name: Build configuration
+ ansible.builtin.command: >
+ ./autogen.sh
+ --enable-account-tools-setuid
+ --enable-shadowgrp
+ --with-acl
+ --with-attr
+ --with-audit
+ --with-group-name-max-length=32
+ --with-libpam
+ --with-nscd
+ --with-selinux
+ --with-sha-crypt
+ --without-libbsd
+ --without-libcrack
+ --without-sssd
+ args:
+ chdir: /usr/local/src/shadow/
+ ignore_errors: true
+
+- name: Build
+ ansible.builtin.shell:
+ make -Orecurse -j4 > build.log
+ args:
+ chdir: /usr/local/src/shadow/
+ ignore_errors: true
+
+- name: Run unit-tests
+ ansible.builtin.command:
+ make check
+ args:
+ chdir: /usr/local/src/shadow/
+ ignore_errors: true
+
+- name: Install
+ ansible.builtin.command:
+ make install
+ args:
+ chdir: /usr/local/src/shadow/
+ ignore_errors: true
+
+- name: Copy logs
+ ansible.builtin.fetch:
+ src: '{{ item }}'
+ dest: ./build-out/
+ flat: yes
+ with_items:
+ - "/usr/local/src/shadow/config.log"
+ - "/usr/local/src/shadow/config.h"
+ - "/usr/local/src/shadow/build.log"
+ - "/usr/local/src/shadow/tests/unit/test-suite.log"
+
+- name: Copy configuration file for testing
+ ansible.builtin.copy:
+ src: /usr/local/src/shadow/tests/system/etc/login.defs
+ dest: /etc/login.defs
+ remote_src: yes