-
-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Completed the of the platform, all that is left is the public DNS for…
… the router.
- Loading branch information
Showing
14 changed files
with
1,036 additions
and
264 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
# Infrastructure ignores. | ||
.terraform | ||
terraform.tfvars |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
# Fail on errors. | ||
set -x | ||
|
||
# Elevate priviledges, retaining the environment. | ||
sudo -E su | ||
|
||
# Install dev tools and Ansible 2.2 | ||
yum install -y "@Development Tools" python2-pip openssl-devel python-devel gcc libffi-devel | ||
pip install -Iv ansible==2.2.0.0 | ||
|
||
# Clone the openshift-ansible repo, which contains the installer. | ||
git clone https://github.com/openshift/openshift-ansible | ||
cd openshift-ansible | ||
|
||
# Create our Ansible inventory: | ||
mkdir -p /etc/ansible | ||
cat > /etc/ansible/hosts <<- EOF | ||
# Create an OSEv3 group that contains the masters and nodes groups | ||
[OSEv3:children] | ||
masters | ||
nodes | ||
# 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=ec2-user | ||
# If ansible_ssh_user is not root, ansible_become must be set to true | ||
ansible_become=true | ||
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'}] | ||
# Create the masters host group. Be explicit with the openshift_hostname, | ||
# otherwise it will resolve to something like ip-10-0-1-98.ec2.internal and use | ||
# that as the node name. | ||
[masters] | ||
master.openshift.local openshift_hostname=master.openshift.local | ||
# host group for etcd | ||
[etcd] | ||
master.openshift.local | ||
# host group for nodes, includes region info | ||
[nodes] | ||
master.openshift.local openshift_node_labels="{'region': 'infra', 'zone': 'default'}" openshift_schedulable=true | ||
node1.openshift.local openshift_hostname=node1.openshift.local openshift_node_labels="{'region': 'primary', 'zone': 'east'}" | ||
node2.openshift.local openshift_hostname=node2.openshift.local openshift_node_labels="{'region': 'primary', 'zone': 'west'}" | ||
EOF | ||
|
||
# Run the playbook. | ||
ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook playbooks/byo/config.yml | ||
|
||
ansible-playbook playbooks/adhoc/uninstall.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Create a role which OpenShift instances will assume. | ||
// This role has a policy saying it can be assumed by ec2 | ||
// instances. | ||
resource "aws_iam_role" "openshift-instance-role" { | ||
name = "openshift-instance-role" | ||
|
||
assume_role_policy = <<EOF | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Action": "sts:AssumeRole", | ||
"Principal": { | ||
"Service": "ec2.amazonaws.com" | ||
}, | ||
"Effect": "Allow", | ||
"Sid": "" | ||
} | ||
] | ||
} | ||
EOF | ||
} | ||
|
||
// This policy allows an instance to forward logs to CloudWatch, and | ||
// create the Log Stream or Log Group if it doesn't exist. | ||
resource "aws_iam_policy" "openshift-policy-forward-logs" { | ||
name = "openshift-instance-forward-logs" | ||
path = "/" | ||
description = "Allows an instance to forward logs to CloudWatch" | ||
|
||
policy = <<EOF | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Action": [ | ||
"logs:CreateLogGroup", | ||
"logs:CreateLogStream", | ||
"logs:PutLogEvents", | ||
"logs:DescribeLogStreams" | ||
], | ||
"Resource": [ | ||
"arn:aws:logs:*:*:*" | ||
] | ||
} | ||
] | ||
} | ||
EOF | ||
} | ||
|
||
|
||
// Attach the policies to the role. | ||
resource "aws_iam_policy_attachment" "openshift-attachment-forward-logs" { | ||
name = "openshift-attachment-forward-logs" | ||
roles = ["${aws_iam_role.openshift-instance-role.name}"] | ||
policy_arn = "${aws_iam_policy.openshift-policy-forward-logs.arn}" | ||
} | ||
|
||
// Create a instance profile for the role. | ||
resource "aws_iam_instance_profile" "openshift-instance-profile" { | ||
name = "openshift-instance-profile" | ||
roles = ["${aws_iam_role.openshift-instance-role.name}"] | ||
} |
Oops, something went wrong.