ff
This commit is contained in:
@@ -79,16 +79,43 @@
|
||||
set_fact:
|
||||
nmcli_failed: "{{ nmcli_result.rc != 0 }}"
|
||||
|
||||
- name: Run nmcli to check if Ethernet connection has already been added
|
||||
shell: /usr/bin/nmcli c | grep 'Ethernet'
|
||||
register: nmcli_result_eth
|
||||
ignore_errors: True
|
||||
|
||||
- name: Check result nmcli eth
|
||||
set_fact:
|
||||
nmcli_eth_failed: "{{ nmcli_result_eth.rc != 0 }}"
|
||||
|
||||
- name: Run nmcli to check if Ethernet connection has already been added
|
||||
shell: /usr/bin/nmcli c | grep 'LTE'
|
||||
register: nmcli_result_lte
|
||||
ignore_errors: True
|
||||
|
||||
- name: Check result nmcli lte
|
||||
set_fact:
|
||||
nmcli_lte_failed: "{{ nmcli_result_lte.rc != 0 }}"
|
||||
|
||||
- name: Run nmcli to check if bridge connection has already been added
|
||||
shell: /usr/bin/nmcli c | grep 'bridge'
|
||||
register: nmcli_result_bridge
|
||||
ignore_errors: True
|
||||
|
||||
- name: Check result nmcli lte
|
||||
set_fact:
|
||||
nmcli_bridge_failed: "{{ nmcli_result_bridge.rc != 0 }}"
|
||||
|
||||
|
||||
- name: Run nmcli to add a connection LTE
|
||||
command: /usr/bin/nmcli c add autoconnect yes save yes con-name {{ LTE_con_name }} ifname cdc-wdm0 type gsm apn "internet"
|
||||
tags: br
|
||||
when: nmcli_lte_failed
|
||||
|
||||
- name: Configure bridge
|
||||
command: /usr/bin/nmcli c add type bridge ifname br0 autoconnect yes save yes con-name bridge stp no ipv6.method disabled ipv4.method manual ipv4.addr 10.1.10.1/24
|
||||
tags: br
|
||||
|
||||
when: nmcli_bridge_failed
|
||||
# - name: Configure bridge1
|
||||
# command: /usr/bin/nmcli c add type ethernet slave-type bridge con-name 'Ethernet' ifname {{ int_name }} master br0
|
||||
# loop:
|
||||
@@ -102,26 +129,35 @@
|
||||
- enp90s0
|
||||
loop_control:
|
||||
loop_var: int_name
|
||||
when: nmcli_eth_failed
|
||||
|
||||
# - name: set ip for bridge
|
||||
# command: /usr/bin/nmcli c mod bridge ipv4.addr {{ wifi_int_ip }}/24 ipv4.method manual
|
||||
# tags: br
|
||||
|
||||
- name: Run nmcli to add a connection with the specified parameters as a wifi access point if above check has failed
|
||||
command: /usr/bin/nmcli c add ipv4.method shared autoconnect yes save yes con-name {{ wifi_ssid }} ifname {{ wifi_int.stdout }} type wifi slave-type bridge master br0 wifi.ssid {{ wifi_ssid }} wifi.mode ap wifi-sec.proto rsn wifi-sec.pairwise ccmp wifi-sec.psk {{ wifi_psk }} wifi-sec.key-mgmt wpa-psk
|
||||
command: /usr/bin/nmcli c add autoconnect yes save yes con-name {{ wifi_ssid }} ifname {{ wifi_int.stdout }} type wifi slave-type bridge master br0
|
||||
when: nmcli_failed
|
||||
|
||||
- name: Run nmcli to add WPA-PSK security to the wifi connection
|
||||
command: /usr/bin/nmcli c mod {{ wifi_ssid }} \
|
||||
802-11-wireless.band bg
|
||||
|
||||
802-11-wireless.band bg \
|
||||
wifi.ssid {{ wifi_ssid }} \
|
||||
wifi.mode ap \
|
||||
wifi-sec.proto rsn \
|
||||
wifi-sec.pairwise ccmp \
|
||||
wifi-sec.psk {{ wifi_psk }} \
|
||||
wifi-sec.key-mgmt wpa-psk \
|
||||
ipv4.method shared
|
||||
# - name: Run nmcli to add WPA-PSK security to the wifi connection
|
||||
# command: /usr/bin/nmcli c mod {{ wifi_ssid }} \
|
||||
# 802-11-wireless.band bg \
|
||||
# 802-11-wireless.channel 1 \
|
||||
# 802-11-wireless-security.key-mgmt wpa-psk \
|
||||
# 802-11-wireless-security.proto rsn \
|
||||
# 802-11-wireless-security.group ccmp \
|
||||
# 802-11-wireless-security.pairwise ccmp \
|
||||
# 802-11-wireless-security.psk {{ wifi_psk }} \
|
||||
|
||||
- name: set ip for bridge
|
||||
command: /usr/bin/nmcli c up bridge
|
||||
tags: br
|
||||
|
||||
Reference in New Issue
Block a user