Set static IP address

This commit is contained in:
Khue Doan 2021-06-13 14:23:51 +07:00
parent 65cf85da20
commit 86a6312e60

View File

@ -14,6 +14,20 @@ storage:
mode: 0644
contents:
inline: {{ hostvars[item]['inventory_hostname'] }}
- path: /etc/NetworkManager/system-connections/{{ network_interface }}.nmconnection
mode: 0600
contents:
inline: |
[connection]
id={{ network_interface }}
type=ethernet
interface-name={{ network_interface }}
permissions=
[ipv4]
address1={{ hostvars[item]['ansible_host'] }}/24,{{ ansible_default_ipv4.gateway }}
dns={{ dns_server }};
dns-search=
method=manual
# Set timezone
links:
- path: /etc/localtime