• Stars
    star
    104
  • Rank 329,526 (Top 7 %)
  • Language
    Python
  • License
    Apache License 2.0
  • Created about 9 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

This project is no longer being developed and has limited support. Please use the newer Ansible Collection project: https://github.com/HewlettPackard/oneview-ansible-collection

HPE OneView SDK for Ansible

Build Status

OV Version 6.10 6.00 5.60 5.50 5.40
SDK Version/Tag v6.1.0 v6.0.0 v5.10.0 v5.9.0 v5.8.0
Build Status Build status Build status Build status Build status Build status

Introduction

HPE OneView makes it simple to deploy and manage today’s complex hybrid cloud infrastructure. HPE OneView can help you transform your data center to software-defined, and it supports HPE’s broad portfolio of servers, storage, and networking solutions, ensuring the simple and automated management of your hybrid infrastructure. Software-defined intelligence enables a template-driven approach for deploying, provisioning, updating, and integrating compute, storage, and networking infrastructure.

The HPE OneView Ansible library provides modules to manage HPE OneView using Ansible playbooks using HPE OneView REST APIs. You can find the latest supported HPE OneView Ansible SDK here

Each OneView resource operation is exposed through an Ansible module. Specific modules are provided to gather facts about the resource. The detailed documentation for each module is available at: HPE OneView Ansible Modules Documentation

What's New

HPE OneView Ansible library extends support of the SDK to OneView REST API version 2800 (OneView v6.10) and ImageStreamer REST API version 2020 (I3S v6.10)

Please refer to notes for more information on the changes , features supported and issues fixed in this version

Getting Started

Installation and Configuration

HPE OneView SDK for Ansible can be installed from Source and Docker container installation methods.

Requirements

To run the Ansible modules provided in this project, we need the below :

Ansible <= 2.9
Python >= 3.4.2
hpeOneView==6.1.0

Installation

Perform a full installation from Source

Clone the repository

$ git clone https://github.com/HewlettPackard/oneview-ansible.git
$ cd oneview-ansible

Install dependency packages using PIP

$ pip install -r requirements.txt

Configure the ANSIBLE_LIBRARY environmental variable

Set the environment variables ANSIBLE_LIBRARY and ANSIBLE_MODULE_UTILS, specifying the library full path from the cloned project:

$ export ANSIBLE_LIBRARY=/path/to/oneview-ansible/library
$ export ANSIBLE_MODULE_UTILS=/path/to/oneview-ansible/library/module_utils/

From Docker Image / Container

The containerized version of the oneview-ansible modules is available in the Docker Store. The Docker Store image tag consist of two sections: <sdk_version-OV_version>

Download and store a local copy of hpe-oneview-sdk-for-ansible and use it as a Docker image.

$ docker pull hewlettpackardenterprise/hpe-oneview-sdk-for-ansible:v6.1.0-OV6.1

Run docker command which in turn will create a sh session where SDK user can create files, issue commands and execute playbooks

$ docker run -it hewlettpackardenterprise/hpe-oneview-sdk-for-ansible:v6.1.0-OV6.1 /bin/sh

There is also a how-to guide with instructions on how to use the container without creating a sh session.

OneView Client Configuration

Using a JSON Configuration File

To use the Ansible OneView modules, connection properties for accessing the OneView appliance can be set in a JSON file. This file is used to define the settings, which will be used on the OneView appliance connection, like hostname, authLoginDomain, username, and password. Here's an example:

{
  "ip": "172.25.105.12",
  "credentials": {
    "userName": "Administrator",
    "authLoginDomain": "",
    "password": "secret123"
  },
  "api_version": 2800
}

The api_version specifies the version of the REST API to be invoked. When api_version is not specified, it will take provided appliance API version as api_version.

The authLoginDomain specifies the login domain directory of the appliance. When authLoginDomain is not specified, it will consider the appliance's default domain directory.

If your environment requires a proxy, define the proxy properties in the JSON file using the following syntax:

  "proxy": "<proxy_host>:<proxy_port>"

🔒 Tip: Check the file permissions since the password is stored in clear-text.

The configuration file path must be provided for all of the playbooks config arguments. For example:

