SUSE / DeepSea

A collection of Salt files for deploying, managing and automating Ceph.
GNU General Public License v3.0
161 stars 75 forks source link

ceph.updates.salt: restart salt-minion.service with bg=True #1870

Closed smithfarm closed 3 years ago

smithfarm commented 3 years ago

Implement the latest salt-minion.service restart best practice.

Fixes: https://bugzilla.suse.com/show_bug.cgi?id=1181099 Signed-off-by: Nathan Cutler ncutler@suse.com

smithfarm commented 3 years ago

@tserong Does this look right to you? (I'm not sure if failhard: True is compatible with bg=True ... will test)

smithfarm commented 3 years ago

With this patch, ceph.updates.salt works for me:

master:~ # salt -I 'cluster:ceph' state.apply ceph.updates.salt
master.ses6-to-ses7.test:
  Name: update salt - Function: pkg.latest - Result: Clean Started: - 14:13:41.075828 Duration: 9591.735 ms                                                                                                   
  Name: systemctl restart salt-minion - Function: cmd.run - Result: Changed Started: - 14:13:50.670445 Duration: 6.592 ms                                                                                     

Summary for master.ses6-to-ses7.test
------------
Succeeded: 2 (changed=1)
Failed:    0
------------
Total states run:     2
Total run time:   9.598 s
node3.ses6-to-ses7.test:
  Name: update salt - Function: pkg.latest - Result: Clean Started: - 14:13:41.546582 Duration: 33637.879 ms                                                                                                  
  Name: systemctl restart salt-minion - Function: cmd.run - Result: Changed Started: - 14:14:15.189184 Duration: 8.64 ms                                                                                      

Summary for node3.ses6-to-ses7.test
------------
Succeeded: 2 (changed=1)
Failed:    0
------------
Total states run:     2
Total run time:  33.647 s
node2.ses6-to-ses7.test:
  Name: update salt - Function: pkg.latest - Result: Clean Started: - 14:13:41.719988 Duration: 33620.067 ms
  Name: systemctl restart salt-minion - Function: cmd.run - Result: Changed Started: - 14:14:15.344173 Duration: 8.785 ms

Summary for node2.ses6-to-ses7.test
------------
Succeeded: 2 (changed=1)
Failed:    0
------------
Total states run:     2
Total run time:  33.629 s
node1.ses6-to-ses7.test:
  Name: update salt - Function: pkg.latest - Result: Clean Started: - 14:13:41.871958 Duration: 33647.188 ms
  Name: systemctl restart salt-minion - Function: cmd.run - Result: Changed Started: - 14:14:15.524221 Duration: 12.159 ms

Summary for node1.ses6-to-ses7.test
------------
Succeeded: 2 (changed=1)
Failed:    0
------------
Total states run:     2
Total run time:  33.659 s
master:~ #
smithfarm commented 3 years ago

@tserong I'm thinking "salt-call service.restart salt-minion" might take considerably longer to run than "systemctl restart salt-minion". This is based purely on my anecdotal experience running "salt-call foo" commands, though. In any case, I made the change as requested.