Add payara_user_group variable #191
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
workflow_dispatch: | |
pull_request: | |
push: | |
branches: | |
- master | |
jobs: | |
run_all_roles: | |
name: Run all ICAT Ansible roles | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
java_version: [11, 17] | |
steps: | |
- name: Checkout ICAT Ansible | |
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 | |
- name: Run apt update | |
run: sudo apt-get update | |
- name: Install requirements | |
run: pip install -r requirements.txt | |
# Prep for running the playbook | |
- name: Create hosts file | |
run: echo -e "[hosts_all]\nlocalhost ansible_connection=local" > hosts | |
- name: Prepare vault pass | |
run: echo -e "icattravispw" > vault_pass.txt | |
- name: Move vault to directory it'll get detected by Ansible | |
run: mv vault.yml group_vars/all | |
- name: Replace default payara user with Actions user | |
run: | | |
sed -i -e "s/^payara_user: \"glassfish\"/payara_user: \"runner\"/" group_vars/all/vars.yml | |
# Force hostname to localhost - bug fix for previous ICAT Ansible issues on Actions | |
- name: Change hostname to localhost | |
run: sudo hostname -b localhost | |
- name: Remove existing mysql | |
run: | | |
sudo apparmor_parser -R /etc/apparmor.d/usr.sbin.mysqld | |
sudo apt-get remove --purge "mysql*" | |
sudo rm -rf /var/lib/mysql* /etc/mysql | |
- name: Run ICAT Ansible Playbook | |
run: | | |
ansible-playbook hosts_all.yml -i hosts --vault-password-file vault_pass.txt -e java_version=${{ matrix.java_version }} -vv | |