How to install Openshift Origin All-In-One-Server with Ansible

1. Install CentOS

2. Install dependencies

yum install -y epel-release
yum install -y ansible python-cryptography python-crypto pyOpenSSL git docker

3. Install Openshift Ansible

git clone https://github.com/openshift/openshift-ansible

4. Create a new docker volume

Follow this tutorial: http://kumar-pravin.blogspot.de/2015/10/setting-up-storage-to-make-docker.html

5. Create Hosts file

Create the following file `vi openshift-hosts` and paste the following content:

[OSEv3:children]
masters
nodes
etcd
nfs

[OSEv3:vars]
ansible_ssh_user=root
deployment_type=origin
openshift_release=1.5.1
openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider', 'filename': '/etc/origin/master/htpasswd'}]
openshift_master_htpasswd_users={'admin': 'HASHEDPASSWORDHERE'}
openshift_docker_disable_push_dockerhub=True
openshift_master_default_subdomain=os.localdomain
osm_default_node_selector='region=primary'
osn_storage_plugin_deps=['nfs']
openshift_hosted_router_selector='region=primary'
openshift_hosted_registry_selector='region=primary'
openshift_override_hostname_check=false

openshift_hosted_metrics_storage_kind=nfs
openshift_hosted_metrics_storage_access_modes=['ReadWriteOnce']
openshift_hosted_metrics_storage_nfs_directory=/exports
openshift_hosted_metrics_storage_nfs_options='*(rw,root_squash)'
openshift_hosted_metrics_storage_volume_name=metrics
openshift_hosted_metrics_storage_volume_size=40Gi

[masters]
os-master1

[etcd]
os-master1

[nfs]
os-master1

[nodes]
os-master1 openshift_node_labels="{'region': 'primary', 'zone': 'default'}" openshift_schedulable=True

6. Create SSH key and upload add it to your known_hosts file

The next step is to enable SSH. Therefore, execute the following commands

ssh-keygen -t rsa -b 4096 -C "root@YOUR_SERVER.de"
ssh-copy-id root@YOUR_SERVER_IP

7. Install Openshift

cd openshift-ansible
ansible-playbook -i ../openshift-hosts playbooks/byo/config.yml

 

Leave a Reply

Your email address will not be published. Required fields are marked *