Open markuszeiter opened 3 years ago
@markuszeiter Thanks for requesting this feature. Currently, the user can execute esxcli
as mentioned in https://medium.com/@AbhijeetKasurde/ansible-automating-esxcli-using-shell-module-6f691a551bca.
tl;dr
vmware_host_service_manager
[esxi1]
10.65.201.113 ansible_ssh_user=root
---
- hosts: esxi1
tasks:
- name: Add static routes
shell: "esxcli network ip route ipv4 add --gateway 192.168.0.1 --network 192.168.100.0/24"
register: r
I totally agree that this is a short term solution and we should have a dedicated module for handling host system network related things. PR welcomed.
@Akasurde thank you very much for your reply. I will try it definetly. I am new here, what do you mean with PR and how to do it?
@markuszeiter Welcome to the Ansible VMware community. PR means 'GitHub Pull Request'. You can create a new module as per requirement and submit a pull request here.
Please find the documentation for Ansible Development -
Let me know.
SUMMARY
Add feature to configure static routes on ESXi host according to VMware KB https://kb.vmware.com/s/article/2001426:
ISSUE TYPE
COMPONENT NAME
vmwarehost...
ADDITIONAL INFORMATION
This feature can then be used for example for NFS vmkernels where the network is based on L3.