Created
June 18, 2023 04:05
-
-
Save shirou/095077c72767e246da5056f6753598f1 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#cloud-config | |
repo_update: true | |
repo_upgrade: all | |
packages: | |
- socat | |
write_files: | |
- content: | | |
[Unit] | |
Description=Socat Port forward | |
Wants=network-online.target | |
After=network-online.target | |
[Service] | |
Type=simple | |
ExecStart=/usr/bin/socat -d tcp4-listen:5432,reuseaddr,fork TCP:foo.example.com:5432 | |
Restart=always | |
[Install] | |
WantedBy=multi-user.target | |
path: /etc/systemd/system/portforward.service | |
owner: root:root | |
runcmd: | |
- sudo systemctl start portforward | |
- sudo systemctl enable portforward |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment