Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use .ssh/config to setup SSH proxy jump #64

Merged
merged 1 commit into from
Jan 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion .github/workflows/cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,20 @@ jobs:
# Ensure that servers we're deploying to are known. Otherwise,
# Ansible may fail with host key verification error.
mkdir -p ~/.ssh && echo "${{ secrets.SSH_KNOWN_HOSTS }}" >> ~/.ssh/known_hosts
cat <<EOF > ~/.ssh/config
Host _jumphost
User bunny
HostName hoth.kalnytskyi.com
IdentityFile ${{ steps.ssh-key.outputs.uri }}

Host xsnippet.org
HostName 2a02:8084:4:e480:244a:d5a5:ac59:617d
ProxyJump _jumphost
IdentityFile ${{ steps.ssh-key.outputs.uri }}
EOF

ansible-playbook \
-vv \
-e ansible_ssh_private_key_file="${{ steps.ssh-key.outputs.uri }}" \
-e goaccess_basicauth_password="${{ secrets.GOACCESS_PASSWORD }}" \
--inventory inventories/production \
site.yml
3 changes: 1 addition & 2 deletions inventories/production/hosts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[xsnippet]
2a02:8084:4:e480:244a:d5a5:ac59:617d
xsnippet.org

[xsnippet:vars]
ansible_user = provisioner
ansible_ssh_common_args = -J [email protected]
Loading