From 2ace513cdb34551145c59d2724866c52eb629874 Mon Sep 17 00:00:00 2001 From: Eduardo Lopez Date: Wed, 17 Oct 2018 16:26:20 -0700 Subject: [PATCH] [breaking] remove blessconfig script (#172) --- templates/repo/scripts/bless_ssh_config.rm | 0 templates/repo/scripts/bless_ssh_config.tmpl | 50 -------------------- 2 files changed, 50 deletions(-) create mode 100755 templates/repo/scripts/bless_ssh_config.rm delete mode 100755 templates/repo/scripts/bless_ssh_config.tmpl diff --git a/templates/repo/scripts/bless_ssh_config.rm b/templates/repo/scripts/bless_ssh_config.rm new file mode 100755 index 000000000..e69de29bb diff --git a/templates/repo/scripts/bless_ssh_config.tmpl b/templates/repo/scripts/bless_ssh_config.tmpl deleted file mode 100755 index 8dc29ddb3..000000000 --- a/templates/repo/scripts/bless_ssh_config.tmpl +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/env ruby - -# Auto-generated by fogg. Do not edit -# Make improvements in fogg, so that everyone can benefit. - -require 'json' -require 'pp' - -puts "What is the absolute path to your blessclient?" -blessclientPath = gets.chomp - -puts "What remote user are you using?" -remoteUser = gets.chomp - -ENVS = %w[{{ .Envs | dict | keys | sortAlpha | join " "}}] - -d = ENVS.map do |env| - `cd terraform/envs/#{env}/cloud-env && make init` - outputs = `cd terraform/envs/#{env}/cloud-env && terraform output -json` - begin - data = JSON.parse(outputs) - cidr = data['vpc_cidr']['value'] - address, prefix_length = cidr.split('/') - pattern = address.split('.')[0..((prefix_length.to_i/8)-1)].join('.') + '.*' - bastion = data['bastion_fqdn']['value'] - [pattern, bastion] - rescue JSON::ParserError => e - puts "Error generating config for env: '#{env}'. Output of terraform json request: \n#{outputs}" - end -end - -print <<-END -# auto-generated by tools/ssh_config -END - -d.each do |(pattern, bastion)| - print <<-END - -Match OriginalHost #{bastion} exec "#{blessclientPath} --gui --region west --host '%h'" - IdentityFile ~/.ssh/blessid - -Host #{pattern} - ProxyJump #{bastion} - User #{remoteUser} - -Host #{bastion} - User #{remoteUser} - -END -end