Volans has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/380493 )
Change subject: wmf-auto-reimage: remove Salt actions
......................................................................
wmf-auto-reimage: remove Salt actions
Bug: T164780
Change-Id: I6f96e30ae3eb4ccccf5c897f808c2dad15a4eab0
---
M modules/profile/files/cumin/wmf_auto_reimage_host.py
M modules/profile/files/cumin/wmf_auto_reimage_lib.py
2 files changed, 1 insertion(+), 39 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/operations/puppet
refs/changes/93/380493/1
diff --git a/modules/profile/files/cumin/wmf_auto_reimage_host.py
b/modules/profile/files/cumin/wmf_auto_reimage_host.py
index 45f858a..9922608 100644
--- a/modules/profile/files/cumin/wmf_auto_reimage_host.py
+++ b/modules/profile/files/cumin/wmf_auto_reimage_host.py
@@ -90,11 +90,7 @@
if args.no_pxe:
lib.print_line('Skipping PXE reboot', host=args.host)
else:
- # Cleanup Puppet and Salt
- lib.puppet_remove_host(args.host)
- lib.salt_key_action(args.host, 'reject') # In case it was unaccepted
- lib.salt_key_action(args.host, 'delete') # Accepted and rejected keys
- lib.salt_key_ensure(args.host, 'all', absent=True)
+ lib.puppet_remove_host(args.host) # Cleanup Puppet
# Reboot into PXE mode to start the reimage
lib.print_line(
@@ -118,13 +114,6 @@
# Ensure the host is in Icinga
lib.run_puppet([lib.resolve_dns(lib.ICINGA_DOMAIN, 'CNAME')],
no_raise=True)
lib.icinga_downtime(args.host, user, args.phab_task_id)
-
- # Sign the new Salt key
- if not args.no_pxe:
- lib.salt_key_ensure(args.host, 'unaccepted')
- lib.salt_key_action(args.host, 'accept')
-
- lib.salt_key_ensure(args.host, 'accepted')
# Issue a reboot and wait for it and also for Puppet to complete
if not args.no_reboot:
diff --git a/modules/profile/files/cumin/wmf_auto_reimage_lib.py
b/modules/profile/files/cumin/wmf_auto_reimage_lib.py
index 3881799..2f74133 100644
--- a/modules/profile/files/cumin/wmf_auto_reimage_lib.py
+++ b/modules/profile/files/cumin/wmf_auto_reimage_lib.py
@@ -612,33 +612,6 @@
print_line('Removed from Puppet', host=host)
-def salt_key_ensure(host, status, absent=False):
- """Ensure that the Salt key for a given host is present or absent for the
given key status.
-
- Arguments:
- host -- the FQDN of the host for which to check the Salt key
- status -- the salt-key list selector, one of: unaccepted, accepted,
rejected, all
- absent -- whether to ensure the absence of the key instead of its presence
[default: false]
- """
- neg = ''
- if absent:
- neg = '! '
- command = "{neg}salt-key -l {status} | fgrep -q '{host}'".format(
- neg=neg, status=status, host=host)
- run_cumin('salt_key_ensure', 'neodymium.eqiad.wmnet', [command])
-
-
-def salt_key_action(host, action):
- """Perform an action on the Salt key for a given host.
-
- Arguments:
- host -- the FQDN of the host for which to check the Salt key
- action -- the action to perform, one of: accept, reject, delete
- """
- command = "salt-key --yes --{action} '{host}'".format(action=action,
host=host)
- run_cumin('salt_key_action', 'neodymium.eqiad.wmnet', [command])
-
-
def ipmitool_command(mgmt, ipmi_command):
"""Run an ipmitool command for a remote host.
--
To view, visit https://gerrit.wikimedia.org/r/380493
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I6f96e30ae3eb4ccccf5c897f808c2dad15a4eab0
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Volans <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits