Skip to content

Commit

Permalink
Handful of patches to make openshift install at environment
Browse files Browse the repository at this point in the history
One of the patches
kubernetes-retired/kube-aws#604

Add no proxy
  • Loading branch information
Joel Pearson authored and Joel Pearson committed Jan 31, 2018
1 parent 1824341 commit 45ced08
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 7 deletions.
5 changes: 3 additions & 2 deletions reference-architecture/aws-ansible/ansible.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
forks = 50
host_key_checking = False
inventory = inventory/aws/hosts/ec2.py
roles_path = /usr/share/ansible/openshift-ansible/roles:/opt/ansible/roles:./roles:../../roles
roles_path = /usr/share/ansible/openshift-ansible/roles:/opt/ansible/roles:./roles:../../roles:playbooks/roles
remote_user = ec2-user
ansible_user = ec2-user
gathering = smart
retry_files_enabled = false
nocows = true
timeout = 90
#lookup_plugins = ./playbooks/lookup_plugins
#log_path = /tmp/ansible.log
log_path = /tmp/ansible.log

[privilege_escalation]
become = True
Expand Down
22 changes: 22 additions & 0 deletions reference-architecture/aws-ansible/inventory/aws/hosts/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -1496,10 +1496,32 @@ def to_safe(self, word):
regex += "\-"
return re.sub(regex + "]", "_", word)

def atoi(self, text):
return int(text) if text.isdigit() else text

def natural_keys(self, text):
'''
alist.sort(key=natural_keys) sorts in human order
http://nedbatchelder.com/blog/200712/human_sorting.html
(See Toothy's implementation in the comments)
'''
return [ self.atoi(c) for c in re.split('(\d+)', text) ]


def sortValues(self, od):
for k, v in od.items():
if isinstance(v, dict):
self.sortValues(v)
elif isinstance(v, list):
# Use natural ordering so that ip address hostnames sort properly
v.sort(key=self.natural_keys)

def json_format_dict(self, data, pretty=False):
''' Converts a dict to a JSON object and dumps it as a formatted
string '''

# Maintain consistent ordering, to prevent ordering of hosts changing where possible
self.sortValues(data)
if pretty:
return json.dumps(data, sort_keys=True, indent=2)
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,7 @@
"Protocol": "TCP"
}
],
"Scheme": "internal",
"SecurityGroups": [{"Ref": "MasterExtElbSG"}],
"Subnets": [
{"Ref": "PublicSubnet1"},
Expand Down Expand Up @@ -617,6 +618,7 @@
"Protocol": "TCP"
}
],
"Scheme": "internal",
"SecurityGroups": [ { "Ref": "InfraElbSG" } ],
"Subnets": [
{"Ref": "PublicSubnet1"},
Expand Down Expand Up @@ -751,7 +753,7 @@
"Type": "A",
"AliasTarget": {
"HostedZoneId": { "Fn::GetAtt" : ["MasterExtElb", "CanonicalHostedZoneNameID"] },
"DNSName": { "Fn::GetAtt" : ["MasterExtElb","CanonicalHostedZoneName"] }
"DNSName": { "Fn::GetAtt" : ["MasterExtElb","DNSName"] }
}
},
{
Expand All @@ -767,7 +769,7 @@
"Type": "A",
"AliasTarget": {
"HostedZoneId": { "Fn::GetAtt" : ["InfraElb", "CanonicalHostedZoneNameID"] },
"DNSName": { "Fn::GetAtt" : ["InfraElb","CanonicalHostedZoneName"] }
"DNSName": { "Fn::GetAtt" : ["InfraElb","DNSName"] }
}
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
Route53HostedZone: "{{ public_hosted_zone }}."
PublicHostedZone: "{{ public_hosted_zone }}"
MasterApiPort: "{{ console_port }}"
MasterHealthTarget: "TCP:{{ console_port }}"
MasterHealthTarget: "SSL:{{ console_port }}"
MasterClusterHostname: "{{ openshift_master_cluster_hostname }}"
MasterClusterPublicHostname: "{{ openshift_master_cluster_public_hostname }}"
AppWildcardDomain: "*.{{ wildcard_zone }}"
Expand Down Expand Up @@ -68,7 +68,7 @@
Route53HostedZone: "{{ public_hosted_zone }}."
PublicHostedZone: "{{ public_hosted_zone }}"
MasterApiPort: "{{ console_port }}"
MasterHealthTarget: "TCP:{{ console_port }}"
MasterHealthTarget: "SSL:{{ console_port }}"
MasterClusterHostname: "{{ openshift_master_cluster_hostname }}"
MasterClusterPublicHostname: "{{ openshift_master_cluster_public_hostname }}"
AppWildcardDomain: "*.{{ wildcard_zone }}"
Expand Down Expand Up @@ -125,7 +125,7 @@
Route53HostedZone: "{{ public_hosted_zone }}."
PublicHostedZone: "{{ public_hosted_zone }}"
MasterApiPort: "{{ console_port }}"
MasterHealthTarget: "TCP:{{ console_port }}"
MasterHealthTarget: "SSL:{{ console_port }}"
MasterClusterHostname: "{{ openshift_master_cluster_hostname }}"
MasterClusterPublicHostname: "{{ openshift_master_cluster_public_hostname }}"
AppWildcardDomain: "*.{{ wildcard_zone }}"
Expand Down

0 comments on commit 45ced08

Please sign in to comment.