{"id":16777305,"url":"https://github.com/githubixx/ansible-role-hetzner-floating-ip","last_synced_at":"2025-07-13T20:34:04.450Z","repository":{"id":74013056,"uuid":"151973647","full_name":"githubixx/ansible-role-hetzner-floating-ip","owner":"githubixx","description":"This Ansible role adds a floating IP (v4 and/or v6) to a Hetzner Cloud host. Additionally you can change the source IP to the floating IP (which may be important for mailserver).","archived":false,"fork":false,"pushed_at":"2024-01-22T18:34:10.000Z","size":24,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T20:53:22.941Z","etag":null,"topics":["ansible","cloud","floating-ip","hetzner","hetzner-cloud","interface","linux","network","ubuntu"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/githubixx.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-07T18:43:37.000Z","updated_at":"2024-02-02T06:03:16.000Z","dependencies_parsed_at":"2024-01-22T19:43:56.704Z","dependency_job_id":"4e41c08c-97dc-4f9b-8b07-13a3ccdb5817","html_url":"https://github.com/githubixx/ansible-role-hetzner-floating-ip","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/githubixx/ansible-role-hetzner-floating-ip","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/githubixx%2Fansible-role-hetzner-floating-ip","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/githubixx%2Fansible-role-hetzner-floating-ip/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/githubixx%2Fansible-role-hetzner-floating-ip/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/githubixx%2Fansible-role-hetzner-floating-ip/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/githubixx","download_url":"https://codeload.github.com/githubixx/ansible-role-hetzner-floating-ip/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/githubixx%2Fansible-role-hetzner-floating-ip/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265199765,"owners_count":23726712,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","cloud","floating-ip","hetzner","hetzner-cloud","interface","linux","network","ubuntu"],"created_at":"2024-10-13T07:24:20.317Z","updated_at":"2025-07-13T20:34:04.425Z","avatar_url":"https://github.com/githubixx.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ansible-role-hetzner-floating-ip\n\nThis Ansible role adds a floating IP (v4 and/or v6) to a [Hetzner Cloud](https://www.hetzner.cloud) host. Additionally you can change the source IP to the floating IP.\n\n## Versions\n\nI tag every release and try to stay with [semantic versioning](http://semver.org). If you want to use the role I recommend to checkout the latest tag. The master branch is basically development while the tags mark stable releases. But in general I try to keep master in good shape too.\n\n## Requirements\n\nA [Hetzner Cloud VM](https://www.hetzner.cloud) and a [floating IP](https://docs.hetzner.com/cloud/floating-ips/persistent-configuration/)\n\n## Changelog\n\nsee [CHANGELOG.md](https://github.com/githubixx/ansible-role-hetzner-floating-ip/blob/master/CHANGELOG.md)\n\n## Installation\n\n- Directly download from Github (Change into Ansible roles directory before cloning. You can figure out the role path by using `ansible-config dump | grep DEFAULT_ROLES_PATH` command):\n`git clone https://github.com/githubixx/ansible-role-hetzner-floating-ip.git githubixx.hetzner_floating_ip`\n\n- Via `ansible-galaxy` command and download directly from Ansible Galaxy:\n`ansible-galaxy install role githubixx.hetzner_floating_ip`\n\n- Create a `requirements.yml` file with the following content (this will download the role from Github) and install with\n`ansible-galaxy role install -r requirements.yml` (change `version` if needed):\n\n```yaml\n---\nroles:\n  - name: githubixx.hetzner_floating_ip\n    src: https://github.com/githubixx/ansible-role-hetzner-floating-ip.git\n    version: 4.0.0\n```\n\n## Role Variables\n\nThese variables can be defined in `group_vars` or `host_vars`:\n\n```yaml\n# Filename that contains the floating v4 IP configuration in\n# \"/etc/network/interfaces.d/\". \".cfg\" suffix will be appended\n# automatically.\nhetzner_floating_ipv4_filename: \"99-floating-ipv4\"\n\n# Filename that contains the floating v6 IP configuration in\n# \"/etc/network/interfaces.d/\". \".cfg\" suffix will be appended\n# automatically.\nhetzner_floating_ipv6_filename: \"99-floating-ipv6\"\n```\n\nJust adding the variables above isn't enough. If you just define this variables nothing will be deployed. Additionally you need to set a few variables per host in `host_vars`. E.g. to add a IPv4 floating IP and use this floating IP as source IP you can add this variable and settings:\n\n```yaml\nhetzner_floating_ipv4_options:\n  - { option: \"method\",  value: \"static\" }\n  - { option: \"address\", value: \"12.23.34.45\" }\n  - { option: \"netmask\", value: \"32\" }\n  - { option: \"post-up\", value: \"ip route del default; ip route add default dev eth0 via 172.31.1.1 src 12.23.34.45\" }\n```\n\nUsing the examples above a file called `/etc/netplan/99-floating-ipv4.yaml` will be created with this content:\n\n```yaml\nnetwork:\n  version: 2\n  ethernets:\n    eth0:\n      addresses:\n      - 12.23.34.45/32\n```\n\n`{ option: \"method\",  value: \"static\" }` has no effect in this case. And the **post-up** hook will be located in `/etc/network/if-post-up.d/99-floating-ipv4`:\n\n```yaml\n#!/bin/sh\n\nip route del default; ip route add default dev eth0 via 172.31.1.1 src 12.23.34.45\n```\n\nHere is a example for a IPv6 interface:\n\n```yaml\nhetzner_floating_ipv6_options:\n  - { option: \"method\",  value: \"static\" }\n  - { option: \"address\", value: \"2a01:4f8:1111:1111::1\" }\n  - { option: \"netmask\", value: \"64\" }\n```\n\nThe resulting files will be located at `/etc/netplan/99-floating-ipv6.yaml` and `/etc/network/if-post-up.d/99-floating-ipv6`.\n\n## Example Playbook\n\n```yaml\n- hosts: floating-ip-hosts\n  roles:\n    - githubixx.hetzner_floating_ip\n```\n\n## License\n\nGNU GENERAL PUBLIC LICENSE Version 3\n\n## Author Information\n\n[http://www.tauceti.blog](http://www.tauceti.blog)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithubixx%2Fansible-role-hetzner-floating-ip","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgithubixx%2Fansible-role-hetzner-floating-ip","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgithubixx%2Fansible-role-hetzner-floating-ip/lists"}