Skip to content

Instantly share code, notes, and snippets.

@kd7lxl
Created April 24, 2017 21:09
Show Gist options
  • Save kd7lxl/406587560e5242b57ce3165b46baf983 to your computer and use it in GitHub Desktop.
Save kd7lxl/406587560e5242b57ce3165b46baf983 to your computer and use it in GitHub Desktop.
Ansible playbook to install HP server management tools
---
- name: Install HP management tools
hosts: hp
become: yes
tasks:
- name: Install pexpect for Ansible expect
apt:
name: python-pexpect
- name: Add HP key
apt_key:
url: https://downloads.linux.hpe.com/SDR/hpePublicKey2048_key1.pub
state: present
- name: Get HP repo script
get_url:
url: https://downloads.linux.hpe.com/SDR/add_repo.sh
dest: /tmp/add_repo.sh
- name: Add HP repo
expect:
command: sh /tmp/add_repo.sh mcp
responses:
"Press enter to display it": ""
"--More--": ""
"Do you accept?": "yes"
"okay to overwrite": "yes"
- name: Ensure HP management tools are installed
apt:
name: hpssacli
state: present
update_cache: yes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment