Ansible but more better
This commit is contained in:
parent
29b2beca5a
commit
b7ce9d850d
13 changed files with 172 additions and 0 deletions
32
ansible_deploy/display/static_ip.yml
Normal file
32
ansible_deploy/display/static_ip.yml
Normal file
|
@ -0,0 +1,32 @@
|
|||
- name: Configure static IP address (using Network Manager)
|
||||
become: yes
|
||||
community.general.nmcli:
|
||||
conn_name: "Multimedia net"
|
||||
ifname: eth0
|
||||
type: ethernet
|
||||
ip4: "{{ static_ip }}/{{ static_ip_cidr }}"
|
||||
# Sorry timi
|
||||
method6: disabled
|
||||
# Multimedia net doesn't have Internet access, so this iface shouldn't be used for Internet access
|
||||
never_default4: true
|
||||
routes4_extended:
|
||||
- ip: 192.168.0.0/16
|
||||
next_hop: "{{ static_ip_gateway }}"
|
||||
metric: 9999
|
||||
- ip: 10.0.0.0/8
|
||||
next_hop: "{{ static_ip_gateway }}"
|
||||
metric: 9999
|
||||
# gw4: "{{ static_ip_gateway }}"
|
||||
state: present
|
||||
conn_reload: true
|
||||
|
||||
- name: Wait for network to be available
|
||||
become: yes
|
||||
wait_for_connection:
|
||||
timeout: 60
|
||||
|
||||
- name: Display new IP configuration
|
||||
debug:
|
||||
msg: "Static IP configured: {{ static_ip }}/{{ static_ip_cidr }}"
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue