Clone the openshift-ansible repo, check out the 3.9 branch.
# git clone https://github.com/openshift/openshift-ansible.git
# cd openshift-ansible
# git checkout release-3.9
Create an inventory, I'm calling it 2-node.yml
, with contents like these, substituting your correct master and node hostnames:
# Create an OSEv3 group that contains the masters, nodes, and etcd groups
[OSEv3:children]
masters
nodes
etcd
# Set variables common for all OSEv3 hosts
[OSEv3:vars]
# SSH user, this user should allow ssh based auth without requiring a password
ansible_ssh_user=root
# If ansible_ssh_user is not root, ansible_become must be set to true
#ansible_become=true
openshift_deployment_type=origin
# uncomment the following to enable htpasswd authentication; defaults to DenyAllPasswordIdentityProvider
openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider', 'filename': '/etc/origin/master/htpasswd'}]
# this will create admin/OriginAdmin, and user/OriginUser
openshift_master_htpasswd_users={'admin': '$apr1$zgSjCrLt$1KSuj66CggeWSv.D.BXOA1', 'user': '$apr1$.gw8w9i1$ln9bfTRiD6OwuNTG5LvW50'}
# host group for masters
[masters]
master.example.com
# host group for etcd
[etcd]
master.example.com
# host group for nodes, includes region info
[nodes]
master.example.com openshift_node_labels="{'region': 'infra', 'zone': 'default'}"
node.example.com openshift_node_labels="{'region': 'primary', 'zone': 'default'}"
Run the prereq playbook, and then run the deploy playbook, and then make your admin user the cluster admin:
# ansible-playbook -i 2-node.yml playbooks/prerequisites.yml
# ansible-playbook -i 2-node.yml playbooks/deploy_cluster.yml
# ansible -i 2-node.yml masters -a 'oadm policy add-cluster-role-to-user cluster-admin admin'
You should be able to log in at https://master.example.com:8443/console
.