Dre4m Shell
Server IP : 85.214.239.14  /  Your IP : 3.143.115.102
Web Server : Apache/2.4.62 (Debian)
System : Linux h2886529.stratoserver.net 4.9.0 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64
User : www-data ( 33)
PHP Version : 7.4.18
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
MySQL : OFF  |  cURL : OFF  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/ansible_collections/cisco/intersight/playbooks/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /lib/python3/dist-packages/ansible_collections/cisco/intersight/playbooks//server_firmware.yml
---
#
# The hosts group used is provided by the group variable or defaulted to 'Intersight_Servers'.
# You can specify a specific host (or host group) on the command line:
#   ansible-playbook ... -e group=<your host group>
#   e.g., ansible-playbook server_profiles.yml -e group=TME_Demo
#
- hosts: "{{ group | default('Intersight_Servers') }}"
  connection: local
  gather_facts: false
  vars:
    # Create an anchor for api_info that can be used throughout the file
    api_info: &api_info
      api_private_key: "{{ api_private_key }}"
      api_key_id: "{{ api_key_id }}"
      api_uri: "{{ api_uri | default(omit) }}"
      validate_certs: "{{ validate_certs | default(omit) }}"
      state: "{{ state | default(omit) }}"
    fw_version: 4.1(2b)
    file_share: 172.28.224.77/mnt/SHARE/ISOS/HUU
  tasks:
    # Edit FW to be used as needed for server type below
    - set_fact:
        file_name: "ucs-c220m4-huu-{{ fw_version | replace('(','.') | replace(')','') }}.iso"
        supported_models:
          - UCSC-C220-M4L
          - UCSC-C220-M4S
      when: model is search("UCSC-C220-M4.*")
    - set_fact:
        file_name: "ucs-c240m4-huu-{{ fw_version | replace('(','.') | replace(')','') }}.iso"
        supported_models:
          - UCSC-C240-M4L
          - UCSC-C240-M4S
          - UCSC-C240-M4SX
          - UCSC-C240-M4SNEBS
          - UCSC-C240-M4S2
      when: model is search("UCSC-C240-M4.*")
    - set_fact:
        file_name: "ucs-c240m5-huu-{{ fw_version | replace('(','.') | replace(')','') }}.iso"
        supported_models:
          - UCSC-C240-M5S
          - UCSC-C240-M5L
          - UCSC-C240-M5SX
          - UCSC-C240-M5SN
          - UCSC-C240-M5SD
          - HX240C-M5SX
          - HXAF240C-M5SX
          - HX240C-M5L
          - HX240C-M5SD
          - HXAF240C-M5SD
      when: model is search("UCSC-C240-M5.*")
    - set_fact:
        file_name: "ucs-c220m5-huu-{{ fw_version | replace('(','.') | replace(')','') }}.iso"
        supported_models:
          - UCSC-C220-M5SX
          - UCSC-C220-M5L
          - UCSC-C220-M5SN
          - HX220C-M5SX
          - HXAF220C-M5SX
      when: model is search("UCSC-C220-M5.*")
    - set_fact:
        file_location: "{{ file_share }}/{{ file_name }}"
    # Set the distributable type based on the management mode and server type
    - set_fact:
        dist_type: STANDALONE
      when: mode == 'Intersight' or mode == 'IntersightStandalone'
    # Get a user defined FW version
    - name: Get Moid of user defined FW version
      intersight_rest_api:
        <<: *api_info
        resource_path: /firmware/Distributables
        query_params:
          $filter: "FileLocation eq '{{ file_location }}'"
        update_method: post
        api_body: {
          "Catalog": {
            "Moid": "5cd993686567612d30aaa762"
          },
          "ImportAction": "None",
          "Name": "{{ file_name }}",
          "Origin": "User",
          "Source": {
            "ObjectType": "softwarerepository.NfsServer",
            "FileLocation": "{{ file_location }}"
          },
          "SupportedModels": "{{ supported_models }}",
          "Version": "{{ fw_version }}"
        }
      delegate_to: localhost
      register: fw_resp
    - name: Update server firmware
      cisco.intersight.intersight_rest_api:
        <<: *api_info
        resource_path: /firmware/Upgrades
        query_params:
          $filter: "Server.Moid eq '{{ server_moid }}'"
        update_method: post
        # nw_upgrade_full supported in UI, nw_upgrade_mount_only has partial API support
        api_body: {
          "UpgradeType": "network_upgrade",
          "Distributable": {
            "Moid": "{{ fw_resp.api_response.Moid }}"
          },
          "DirectDownload": {},
          "NetworkShare": {
            "Upgradeoption": "nw_upgrade_mount_only",
            "MapType":"nfs"
          },
          "Server": {
            "ObjectType": "compute.{{ object_type }}",
            "Moid": "{{ server_moid }}"
          }
        }
      delegate_to: localhost
      when: server_moid is defined

Anon7 - 2022
AnonSec Team