Skip to content

Instantly share code, notes, and snippets.

@waynedovey
Created February 19, 2018 23:00
Show Gist options
  • Save waynedovey/77909a364ac825d8d258f07be78d1ffe to your computer and use it in GitHub Desktop.
Save waynedovey/77909a364ac825d8d258f07be78d1ffe to your computer and use it in GitHub Desktop.
Cloudforms - OpenShift - API
CLOUDFORMS_URL="cloudforms.console.com"
CLOUDFORMS_PASSWORD="xxxxx"
CLOUDFORMS_TOKEN=`oc sa get-token -n management-infra management-admin`
CLOUDFORMS_GUID=`echo $GUID | awk '{print toupper($0)}'`
PUBLIC_MASTER_DNS=openshift.console.com
cat > /tmp/cloudforms.yaml << EOF
---
- hosts: all
environment:
no_proxy: ${CLOUDFORMS_URL}
tasks:
- name: Create a new provider in CFME
manageiq_provider:
name: '${CLOUDFORMS_GUID}'
type: 'Openshift'
provider:
auth_key: '${CLOUDFORMS_TOKEN}'
hostname: '${PUBLIC_MASTER_DNS}'
port: 8443
verify_ssl: False
#metrics:
# hostname: 'next.example.com'
# port: 443
# verify_ssl: False
manageiq_connection:
url: 'https://${CLOUDFORMS_URL}'
username: 'admin'
password: '${CLOUDFORMS_PASSWORD}'
verify_ssl: False
EOF
ansible-playbook -i "localhost," -c local cloudforms.yaml
Ansible Module
pip install git+https://github.com/ManageIQ/manageiq-api-client-python.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment