= OCP Client VM (ocp-clientvm)
|
|
This config will deploy a simple RHEL VM to multiple cloud providers.
|
You can choose the cloud provider by passing in the `cloud_provider` var.
|
You can choose the version of RHEL by specifying the `clientvm_instance_image` var.
|
Other things and tools will be installed as well, which may make your life easier.
|
|
== Running Ansible Playbook
|
|
* You can run the playbook with the following arguments to overwrite the default variable values:
|
+
|
[source,bash]
|
----
|
# Generic Vars
|
|
GUID=sborenstest5
|
REGION=ap-southeast-2
|
KEYNAME=ocpkey
|
ENVTYPE="ocp-clientvm"
|
CLOUDPROVIDER=ec2
|
HOSTZONEID='Z3IHLWJZOU9SRT'
|
BASESUFFIX='.example.opentlc.com'
|
|
|
# OCP Vars
|
|
REPO_VERSION=3.11
|
OSRELEASE=3.11.16
|
|
ansible-playbook main.yml \
|
-e "guid=${GUID}" \
|
-e "env_type=${ENVTYPE}" \
|
-e "osrelease=${OSRELEASE}" \
|
-e "repo_version=${REPO_VERSION}" \
|
-e "docker_version=1.13.1" \
|
-e "cloud_provider=${CLOUDPROVIDER}" \
|
-e "aws_region=${REGION}" \
|
-e "HostedZoneId=${HOSTZONEID}" \
|
-e "key_name=${KEYNAME}" \
|
-e "subdomain_base_suffix=${BASESUFFIX}" \
|
-e "clientvm_instance_type=t2.large" \
|
-e "requirements_path=ansible/configs/ocp-clientvm/requirements_ruby.yml" \
|
-e "email=name@example.com" \
|
-e "output_dir=/tmp/output" \
|
-e "install_ruby=true" -e "install_3scale=true" -vvvv
|
----
|
|
=== Satellite version
|
----
|
GUID=testclientvm1
|
REGION=us-east-1
|
KEYNAME=ocpkey
|
ENVTYPE="ocp-clientvm"
|
CLOUDPROVIDER=ec2
|
HOSTZONEID='Z186MFNM7DX4NF'
|
BASESUFFIX='.example.opentlc.com'
|
REPO_VERSION=3.9
|
DEPLOYER_REPO_PATH=`pwd`
|
|
LOG_FILE=/tmp/${ENVTYPE}-${GUID}.log
|
IPAPASS=$5
|
|
if [ "$1" = "provision" ] ; then
|
|
echo "Provisioning: ${STACK_NAME}" 1>> $LOG_FILE 2>> $LOG_FILE
|
|
ansible-playbook ${DEPLOYER_REPO_PATH}/main.yml \
|
-e "guid=${GUID}" \
|
-e "env_type=${ENVTYPE}" \
|
-e "key_name=${KEYNAME}" \
|
-e "cloud_provider=${CLOUDPROVIDER}" \
|
-e "aws_region=${REGION}" \
|
-e "HostedZoneId=${HOSTZONEID}" \
|
-e "subdomain_base_suffix=${BASESUFFIX}" \
|
-e "clientvm_instance_type=t2.large" \
|
-e "ipa_host_password=${IPAPASS}"
|
-e "repo_method=satellite" \
|
-e "repo_version=${REPO_VERSION}" \
|
-e "email=name@example.com" \
|
-e "software_to_deploy=none" \
|
-e "osrelease=3.9.14" \
|
-e "docker_version=1.13.1" \
|
-e "ANSIBLE_REPO_PATH=${DEPLOYER_REPO_PATH}" 1>> $LOG_FILE 2>> $LOG_FILE
|
----
|
|
=== To Delete an environment
|
----
|
REGION=us-east-1
|
KEYNAME=ocpkey
|
GUID=testclientvm1
|
ENVTYPE="ocp-clientvm"
|
CLOUDPROVIDER=ec2
|
HOSTZONEID='Z186MFNM7DX4NF'
|
|
ansible-playbook ./configs/${ENVTYPE}/destroy_env.yml \
|
-e "guid=${GUID}" \
|
-e "env_type=${ENVTYPE}" \
|
-e "cloud_provider=${CLOUDPROVIDER}" \
|
-e "aws_region=${REGION}" \
|
-e "HostedZoneId=${HOSTZONEID}" \
|
-e "key_name=${KEYNAME}" \
|
-e "subdomain_base_suffix=${BASESUFFIX}"
|
----
|
|
|
== Example RC file
|
|
Use a RC file like this one to create a ClientVM with the wrapper.sh script:
|
|
----
|
GUID=myclient
|
REGION=us-east-1
|
KEYNAME=ocpkey
|
ENVTYPE=ocp-clientvm
|
HOSTZONEID='Z3IHLWJZOU9SRT'
|
ENVTYPE_ARGS=(
|
-e repo_version=3.9
|
-e osrelease=3.9.14
|
-e own_repo_path=http://admin.example.com/repos/ocp/3.9.14
|
-e docker_version=1.13.1
|
-e "clientvm_instance_type=t2.large"
|
-e "subdomain_base_suffix=.example.opentlc.com"
|
)
|
----
|