Created
June 25, 2021 01:30
-
-
Save Weithenn/bf732cb524a0f489fe0e8d526eff756b to your computer and use it in GitHub Desktop.
Configure Cisco UCS CIMC fan policy to High-Power
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ================================================================== | |
# Author: Weithenn Wang (weithenn at weithenn.org) | |
# Version: v0.1 - June 25, 2021 | |
# Description: Configure Cisco UCS CIMC fan policy to High-Power | |
# ================================================================== | |
--- | |
- hosts: all | |
gather_facts: no | |
connection: local | |
vars: | |
cimc: | |
username: '{{ CiscoUCS_username }}' | |
password: '{{ CiscoUCS_password }}' | |
tasks: | |
- name: Configure Cisco UCS CIMC fan policy to High-Power | |
shell: | | |
sshpass -p {{ cimc.password }} ssh -T -o StrictHostKeyChecking=no {{ cimc.username }}@{{ inventory_hostname }} << EOL | |
scope chassis/fan-policy | |
set fan-policy high-power | |
commit | |
EOL | |
- name: Pause for 30 seconds to CIMC commit | |
pause: | |
seconds: 30 | |
- name: Check Cisco UCS CIMC fan policy status | |
shell: | | |
sshpass -p "{{ cimc.password }}" ssh -T -o StrictHostKeyChecking=no {{ cimc.username}}@"{{ inventory_hostname }}" << EOL | |
show chassis/fan-policy detail | |
EOL | |
register: check_fan_policy | |
- name: Print Cisco UCS CIMC fan policy status | |
debug: | |
msg: "{{ inventory_hostname }} is {{ check_fan_policy.stdout_lines[2] | replace(' ', '') }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment