@@ -114,21 +114,51 @@ address=/$hostName.crc.testing/192.168.126.11
114
114
EOF
115
115
116
116
stop_if_failed $? " failed to write Dnsmasq configuration in $DNSMASQ_CONF "
117
- pr_info " adding Dnsmasq as primary DNS"
117
+ # pr_info "adding Dnsmasq as primary DNS"
118
118
sleep 2
119
- nmcli connection modify Wired\ connection\ 1 ipv4.dns " $IIP ,169.254.169.254"
119
+ # nmcli connection modify Wired\ connection\ 1 ipv4.dns "$IIP,169.254.169.254"
120
120
stop_if_failed $? " failed to modify NetworkManager settings"
121
- pr_info " restarting NetworkManager"
122
- sleep 2
123
- systemctl restart NetworkManager
124
- stop_if_failed $? " failed to restart NetworkManager"
125
- pr_info " enabling & starting Dnsmasq service"
121
+ # pr_info "restarting NetworkManager"
122
+ # sleep 2
123
+ # systemctl restart NetworkManager
124
+ # stop_if_failed $? "failed to restart NetworkManager"
125
+ # pr_info "enabling & starting Dnsmasq service"
126
126
systemctl enable dnsmasq.service
127
127
systemctl start dnsmasq.service
128
128
sleep 2
129
129
stop_if_failed $? " failed to start Dnsmasq service"
130
130
}
131
131
132
+ update_ovs_nm_config () {
133
+ cat << EOF > /etc/systemd/system/crc-cloud-ovs-nm.service
134
+ [Unit]
135
+ Description=CRC Cloud Unit for configuring nm ovs connection
136
+ Requires=ovs-configuration.service
137
+ After=ovs-configuration.service
138
+
139
+ [Service]
140
+ Type=oneshot
141
+ ExecStart=nmcli con modify --temporary ovs-if-br-ex ipv4.dns "$IIP ,169.254.169.254"
142
+ StandardOutput=journal
143
+
144
+ [Install]
145
+ RequiredBy=kubelet-dependencies.target
146
+ EOF
147
+
148
+ stop_if_failed $? " failed to write systemd unit file for network manager ovs connection update"
149
+ pr_info " adding Dnsmasq as primary DNS"
150
+ sleep 2
151
+
152
+ systemctl enable crc-cloud-ovs-nm.service
153
+ systemctl start crc-cloud-ovs-nm.service
154
+ stop_if_failed $? " failed to modify NetworkManager settings"
155
+
156
+ pr_info " restarting NetworkManager"
157
+ sleep 2
158
+ systemctl restart NetworkManager
159
+ stop_if_failed $? " failed to restart NetworkManager"
160
+ }
161
+
132
162
enable_and_start_kubelet () {
133
163
pr_info " enabling & starting Kubelet service"
134
164
systemctl enable kubelet
@@ -247,6 +277,7 @@ set_credentials() {
247
277
}
248
278
249
279
setup_dsnmasq
280
+ update_ovs_nm_config
250
281
251
282
enable_and_start_kubelet
252
283
replace_default_pubkey
0 commit comments