-
Notifications
You must be signed in to change notification settings - Fork 38
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
Feature: Ability to set private static IP for private networks #172
Comments
Hi, we have a similar problem. Our goal is to create a VM that only has a static IP in a private network and no public IP.
You can find the detailed tasks in our role here. Possible solutions:
|
Hi, I also have a similar problem. I am using Ansible to create a server in the Hetzner cloud. My aim is to integrate the new |
Same for me. The only workaround for us currently is to create a server with public ip and manually add it to a network with a static IP, then disable the public ip again. |
This issue has been marked as stale because it has not had recent activity. The bot will close the issue if no further action occurs. |
Up |
While I understand implementing this in the server module might make your lives easier, what do you folks think about this: hetzner.hcloud/examples/server-with-private-ip-only.yml Lines 28 to 50 in c8e6a84
I am not sure If we want to continue packing new feature in the server module, which is already really big. |
Creating the server in stopped state works for my use case, thanks for the tip @jooola! The documentation could include this as an example; it's not easy to find out that this is possible. |
@jooola Your code is OK for one time run. But speaking about big production infra when a playbook is run several time it is not desirable to stop and start production servers each time |
@jooola is on vacation this week, but will be back on Monday. @varuzam maybe the [ tasks:
- name: Check if private IP needs to be changed
hetzner.hcloud.server_network:
network: my-network
server: "{{ name }}"
ip: "{{ private_ip }}"
state: present
check_mode: true
register: ip_changes
- name: Update private IP
when: ip_changes is changed # Or `ip_changes.changed == true`
block:
- name: Shutdown Server
# ...
- name: Update IP
# ...
- name: Start Server
# ...
|
Could you explain what your use case is ? If your server is already running, it should already have some IP assigned. Then adding or updating a private IP should be done using the EDIT: I just checked, and we cannot update a private IP, as we cannot assign multiple IP on the same network, and therefor have to shut down the server before removing and adding a new IP. We might be able to implement this by shutting down the server in the |
SUMMARY
A while ago support for private network was added ad8958a
But there is no way to set static private ip. It would be nice to have this ability.
ISSUE TYPE
COMPONENT NAME
hetzner.hcloud.server module
ADDITIONAL INFORMATION
The text was updated successfully, but these errors were encountered: