Skip to content
This repository was archived by the owner on Dec 9, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
d6600df
Making providers common
cooktheryan Nov 22, 2016
cbeb117
moving directory locations
cooktheryan Nov 22, 2016
e61e1fe
using links and removal of vars file callout
cooktheryan Nov 22, 2016
ae021ba
rename of file
cooktheryan Dec 8, 2016
4dc7191
went block crazy
cooktheryan Dec 9, 2016
91e1717
cleanup
cooktheryan Dec 14, 2016
e9a1700
add to remove
cooktheryan Jan 9, 2017
120a2cf
adding in these to pull common providers into my master
dav1x Jan 10, 2017
4b56457
merging
dav1x Jan 10, 2017
509503a
merging some conflicts
dav1x Jan 10, 2017
b387fb5
merging ocp-on-vmware.py
dav1x Jan 10, 2017
b35a905
making some changes including removing local rhn_repos and subscripti…
dav1x Jan 10, 2017
2eb877a
Update ocp-on-vmware.ini
dav1x Jan 10, 2017
bcaca38
Update openshift-install.yaml
dav1x Jan 10, 2017
9673681
Update vmware_inventory.ini
dav1x Jan 10, 2017
a32cbd4
Added support for multiple error checks in INI variables
dav1x Jan 10, 2017
9601bd3
Update ocp-on-vmware.ini
dav1x Jan 10, 2017
aaef1d0
adding mods to
dav1x Jan 10, 2017
775fb03
updating roles
dav1x Jan 10, 2017
a77faf3
updating roles
dav1x Jan 10, 2017
e8fcd11
Merge branch 'master' of https://github.com/dav1x/openshift-ansible-c…
dav1x Jan 10, 2017
9951673
Merging install
dav1x Jan 13, 2017
69ef660
Merge branch 'master' of https://github.com/openshift/openshift-ansib…
dav1x Jan 13, 2017
62db90f
Updating with merge
dav1x Jan 13, 2017
6e3330e
Removed rhn local components
dav1x Jan 13, 2017
8f752da
Removed local validate
dav1x Jan 13, 2017
0c4d9fe
removing password and vcenter ip from inventory INI
dav1x Jan 13, 2017
6e5f205
removing password and vcenter ip from pytrhon INI
dav1x Jan 13, 2017
2ec7f70
Update main.yaml
cooktheryan Jan 13, 2017
9d96d4b
Merge branch 'master' of https://github.com/openshift/openshift-ansib…
dav1x Jan 16, 2017
a4bbcbe
Merge branch 'master' of https://github.com/dav1x/openshift-ansible-c…
dav1x Jan 16, 2017
9f1f0f3
Adding vmware_guest to repo
dav1x Jan 16, 2017
fe6fc59
Removed roles and added datacenter and netmask options
dav1x Jan 17, 2017
3a969b7
Added registry modification
dav1x Jan 17, 2017
8d438bf
Merge branch 'master' of https://github.com/openshift/openshift-ansib…
dav1x Jan 17, 2017
d7d7feb
Update setup_ansible.sh
cooktheryan Jan 18, 2017
48a43b2
moved things around for consistency with aws and removed vm_interface…
dav1x Jan 18, 2017
1986f25
mend
dav1x Jan 18, 2017
0dd0927
mend
dav1x Jan 18, 2017
c5bd78a
Merge branch 'master' of https://github.com/openshift/openshift-ansib…
dav1x Jan 18, 2017
73e2435
mend
dav1x Jan 18, 2017
d28165d
Update main.yaml
dav1x Jan 18, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 0 additions & 71 deletions reference-architecture/vmware-ansible/Makefile

This file was deleted.

114 changes: 94 additions & 20 deletions reference-architecture/vmware-ansible/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,16 @@ rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm*
yum -y install atomic-openshift-utils \
git \
pyOpenSSL \
python-simplejson \
PyYAML \
python-ldap \
python-click \
python-httplib2
python-iptools \
python-ldap \
python-netaddr \
python-httplib2
git clone https://github.com/dannvix/pySphere && cd pySphere/ && python setup.py install
git clone https://github.com/vmware/pyvmomi && cd pyvmomi/ && python setup.py install
python-simplejson \
python-six \

# Grabbed the patched vsphere_guest until the PR is merged
cp vsphere_guest.py /usr/lib/python2.7/site-packages/ansible/modules/core/cloud/vmware/
git clone https://github.com/vmware/pyvmomi && cd pyvmomi/ && python setup.py install

```

Expand All @@ -53,11 +51,49 @@ This is your VMware template name. The template should be configured with open-v
### New VMware Environment (Greenfield)
When installing all components into your VMware environment perform the following. This will create the haproxy, the nfs server for the registry, and all the production OpenShift VMs. Additionally, the installer script will attempt to copy your existing public key to the VMs.
```
~/git/openshift-ansible-contrib/reference-architecture/vmware-ansible/ocp-on-vmware.py \
--vcenter_host=vcenter.example.com --vcenter_password=password \
--rhsm_user=rhnuser --rhsm_password=password \
--vm_dns=10.19.114.5 --vm_gw=10.19.114.1 --vm_interface_name=eth0 \
--public_hosted_zone=example.com
$ cd ~/git/openshift-ansible-contrib/reference-architecture/vmware-ansible/

$ vim /home/<user>/git/openshift-ansible-contrib/reference-architecture/vmware-ansible/ocp-on-vmware.ini

[vmware]
# console port and install type for OpenShift
console_port=8443
deployment_type=openshift-enterprise

# vCenter host address/username and password
vcenter_host=myvcenter.example.com
vcenter_username=administrator@vsphere.local
vcenter_password=password

... ommitted ...

./ocp-on-vmware.py \

Configured values:
console port: 8443
deployment_type: openshift-enterprise
vcenter_host: 10.x.x.25
vcenter_username: administrator@vsphere.local
vcenter_password: *******
vcenter_template_name: ocp-server-template-2.0.2
vcenter_folder: ocp
vcenter_cluster: devel
vcenter_datacenter: Boston
vcenter_resource_pool: OCP3
public_hosted_zone: vcenter.example.com
app_dns_prefix: apps
vm_dns: 10.x.x.5
vm_gw: 10.x.x.254
vm_netmask: 255.255.255.0
byo_lb: no
lb_host: haproxy-0.vcenter.example.com
byo_nfs: no
nfs_registry_host: nfs-0.vcenter.example.com
nfs_registry_mountpoint: /registry
apps_dns: apps.vcenter.example.com
Using values from: ./ocp-on-vmware.ini

Continue using these values? [y/N]:
```

### Existing VM Environment and Deployment (Brownfield)
Expand All @@ -79,12 +115,50 @@ The ocp-configure will configured your persistent registry and scale your nodes.
Notice in the instance below we are supplying our own external NFS server and load balancer.

```
~/git/openshift-ansible-contrib/reference-architecture/vmware-ansible/ocp-on-vmware.py \
--vcenter_host=vcenter.example.com --vcenter_password=password \
--rhsm_activation_key=my_sat6_key --rhsm_org_id=Default_Organization \
--vm_dns=10.19.114.5 --vm_gw=10.19.114.1 --vm_interface_name=eth0 \
--byo_lb=yes --lb_fqdn=loadbalancer.example.com \
--byo_nfs=yes --nfs_registry_host=nfs.example.com --nfs_registry_mountpoint=/nfs-registry \
--public_hosted_zone=vcenter.e2e.bos.redhat.com \
--tag ocp-install,ocp-configure
$ cd ~/git/openshift-ansible-contrib/reference-architecture/vmware-ansible/

$ vim /home/<user>/git/openshift-ansible-contrib/reference-architecture/vmware-ansible/ocp-on-vmware.ini

... content abbreviated ...

# bringing your own load balancer?
byo_lb=yes
lb_host=my-load-balancer.lb.example.com

# bringing your own NFS server for registry?
byo_nfs=yes
nfs_registry_host=my-nfs-server.nfs.example.com
nfs_registry_mountpoint=/my-registry

... content abbreviated ...

./ocp-on-vmware.py* \
*--tag ocp-install,ocp-configure*

Configured values:
console port: 8443
deployment_type: openshift-enterprise
vcenter_host: 10.19.114.25
vcenter_username: administrator@vsphere.local
vcenter_password: *******
vcenter_template_name: ocp-server-template-2.0.2
vcenter_folder: ocp
vcenter_cluster: devel
vcenter_datacenter: Boston
vcenter_resource_pool: OCP3
public_hosted_zone: vcenter.e2e.bos.redhat.com
app_dns_prefix: apps
vm_dns: 10.19.114.5
vm_gw: 10.19.115.254
vm_netmask: 255.255.254.0
byo_lb: yes
lb_host: my-load-balancer.lb.example.com
byo_nfs: yes
nfs_registry_host: my-nfs-server.nfs.example.com
nfs_registry_mountpoint: /my-registry
apps_dns: apps.vcenter.e2e.bos.redhat.com
Using values from: ./ocp-on-vmware.ini

Continue using these values? [y/N]:

```
20 changes: 0 additions & 20 deletions reference-architecture/vmware-ansible/infrastructure.yaml

This file was deleted.

6 changes: 4 additions & 2 deletions reference-architecture/vmware-ansible/ocp-on-vmware.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ vcenter_template_name=ocp-server-template-2.0.2
# folder/cluster/resource pool in vCenter to organize VMs
vcenter_folder=ocp
vcenter_cluster=
vcenter_resource_pool=/Resources/OCP3
vcenter_resource_pool=OCP3
vcenter_datacenter=

# DNS zone where everything will be hosted and app wildcard prefix
public_hosted_zone=
Expand All @@ -23,7 +24,8 @@ app_dns_prefix=apps
# DNS/gateway/interface name the OpenShift nodes should utilize
vm_dns=
vm_gw=
vm_interface_name=eno16780032
vm_netmask=
vm_network="VM Network"

# red hat subscription name and password
rhsm_user=
Expand Down
34 changes: 25 additions & 9 deletions reference-architecture/vmware-ansible/ocp-on-vmware.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
@click.option('--create_inventory', is_flag=True, help='Helper script to create json inventory file and exit')
@click.option('--create_ocp_vars', is_flag=True, help='Helper script to modify OpenShift ansible install variables and exit')
@click.option('-t', '--tag', help='Ansible playbook tag for specific parts of playbook: valid targets are nfs, prod, haproxy, ocp-inbstall, ocp-configure, ocp-demo or clean')
@click.option('--clean', is_flag=True, help='Delete all nodes and unregister from RHN')

def launch_refarch_env(console_port=8443,
deployment_type=None,
Expand All @@ -22,12 +23,14 @@ def launch_refarch_env(console_port=8443,
vcenter_template_name=None,
vcenter_folder=None,
vcenter_cluster=None,
vcenter_datacenter=None,
vcenter_resource_pool=None,
public_hosted_zone=None,
app_dns_prefix=None,
vm_dns=None,
vm_gw=None,
vm_interface_name=None,
vm_netmask=None,
vm_network=None,
rhsm_user=None,
rhsm_password=None,
rhsm_activation_key=None,
Expand All @@ -50,7 +53,8 @@ def launch_refarch_env(console_port=8443,
create_ocp_vars=None,
ldap_user=None,
ldap_user_password=None,
ldap_fqdn=None):
ldap_fqdn=None,
clean=None):

# Open config file INI for values first
scriptbasename = __file__
Expand All @@ -66,12 +70,14 @@ def launch_refarch_env(console_port=8443,
'vcenter_template_name':'ocp-server-template-2.0.2',
'vcenter_folder':'ocp',
'vcenter_cluster':'devel',
'vcenter_cluster':'',
'vcenter_resource_pool':'/Resources/OCP3',
'public_hosted_zone':'',
'app_dns_prefix':'apps',
'vm_dns':'',
'vm_gw':'',
'vm_interface_name':'eno16780032',
'vm_netmask':'',
'vm_network':'VM Network',
'rhsm_user':'',
'rhsm_password':'',
'rhsm_activation_key':'',
Expand Down Expand Up @@ -114,12 +120,14 @@ def launch_refarch_env(console_port=8443,
vcenter_template_name = config.get('vmware', 'vcenter_template_name')
vcenter_folder = config.get('vmware', 'vcenter_folder')
vcenter_cluster = config.get('vmware', 'vcenter_cluster')
vcenter_datacenter = config.get('vmware', 'vcenter_datacenter')
vcenter_resource_pool = config.get('vmware', 'vcenter_resource_pool')
public_hosted_zone= config.get('vmware', 'public_hosted_zone')
app_dns_prefix = config.get('vmware', 'app_dns_prefix')
vm_dns = config.get('vmware', 'vm_dns')
vm_gw = config.get('vmware', 'vm_gw')
vm_interface_name = config.get('vmware', 'vm_interface_name')
vm_netmask = config.get('vmware', 'vm_netmask')
vm_network = config.get('vmware', 'vm_network')
rhsm_user = config.get('vmware', 'rhsm_user')
rhsm_password = config.get('vmware', 'rhsm_password')
rhsm_activation_key = config.get('vmware', 'rhsm_activation_key')
Expand All @@ -140,7 +148,7 @@ def launch_refarch_env(console_port=8443,
ldap_fqdn = config.get('vmware', 'ldap_fqdn')

err_count = 0
required_vars = {'public_hosted_zone':public_hosted_zone, 'vcenter_host':vcenter_host, 'vcenter_password':vcenter_password, 'vm_ipaddr_start':vm_ipaddr_start, 'ldap_fqdn':ldap_fqdn, 'ldap_user_password':ldap_user_password, 'vm_dns':vm_dns, 'vm_gw':vm_gw}
required_vars = {'public_hosted_zone':public_hosted_zone, 'vcenter_host':vcenter_host, 'vcenter_password':vcenter_password, 'vm_ipaddr_start':vm_ipaddr_start, 'ldap_fqdn':ldap_fqdn, 'ldap_user_password':ldap_user_password, 'vm_dns':vm_dns, 'vm_gw':vm_gw, 'vm_netmask':vm_netmask, 'vcenter_datacenter':vcenter_datacenter}
for k, v in required_vars.items():
if v == '':
err_count += 1
Expand Down Expand Up @@ -375,12 +383,14 @@ def launch_refarch_env(console_port=8443,
click.echo('\tvcenter_template_name: %s' % vcenter_template_name)
click.echo('\tvcenter_folder: %s' % vcenter_folder)
click.echo('\tvcenter_cluster: %s' % vcenter_cluster)
click.echo('\tvcenter_datacenter: %s' % vcenter_datacenter)
click.echo('\tvcenter_resource_pool: %s' % vcenter_resource_pool)
click.echo('\tpublic_hosted_zone: %s' % public_hosted_zone)
click.echo('\tapp_dns_prefix: %s' % app_dns_prefix)
click.echo('\tvm_dns: %s' % vm_dns)
click.echo('\tvm_gw: %s' % vm_gw)
click.echo('\tvm_interface_name: %s' % vm_interface_name)
click.echo('\tvm_netmask: %s' % vm_netmask)
click.echo('\tvm_network: %s' % vm_network)

if rhsm_user != '' and tag:
click.echo('\trhsm_user: %s' % rhsm_user)
Expand Down Expand Up @@ -419,7 +429,7 @@ def launch_refarch_env(console_port=8443,
else:
print line,

playbooks = ['infrastructure.yaml']
playbooks = ['playbooks/infrastructure.yaml']
tags.append('ocp-install')
tags.append('ocp-configure')

Expand All @@ -438,6 +448,8 @@ def launch_refarch_env(console_port=8443,
command='rm -rf .ansible/cached_facts'
os.system(command)
tags = ",".join(tags)
if clean is True:
tags = 'clean'
if tag:
tags = tag

Expand All @@ -452,12 +464,14 @@ def launch_refarch_env(console_port=8443,
vcenter_template_name=%s \
vcenter_folder=%s \
vcenter_cluster=%s \
vcenter_datacenter=%s \
vcenter_resource_pool=%s \
public_hosted_zone=%s \
app_dns_prefix=%s \
vm_dns=%s \
vm_gw=%s \
vm_interface_name=%s \
vm_netmask=%s \
vm_network=%s \
wildcard_zone=%s \
console_port=%s \
deployment_type=%s \
Expand All @@ -475,12 +489,14 @@ def launch_refarch_env(console_port=8443,
vcenter_template_name,
vcenter_folder,
vcenter_cluster,
vcenter_datacenter,
vcenter_resource_pool,
public_hosted_zone,
app_dns_prefix,
vm_dns,
vm_gw,
vm_interface_name,
vm_netmask,
vm_network,
wildcard_zone,
console_port,
deployment_type,
Expand Down
Loading