community / community.general / 6.6.8 / module / ocapi_command Manages Out-Of-Band controllers using Open Composable API (OCAPI) | "added in version" 6.3.0 of community.general" Authors: Mike Moerk (@mikemoerk)community.general.ocapi_command (6.6.8) — module
Install with ansible-galaxy collection install community.general:==6.6.8
collections: - name: community.general version: 6.6.8
Builds OCAPI URIs locally and sends them to remote OOB controllers to perform an action.
Manages OOB controller such as Indicator LED, Reboot, Power Mode, Firmware Update.
- name: Set the power state to low community.general.ocapi_command: category: Chassis command: PowerModeLow baseuri: "{{ baseuri }}" username: "{{ username }}" password: "{{ password }}"
- name: Set the power state to normal community.general.ocapi_command: category: Chassis command: PowerModeNormal baseuri: "{{ baseuri }}" username: "{{ username }}" password: "{{ password }}"
- name: Set chassis indicator LED to on community.general.ocapi_command: category: Chassis command: IndicatorLedOn baseuri: "{{ baseuri }}" proxy_slot_number: 2 username: "{{ username }}" password: "{{ password }}"
- name: Set chassis indicator LED to off community.general.ocapi_command: category: Chassis command: IndicatorLedOff baseuri: "{{ baseuri }}" proxy_slot_number: 2 username: "{{ username }}" password: "{{ password }}"
- name: Reset Enclosure community.general.ocapi_command: category: Systems command: PowerGracefulRestart baseuri: "{{ baseuri }}" proxy_slot_number: 2 username: "{{ username }}" password: "{{ password }}"
- name: Firmware Upload community.general.ocapi_command: category: Update command: FWUpload baseuri: "iom1.wdc.com" proxy_slot_number: 2 username: "{{ username }}" password: "{{ password }}" update_image_path: "/path/to/firmware.tar.gz"
- name: Firmware Update community.general.ocapi_command: category: Update command: FWUpdate baseuri: "iom1.wdc.com" proxy_slot_number: 2 username: "{{ username }}" password: "{{ password }}"
- name: Firmware Activate community.general.ocapi_command: category: Update command: FWActivate baseuri: "iom1.wdc.com" proxy_slot_number: 2 username: "{{ username }}" password: "{{ password }}"
- name: Delete Job community.general.ocapi_command: category: Jobs command: DeleteJob job_name: FirmwareUpdate baseuri: "{{ baseuri }}" proxy_slot_number: 2 username: "{{ username }}" password: "{{ password }}"
baseuri: description: - Base URI of OOB controller. required: true type: str command: description: - Command to execute on OOB controller. required: true type: str timeout: default: 10 description: - Timeout in seconds for URL requests to OOB controller. type: int category: description: - Category to execute on OOB controller. required: true type: str job_name: description: - For C(DeleteJob) command, the name of the job to delete. required: false type: str password: description: - Password for authenticating to OOB controller. required: true type: str username: description: - Username for authenticating to OOB controller. required: true type: str proxy_slot_number: description: For proxied inband requests, the slot number of the IOM. Only applies if I(baseuri) is a proxy server. type: int update_image_path: description: - For C(FWUpload), the path on the local filesystem of the firmware update image. required: false type: str
jobUri: description: URI to use to monitor status of the operation. Returned for async commands such as Firmware Update, Firmware Activate. returned: when supported sample: https://ioma.wdc.com/Storage/Devices/openflex-data24-usalp03020qb0003/Jobs/FirmwareUpdate/ type: str msg: description: Message with action result or error description. returned: always sample: Action was successful type: str operationStatusId: description: OCAPI State ID (see OCAPI documentation for possible values). returned: when supported sample: 2 type: int