- name: Gather facts about the FCoE Network with name 'FCoE Network Test'
  oneview_fcoe_network_facts:
    config: "/path/to/config.json"
    name: "FCoE Network Test"

Environment Variables

Configuration can also be defined through environment variables:

# Required
export ONEVIEWSDK_IP='172.25.105.12'
export ONEVIEWSDK_USERNAME='Administrator'
export ONEVIEWSDK_PASSWORD='secret123'

# Optional
export ONEVIEWSDK_API_VERSION='2800'
export ONEVIEWSDK_AUTH_LOGIN_DOMAIN='authdomain'
export ONEVIEWSDK_PROXY='<proxy_host>:<proxy_port>'

🔒 Tip: Make sure no unauthorised person has access to the environment variables, since the password is stored in clear-text.

In this case, you shouldn't provide the config argument. For example:

- name: Gather facts about the FCoE Network with name 'FCoE Network Test'
  oneview_fcoe_network_facts:
    name: "FCoE Network Test"

Once you have defined the environment variables, you can run the plays.

Parameters in the playbook

The third way to pass in your HPE OneView credentials to your tasks is through explicit specification on the task. This option allows the parameters hostname, auth_login_domain,username, password, api_version and image_streamer_hostname to be passed directly inside your task.

- name: Create a Fibre Channel Network
  oneview_fc_network:
    hostname: 172.16.101.48
    username: administrator
    password: my_password
    auth_login_domain: ""
    api_version: 2800
    state: present
    data:
      name: "{{ network_name }}"
      fabricType: 'FabricAttach'
      linkStabilityTime: '30'
      autoLoginRedistribution: true
  no_log: true
  delegate_to: localhost

Setting no_log: true is highly recommended in this case, as the credentials are otherwise returned in the log after task completion.

Storing credentials using Ansible Vault

Ansible Vault feature may be leveraged for storing the credential of the user in encrypted format.

  1. Create a oneview_config.yml file.

  2. Run below commands to encrypt your username and password for oneview.

    ansible-vault encrypt_string 'secret123' --name ONEVIEWSDK_PASSWORD
    

    Note: This password will be used to run the playbook.

  3. Paste the encrypted password along with the configuration in oneview_config.yml file.

    # Required
    ip: 172.168.1.1
    api_version:2800
    username: Administrator
    password: !vault |
      $ANSIBLE_VAULT;1.1;AES256
      37646435306637633461376438653439323666383934353234333934616363313164636637376536
      3239356538653537643734626265366662623863323661350a613834313562303635343931356139
      35343863313563363830356638343339373138316539613636336532333065366133386662333833
      6663363236663031340a636562646634323136353737373539326434626137353837333530376665
      3835
  4. Update the oneview_config.yml as vars_file in playbook for example:

- vars_file:
   oneview_config.yml
- name: Create a Fibre Channel Network
  oneview_fc_network:
    hostname: "{{ ip }}"
    username: "{{ username }}"
    password: "{{ password }}"
    auth_login_domain: "{{ domain_directory }}"
    api_version: "{{ api_version }}"
    state: present
    data:
      name: "{{ network_name }}"
      fabricType: 'FabricAttach'
      linkStabilityTime: '30'
      autoLoginRedistribution: true
  no_log: true
  delegate_to: localhost

We can encrypt the oneview_config.yml file also, but if you encrypt the file then you shall not encrypt the password inside the encrypted file.

🔒 Tip: Make sure no unauthorised person has access to the encrypted variables/files, since the password can be decrypted with the password.

  1. Run the playbook with --ask-vault-pass option to get the password prompt to run the playbook.
ansible-playbook example.yml --ask-vault-pass

Note: Most of the examples provided in this repository uses OneView Credentials in plain text.

Setting OneView API Version

The Ansible modules for HPE OneView support the API endpoints for HPE OneView 4.00, 4.10, 4.20, 5.00, 5.20, 5.30, 5.40, 5.50, 5.60, 6.00, 6.10
The current default HPE OneView version will pick the OneView appliance version.

To use a different API, you must set the API version together with your credentials, either using the JSON configuration:

"api_version": 2800

OR using the Environment variable:

export ONEVIEWSDK_API_VERSION='2800'

If this property is not specified, it will fall back to the default value.

HPE Synergy Image Streamer

