Skip to content

Commit

Permalink
Merge pull request #2 from ikke-t/3.5-bu-workshop-ikke
Browse files Browse the repository at this point in the history
3.5 bu workshop ikke
  • Loading branch information
thoraxe authored Jul 13, 2017
2 parents 55e1f06 + f7ade19 commit 6018306
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 15 deletions.
9 changes: 3 additions & 6 deletions Preparing_your_workstation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,10 @@ virtualenv](https://pypi.python.org/pypi/virtualenv) can also work.
----
# Install basic packages
yum install -y wget python python-boto unzip tmux git
# Another option to configure python boto is:
git clone git://github.com/boto/boto.git
cd boto
python setup.py install
yum install -y wget python python-pip unzip tmux git
# Install boto libraries for AWS access
pip install boto botocore boto3
# Enable epel repositories for Ansible
cd /tmp
Expand Down
39 changes: 35 additions & 4 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,30 @@ There are several prerequisites for using this repository, scripted and detailed
- [awscli bundle](https://s3.amazonaws.com/aws-cli/awscli-bundle.zip) tested
with version 1.11.32

== Change variables

There are some variables that you need to set:

.file: `ansible/configs/bu-workshop/env_vars.yml`:
- `hosted_zone_id`
- `repo_method: "rhn"` in case you don't provide direct repo files
- `env_authorized_key`
- `subdomain_base_suffix`
- `key_name`
- `admin_user_password` OpenShift admin password

.file: `ansible/inventory/ec2.ini`:
- `regions=` for dynamic inventory to find your desired region

.file: `Ansible/configs/bu-workshop/env_secret_vars.yml`:
- self explanatory, take a look and set them all.

There are some tunables to size your cluster:

.file: `ansible/configs/bu-workshop/env_vars.yml`:
- `num_nodes`
- `user_vols`
- `user_vols_size`

== Standard Configurations

Expand All @@ -38,8 +62,9 @@ There are several prerequisites for using this repository, scripted and detailed
well.

NOTE: Until we implement using Ansible Vault, each "Config" has two vars files
`_vars` and `_secret_vars`. The `example_secret_vars` file shows the format for
what to put in your `CONFIGNAME_secret_vars` file.
`env_vars.yml` and `env_secret_vars.yml`.
link:./example_secret_vars.yml[example_secret_vars.yml] file shows the format
for what to put in your `CONFIGNAME/env_secret_vars.yml` file.


== Running the Ansible Playbooks
Expand All @@ -48,8 +73,14 @@ Once you have installed your prerequisites and have configured all settings and
files, simply run Ansible like so:

----
ansible-playbook -i 127.0.0.1 ansible/main.yml -e "env_type=config-name" -e "aws_region=ap-southeast-2" -e "guid=youruniqueidentifier"
ansible-playbook -i $PWD/ansible/inventory/ec2.py ansible/main.yml \
-e "env_type=config-name" \
-e "aws_region=ap-southeast-2" \
-e "guid=youruniqueidentifier" \
-e "cloud_provider=ec2" \
-e "software_to_deploy=openshift" \
-e num_nodes=4 \
-e ANSIBLE_REPO_PATH=$PWD/ansible
----

NOTE: Be sure to exchange `guid` for a sensible prefix of your choosing.
Expand Down
11 changes: 7 additions & 4 deletions ansible/configs/bu-workshop/env_vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ ansible_ssh_user: "ec2-user"
remote_user: "ec2-user"
use_internal_dns_zone: false
deploy_openshift: true
# Desired openshift admin password
admin_user_password: "openshift"
install_nfs: true
update_packages: false
install_bastion: true
Expand All @@ -12,8 +14,8 @@ install_common: true
hosted_zone_id: "Z226QCZPDICGRI"
repo_method: "file"
use_own_key: true
env_authorized_key: "roadshow"
set_env_authorized_key: false
env_authorized_key: "roadshow" # this is for additional key into cluster
set_env_authorized_key: false # controls whether to insert it or not.
tower_run: false
workshopper_tag: "0.1"
install_ipa_client: false
Expand Down Expand Up @@ -143,7 +145,8 @@ master_instance_type: "m4.xlarge"
infranode_instance_type: "m4.4xlarge"
node_instance_type: "m4.xlarge"
num_nodes: 24
# make sure you save private key with suffix .ssh/<key>.pem
# without .pem it won't get found. Also ensure key is in ssh-agent or
# set as default key: ln -s <key>.pem ~/.ssh/id_rsa
key_name: "roadshow"

cf_template_description: "{{ env_type }}-{{ guid }} template"

8 changes: 7 additions & 1 deletion ansible/configs/bu-workshop/post_software.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,17 @@
- workshop
- workshop_admins
tasks:
- name: check admin password is set
fail: msg="Bailing out. You need to set 'admin_user_password'"
when: admin_user_password is undefined
- name: check admin password is not empty string
fail: msg="Bailing out. 'admin_user_password' can not be empty string"
when: admin_user_password == ""
- name: Add administrative user to htpasswd file
htpasswd:
dest: "/etc/origin/master/htpasswd"
name: "admin"
password: "openshift3"
password: "{{ admin_user_password }}"
state: present

- name: Give administrative user cluster-admin privileges
Expand Down
9 changes: 9 additions & 0 deletions example_secret_vars.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## Logon credentials for Red Hat Network
# ## Required if using the subscription component
# ## of this playbook.
rhel_subscription_user: ''
rhel_subscription_pass: ''
#
# ## AWS Credentials. This is required.
aws_access_key_id: ""
aws_secret_access_key: ""

0 comments on commit 6018306

Please sign in to comment.