TBD
- Python2.7
- Python-pip package manager
- virtualenv
- HPE OneView SDK for Python and the corresponding config.json
- Anbile for OneView SetupAnbile for OneView Setup and the corresponding oneview_config.json
NOTE: According to the Control Machine Requirements section in the Ansible documentation, Window is not supported for Ansible.
It's recommended to spin up a Python virutal environment and install the Python package there, so the setup won't pollute the global space. The following commands creates and starts a Python 2.7 virutal environment, named ansible-env-python27, with virutalenv:
$ virtualenv --python=/usr/bin/python ansible-env-python27
$ source project-env/bin/activate
Install Python packages listed in requirements.txt:
(ansible-env-python27)$ pip install -r requirements.txt
NOTE: Both Python and Python-pip can be installed from the Linux OS pakcage manager, such as apt-get and yum. Virtualenv can be installed from Pip.
Set environment variables for OneView:
(ansible-env-python27)$ export ONEVIEWSDK_IP="10.1.0.1"
(ansible-env-python27)$ export ONEVIEWSDK_USERNAME='admin123'
(ansible-env-python27)$ export ONEVIEWSDK_PASSWORD='Password123'
(ansible-env-python27)$ export ONEVIEWSDK_API_VERSION=800
Modify the data fields in settings.csv to match to your target ESXi host, and to your target OneView environment. These pertain to setting up the target server profile with a server profile template, a server hardware, and an OS deployment plan with custom attributes.
NOTE: ESXi host requires the network_set_name, connectionid, and serverhardware.
When ready, run the ov_create_custome_server_profile.yml playbook. The -vvv flag enables the verbose mode.
(ansible-env-python27)$ ansible-playbook ov_create_custome_server_profile.yml -vvv
A successful run returns a changed=1 in PLAY RECAP.
PLAY RECAP **************************************************************************************
*localhost: ok=5 changed=1 unreachable=0 failed=0 skipped=0 rescued=0 ignored=0