Skip to content

Commit

Permalink
Try with existing github action
Browse files Browse the repository at this point in the history
  • Loading branch information
enolfc committed Dec 2, 2021
1 parent ce73138 commit 7ac214f
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ jobs:
id: init
run: |
terraform init
- name: Adjust cloud-init file
run: |
sed -i -e "s/%TOKEN%/${{ secrets.GITHUB_TOKEN }}/" cloud-init.yaml
sed -i -e "s/%REF%/${{ github.sha }}/" cloud-init.yaml
- name: terraform plan
id: plan
if: github.event_name == 'pull_request'
Expand Down Expand Up @@ -98,7 +94,19 @@ jobs:
"https://nsupdate.fedcloud.eu/nic/update?myip=${{ steps.public_ip.outputs.stdout }}"
- name: Configure with ansible
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
env:
SSH_KEY: ${{ secrets.SSH_KEY }}
run: |
./configure.sh "$SSH_KEY" "${{ steps.public_ip.outputs.stdout }}"
uses: dawidd6/action-ansible-playbook@v2
with:
playbook: playbook.yaml
directory: ./
key: ${{secrets.SSH_KEY}}
inventory: |
all:
hosts:
${{ steps.public_ip.outputs.stdout }}:
ansible_user: egi
ansible_ssh_private_key_file: key
ansible_ssh_common_args: -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null
requirements: galaxy-requirements.yaml
# Optional, additional flags to pass to ansible-playbook
options: |
--verbose

0 comments on commit 7ac214f

Please sign in to comment.