aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2021-10-11 15:51:19 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2021-10-11 15:51:19 +0300
commit8b826418ac6aff07b294a29d126c8799d991cf9d (patch)
tree205cbdec519205b39bb8d23b159b9ce3db28cda9
parentinventory: -o ForwardAgent=yes (diff)
downloadmaintenance-8b826418ac6aff07b294a29d126c8799d991cf9d.tar.gz
maintenance-8b826418ac6aff07b294a29d126c8799d991cf9d.zip
workflows/run: use action to set up ssh-agent
Diffstat (limited to '')
-rw-r--r--.github/workflows/run.yml11
-rw-r--r--Makefile4
2 files changed, 4 insertions, 11 deletions
diff --git a/.github/workflows/run.yml b/.github/workflows/run.yml
index d1a5348..55ba662 100644
--- a/.github/workflows/run.yml
+++ b/.github/workflows/run.yml
@@ -24,12 +24,9 @@ jobs:
allowed_ips: '${{ secrets.ALLOWED_IPS }}'
private_key: '${{ secrets.WG_PRIVATE_KEY }}'
preshared_key: '${{ secrets.WG_PRESHARED_KEY }}'
- - name: Set SSH key
- run: |
- touch .ansible-key
- chmod 0600 .ansible-key
- cat <<'EOF' > .ansible-key
- ${{ secrets.SSH_KEY }}
- EOF
+ - name: webfactory/ssh-agent
+ uses: webfactory/ssh-agent@v0.5.3
+ with:
+ ssh-private-key: '${{ secrets.SSH_KEY }}'
- name: Run Ansible play
run: make run limit='${{ github.event.inputs.hosts }}'
diff --git a/Makefile b/Makefile
index c1e8d9c..f1d073f 100644
--- a/Makefile
+++ b/Makefile
@@ -27,8 +27,4 @@ all: run
.PHONY: run
run:
-ifdef CI
- ansible-playbook --inventory inventory.ini --limit '$(call escape,$(limit))' --private-key .ansible-key maintenance.yml
-else
ansible-playbook --inventory inventory.ini --limit '$(call escape,$(limit))' maintenance.yml
-endif