@@ -236,13 +236,15 @@ func (s *Service) DeployMachine(userDataB64 string) (_ *infrav1beta1.Machine, re
236236
237237 s .scope .Info ("Swap disabled" , "system-id" , m .SystemID ())
238238
239- // Configure static IP before deployment
240- if staticIP := s .scope .GetStaticIP (); staticIP != "" {
241- staticIPConfig := s .scope .GetStaticIPConfig ()
242- if staticIPConfig != nil {
243- err := s .setMachineStaticIP (m .SystemID (), staticIPConfig )
244- if err != nil {
245- return nil , errors .Wrapf (err , "failed to configure static IP" )
239+ // Configure static IP before deployment (control-plane only)
240+ if s .scope .IsControlPlane () {
241+ if staticIP := s .scope .GetStaticIP (); staticIP != "" {
242+ staticIPConfig := s .scope .GetStaticIPConfig ()
243+ if staticIPConfig != nil {
244+ err := s .setMachineStaticIP (m .SystemID (), staticIPConfig )
245+ if err != nil {
246+ return nil , errors .Wrapf (err , "failed to configure static IP" )
247+ }
246248 }
247249 }
248250 }
@@ -276,10 +278,12 @@ func (s *Service) createVMViaMAAS(ctx context.Context, userDataB64 string) (*inf
276278 machineName := s .scope .Machine .Name
277279 vmName := fmt .Sprintf ("vm-%s" , machineName )
278280 _ , _ = m .Modifier ().SetHostname (vmName ).Update (ctx )
279- if staticIP := s .scope .GetStaticIP (); staticIP != "" {
280- if err := s .setMachineStaticIP (m .SystemID (), & infrav1beta1.StaticIPConfig {IP : staticIP }); err != nil {
281- // Fail fast so we don't attempt Deploy without a network link configured
282- return nil , errors .Wrap (err , "failed to configure static IP before deploy" )
281+ if s .scope .IsControlPlane () {
282+ if staticIP := s .scope .GetStaticIP (); staticIP != "" {
283+ if err := s .setMachineStaticIP (m .SystemID (), & infrav1beta1.StaticIPConfig {IP : staticIP }); err != nil {
284+ // Fail fast so we don't attempt Deploy without a network link configured
285+ return nil , errors .Wrap (err , "failed to configure static IP before deploy" )
286+ }
283287 }
284288 }
285289 deployingM , err := m .Deployer ().
0 commit comments