Modules to manage HPE Synergy Image Streamer appliances are also included in this project. To use these modules, you must set the Image Streamer IP on the OneViewClient configuration, either using the JSON configuration:

"image_streamer_ip": "100.100.100.100"

OR using the Environment variable:

export ONEVIEWSDK_IMAGE_STREAMER_IP='100.100.100.100'

Examples

Sample playbooks and instructions on how to run the modules can be found in the examples directory. You can find sample playbooks in the examples folder. Just look for the playbooks with the image_streamer_ prefix.

Example of a playbook using Ansible OneView modules

- hosts: all
  tasks:

    - name: Ensure that the Fibre Channel Network is present with fabricType 'DirectAttach'
      oneview_fc_network:
        config: "/path/to/config.json"
        state: present
        data:
          name: 'New FC Network'
          fabricType: 'DirectAttach'

    - name: Ensure that Fibre Channel Network is absent
      oneview_fc_network:
        config: "/path/to/config.json"
        state: absent
        data:
          name: 'New FC Network'

    - name: Gather facts about the FCoE Network with name 'Test FCoE Network Facts'
      oneview_fcoe_network_facts:
        config: "/path/to/config.json"
        name: "Test FCoE Network Facts"

End-to-end examples

Getting Help

Are you running into a road block? Have an issue with unexpected bahriov? Feel free to open a new issue on the issue tracker

For more information on how to open a new issue refer to How can I get help & support

License

This project is licensed under the Apache license. Please see LICENSE for more information.

Contributing and feature requests

We welcome your contributions to the Ansible Modules for HPE OneView. See CONTRIBUTING.md for more details.

Additional Resources

HPE OneView Documentation

HPE OneView Release Notes

HPE OneView Support Matrix

HPE OneView Installation Guide

HPE OneView User Guide

HPE OneView Online Help

HPE OneView REST API Reference

HPE OneView Firmware Management White Paper

HPE OneView Deployment and Management White Paper

HPE OneView Community

HPE OneView Community Forums

Learn more about HPE OneView at hpe.com/info/oneview

More Repositories

1

netperf

Netperf is a benchmark that can be used to measure the performance of many different types of networking. It provides tests for both unidirectional throughput, and end-to-end latency.
C
725
star
2

swarm-learning

A simplified library for decentralized, privacy preserving machine learning
Python
328
star
3

cacti

An integrated cache and memory access time, cycle time, area, leakage, and dynamic power model
C++
301
star
4

squest

Service request portal on top of Ansible Tower/AWX
Python
294
star
5

LinuxKI

LinuxKI Toolset (Trace-based performance analysis tool)
C
224
star
6

quartz

Quartz: A DRAM-based performance emulator for NVM
C
158
star
7

dlcookbook-dlbs

Deep Learning Benchmarking Suite
Python
130
star
8

POSH-HPEOneView

PowerShell language bindings library for HPE OneView.
PowerShell
125
star
9

mcpat

An integrated power, area, and timing modeling framework for multicore and manycore architectures
C++
122
star
10

PacketRusher

High performance 5G UE/gNB Simulator and CP/UP load tester.
Go
99
star
11

yoda

GitHub extension for agile project management using the issues subsystem.
JavaScript
90
star
12

python-hpOneView

DEPRECATED - no longer actively maintained. New repository: https://github.com/HewlettPackard/oneview-python
Python
87
star
13

python-ilorest-library-old

Python library for iLO RESTful API
Python
85
star
14

wireless-tools

Wireless Tools for Linux
C
85
star
15

PowerShell-ProLiant-SDK

PowerShell sample scripts for managing HPE servers
PowerShell
85
star
16

kraal

Enables the use of Kotlin coroutines and GraalVM native-image together
Kotlin
84
star
17

monkeyble

End-to-end testing framework for Ansible
Python
78
star
18

Atlas

Atlas: Programming for Persistent Memory
C++
74
star
19

foedus

FOEDUS: Fast Optimistic Engine for Data Unification Services
65
star
20

foedus_code

FOEDUS main source code repository
C++
64
star
21

structex

Go structure annotations that supports encoding and decoding; similar to C-style bitfields. Supports bitfield packing, self-describing layout parameters, and alignment.
Go
58
star
22

ansible-ilorest-role

Ansible role for installing the Python iLOrest library and showcasing a few examples.
Python
52
star
23

terraform-provider-oneview

Automates the provisioning of physical infrastructure from a private cloud using templates from HPE OneView with Terraform
Go
49
star
24

reconbf

Recon system hardening scanner
Python
47
star
25

sandpiper

Implementation of the Loopy Belief Propagation algorithm for Apache Spark
Scala
42
star
26

sparkle

C++
38
star
27

ilo-ansible-collection

Ansible Collection and Sample Playbooks for HPE iLO
Python
38
star
28

dockerfile-parser-rs

a Rust library for parsing, validating, and modifying Dockerfiles
Rust
37
star
29

jupyterhub-samlauthenticator

jupyterhub-samlauthenticator
Python
34
star
30

cloudformation-plus

A tool that adds features to AWS CloudFormation that reduce the amount of code you must write to deploy non-trivial applications.
Python
31
star
31

cmf

CMF library helps to collect and store information associated with ML pipelines. It tracks the lineages for artifacts and executions of distributed AI pipelines. It provides API's to record and query the metadata associated with ML pipelines. The framework adopts a data first approach and all artifacts recorded in the framework are versioned and identified by the content hash.
Python
30
star
32

lustre_exporter

Prometheus exporter for use with the Lustre parallel filesystem
Go
29
star
33

nvthreads

C
27
star
34

nagios-plugins-hpilo

Nagios plug-in for iLO Agentless Management
Shell
26
star
35

mds

Managed Data Structures
Java
26
star
36

oneview-golang

Golang bindings for OneView api's
Go
26
star
37

dpp

Device Provisioning Protocol is a Wi-Fi Alliance program to securely provision devices to obtain network access.
C
25
star
38

mdc-toolkit

24
star
39

Docker-SimpliVity

Ansible deployment playbooks with detailed deployment guides to rapidly provision a Docker dev and Docker ops environment in less than 30 minutes
Shell
24
star
40

woodchipper

An interactive command-line log processor
Rust
23
star
41

oneview-ansible-collection

Ansible Collection and Sample Playbooks for HPE OneView
Python
22
star
42

hpe-solutions-openshift

This GitHub site contains deployment guides and resources for deploying Red Hat OpenShift on HPE platforms.
Python
22
star
43

chef-provisioning-oneview

Chef Provisioning Driver for HPE OneView
Ruby
21
star
44

lustre-csi-driver

A Lustre container storage interface that allows Kubernetes to mount/unmount provisioned Lustre filesystems into containers.
Go
20
star
45

supersim

A flexible event-driven cycle-accurate network simulator
C++
19
star
46

hpe3par_ansible_module

HPE Alletra 9000 and HPE Primera and HPE 3PAR ansible module to configure, provision and manage storage systems and resources
Python
18
star
47

csa-ce

This repo contains scripts which start HPE Cloud Service Automation Community Edition 4.7 (HPE CSA CE) in Docker.
Shell
17
star
48

ezdemo

HPE Ezmeral Deployment tool for demos
Shell
17
star
49

ilo-chef

iLO Resource Provider for Chef
Ruby
17
star
50

oneview-chef

This project is no longer being developed and has limited support. In the near future this repository will be fully deprecated. Please consider using other OneView projects, such as Terraform and Ansible Collection
Ruby
17
star
51

oneview-osdeployment

Sample HPE OneView OS deployment integration
Python
16
star
52

oneview-sdk-java

Java SDK for HPE OneView
Java
16
star
53

galadriel

SPIFFE Federation the easy way
Go
16
star
54

ilo-sdk-ruby

iLO Software Development Kit for Ruby Programmers.
Ruby
15
star
55

criu-pmem

C
15
star
56

oneview-redfish-toolkit

HPE OneView Redfish Toolkit provides a REST service to answer DMTF's Redfish compliant requests by querying HPE OneView
Python
15
star
57

javascript-ilorest-library

JavaScript
15
star
58

mpgc

Multi-Process Garbage Collector
C++
15
star
59

logger

A log parsing engine written in Java for high performance. Additionally, logger is also highly configurable.
Java
14
star
60

pcp_exporter

Exporter for Performance CoPilot Metrics
Go
14
star
61

