mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Add firmware update state to dellchassis
This commit is contained in:
parent
6356af3b99
commit
929e679b25
1 changed files with 27 additions and 0 deletions
|
@ -140,6 +140,7 @@ pillar stated above:
|
|||
# Import python libs
|
||||
from __future__ import absolute_import
|
||||
import logging
|
||||
import os
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
@ -545,3 +546,29 @@ def switch(name, ip=None, netmask=None, gateway=None, dhcp=None,
|
|||
|
||||
ret['comment'] = 'Dell chassis switch {0} was updated.'.format(name)
|
||||
return ret
|
||||
|
||||
|
||||
def firmware_update(firmwarefile, host,
|
||||
directory=''):
|
||||
'''
|
||||
State to update the firmware on host
|
||||
using the ``racadm`` command
|
||||
|
||||
firmwarefile
|
||||
filename (string) starting with ``salt://``
|
||||
host
|
||||
string representing the hostname
|
||||
supplied to the ``racadm`` command
|
||||
directory
|
||||
Directory name where firmwarefile
|
||||
will be downloaded
|
||||
'''
|
||||
dest = os.path.join(directory, filename[7:])
|
||||
|
||||
__salt__['cp.get_file'](firmwarefile, dest)
|
||||
|
||||
username = __pillar__['proxy']['admin_user']
|
||||
password = __pillar__['proxy']['admin_password']
|
||||
__salt__['dracr.update_firmware'](dest, host,
|
||||
admin_username=username,
|
||||
admin_password=password)
|
||||
|
|
Loading…
Add table
Reference in a new issue