Skip to content

Commit

Permalink
adds tool installation into github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
martindemko committed Dec 16, 2024
1 parent c3cbeef commit e71957d
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
22 changes: 22 additions & 0 deletions .github/actions/install-tools-playbook/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#! vim: ts=2 expandtab:

name: install-tools

runs:
using: 'composite'
steps:
- name: Make SSH connection
shell: bash
run: |
mkdir -p $HOME/.ssh
install -m 600 -D /dev/null $HOME/.ssh/id_rsa
echo "$SSH_PRIVATE_KEY" > $HOME/.ssh/id_rsa
ssh -f -o StrictHostKeyChecking=no $TARGET_USER@$TARGET_HOSTNAME hostname
- name: Create vault password
shell: bash
run: echo "$VAULT_PASSWORD" >.vault-password.txt

- name: Run galaxy_tools.yaml playbook
shell: bash
run: ansible-playbook -vvv --limit $TARGET_HOSTNAME galaxy_tools.yml
6 changes: 5 additions & 1 deletion .github/actions/run-ansible-playbook/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ runs:
shell: bash
run: echo "$VAULT_PASSWORD" >.vault-password.txt

- name: Run playbook
- name: Run galaxy.yaml playbook
shell: bash
run: ansible-playbook -vvv --limit $TARGET_HOSTNAME galaxy.yml

- name: Run galaxy_tools.yaml playbook
shell: bash
run: ansible-playbook -vvv --limit $TARGET_HOSTNAME galaxy_tools.yml
21 changes: 21 additions & 0 deletions .github/workflows/install-tools-qa1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#! vim: ts=2 expandtab:

name: install-tools-qa1

# TODO: run automatically on push to main
on: [ workflow_dispatch ]

jobs:
call-common:
runs-on: ubuntu-latest
steps:
- name: Checkout actions
uses: actions/checkout@v2

- name: Call install-tools-playbook action
uses: ./.github/actions/install-tools-playbook
env:
TARGET_HOSTNAME: galaxy-qa1.galaxy.cloud.e-infra.cz
TARGET_USER: debian
VAULT_PASSWORD: ${{ secrets.VAULT_PASSWORD_QA1 }}
SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY_QA1 }}

0 comments on commit e71957d

Please sign in to comment.