Aruba-FlaskwithNetworking

Python
14
star
62

zabbix-plugins-hpeilo

Shell
13
star
63

hpe-oneview-hubot

HPE OneView Chatbot Integration
JavaScript
13
star
64

osfci

Go
13
star
65

prometheus-parser-rs

a Rust library for parsing and validating Prometheus query expressions
Rust
12
star
66

nagios-hpeilo-restful-extension

Nagios Plug-in for iLO RESTful Extension
Shell
12
star
67

c-spiffe

C
12
star
68

LSGI

Large-Scale Graph Inference
HTML
12
star
69

oneview-powershell-samples

HPE OneView PowerShell sample scripts
PowerShell
12
star
70

oneview-sdk-ruby

This project is no longer being developed and has limited support. In the near future this repository will be fully deprecated. Please consider using other OneView projects, such as Golang and Python.
Ruby
12
star
71

zing-stats

Tool for generating summary stat reports and graphs from Gerrit (https://www.gerritcodereview.com/) and GitHub Enterprise review and pull requests data using https://plot.ly/.
Python
12
star
72

py-spiffe

Python library for SPIFFE support
Python
11
star
73

Jenkins-stats

Tool for gathering job data from the Jenkins CI system (https://jenkins-ci.org/) and generating summary stat reports and graphs. These reports cover metrics such as success/failure rates and job duration.
Python
11
star
74

image-streamer-tools

PowerShell
10
star
75

OpenShift-on-SimpliVity

10
star
76

lsrrb

Linux Software Raid Redundant Boot
Python
10
star
77

Docker-Synergy

Shell
10
star
78

shoveller

Rust
10
star
79

hpecli

Command-line interface for HPE products and services
Go
10
star
80

hpe3par_pstoolkit

The HPE Alletra 9000 and Primera and 3PAR PowerShell Toolkit supports cmdlets, which are wrappers around the native HPE Alletra 9000 or HPE Primera or HPE 3PAR storage CLI commands and Web Services API (WSAPI).
PowerShell
10
star
81

image-streamer-esxi

9
star
82

chef-ilorest-cookbook

Chef cookbook for installing the Python iLOrest library and showcasing a few examples.
Python
9
star
83

GlobalDashboardPS

A Powershell module for working with HPE OneView Global Dashboard
PowerShell
9
star
84

hpe-notebooks

Jupyter Notebook
9
star
85

hpe3par_python_sdk

HPE Alletra 9000 and HPE Primera and HPE 3PAR Software Development Kit for Python
Python
9
star
86

RiscVEdk2

C
9
star
87

HPEDSCC-PowerShell-Toolkit

A PowerShell Toolkit that enables management of a HPE GreenLake DSCC (Data Storage Cloud Console) environment via easy to use PowerShell commands which interface with the publically available RestAPI.
PowerShell
9
star
88

gull

a multi-node fabric-attached memory manager that provides simple abstractions for accessing and allocating NVM from fabric-attached memory
C++
9
star
89

iLOAmpPack-Redfish-API-Docs

iLO Amplifier Pack Redfish API Documentation
JavaScript
8
star
90

python-opsramp

Python binding for the OpsRamp API
Python
8
star
91

ironic-driver-oneview

HPE OneView driver for OpenStack Ironic bare-metal machine provisioning
8
star
92

simplivity-ansible

Ansible Modules for HPE SimpliVity
Python
8
star
93

hpe-nvm

Documentation and utilities for NVDIMM-N device management and support
8
star
94

oneview-puppet

This project is no longer being developed and has limited support. In the near future this repository will be fully deprecated. Please consider using other OneView projects, such as Terraform and Ansible Collection
Ruby
8
star
95

SHARP

Python
7
star
96

devid-provisioning-tool

Go
7
star
97

oneview-ansible-samples

A collection of sample code for oneview-ansible
7
star
98

dc-rl

HTML
7
star
99

KrakenMare

KrakenMare is a containerized software stack providing a versatile data pipeline to monitor HPC clusters using Redfish monitoring information, MQTT and Kafka data buses, druid timeseries DB and Grafana visualization.
Python
7
star
100

simplivity-python

This library provides a Python interface to the HPE SimpliVity REST APIs
Python
7
star