Skip to content

Instantly share code, notes, and snippets.

View dgrstl's full-sized avatar

David Roberts dgrstl

View GitHub Profile
GET /tfs/Sandbox/TFSGITPOC/_git/control-repo/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.0 (libgit2 0.21.4)
Host: ausdwtfsapp01.aus.amer.dell.com
Accept: */*
Authorization: Basic UHJvY2Vzc2NtYWRpbnRlZzpXcTdpNVgyQmV5NEtKcjk4Xw==
HTTP/1.1 401 Unauthorized
Cache-Control: private
Content-Type: text/html
Server: Microsoft-IIS/8.5
GET /tfs/Sandbox/TFSGITPOC/_git/control-repo/info/refs?service=git-upload-pack HTTP/1.1
User-Agent: git/1.8.3.1
Host: ausdwtfsapp01.aus.amer.dell.com:8080
Accept: */*
Accept-Encoding: gzip
Pragma: no-cache
HTTP/1.1 401 Unauthorized
Cache-Control: private
Content-Type: text/html
dave-mbp:~ dave$ puppet resource ec2_vpc tse-vpc
ec2_vpc { 'tse-vpc':
ensure => 'present',
cidr_block => '10.98.0.0/16',
instance_tenancy => 'default',
region => 'us-west-2',
tags => {'created_by' => 'cbarker', 'department' => 'TSE', 'project' => 'Infrastructure'},
}
dave-mbp:~ dave$ puppet resource ec2_vpc_subnet tse-subnet-avza-1
ec2_vpc_subnet { 'tse-subnet-avza-1':
ensure => 'present',
availability_zone => 'us-west-2a',
cidr_block => '10.98.10.0/24',
map_public_ip_on_launch => 'true',
region => 'us-west-2',
route_table => 'tse-routes',
tags => {'created_by' => 'cbarker', 'department' => 'TSE', 'project' => 'Infrastructure'},
vpc => 'tse-vpc',
dave-mbp:~ dave$ puppet resource ec2_securitygroup tse-crossconnect
ec2_securitygroup { 'tse-crossconnect':
ensure => 'present',
description => 'Security Group that allows masters to talk to agents and vice versa - prevents race condition',
ingress => [{'from_port' => '1', 'protocol' => 'udp', 'security_group' => 'tse-master', 'to_port' => '65535'}, {'from_port' => '1', 'protocol' => 'udp', 'security_group' => 'tse-agents', 'to_port' => '65535'}, {'from_port' => '1', 'protocol' => 'tcp', 'security_group' => 'tse-master', 'to_port' => '65535'}, {'from_port' => '1', 'protocol' => 'tcp', 'security_group' => 'tse-agents', 'to_port' => '65535'}, {'from_port' => '-1', 'protocol' => 'icmp', 'security_group' => 'tse-master', 'to_port' => '-1'}, {'from_port' => '-1', 'protocol' => 'icmp', 'security_group' => 'tse-agents', 'to_port' => '-1'}],
region => 'us-west-2',
tags => {'created_by' => 'cbarker', 'department' => 'TSE', 'project' => 'Infrastructure'},
vpc => 'tse-vpc',
}
dave-mbp:~ dave$ puppet resource ec2_securitygroup tse-master
ec2_securitygroup { 'tse-master':
ensure => 'present',
description => 'Security group for use by the Master, and associated ports',
ingress => [{'cidr' => '0.0.0.0/0', 'from_port' => '80', 'protocol' => 'tcp', 'to_port' => '80'}, {'cidr' => '10.90.0.0/16', 'from_port' => '0', 'protocol' => 'icmp', 'to_port' => '-1'}, {'cidr' => '0.0.0.0/0', 'from_port' => '22', 'protocol' => 'tcp', 'to_port' => '22'}, {'cidr' => '0.0.0.0/0', 'from_port' => '3000', 'protocol' => 'tcp', 'to_port' => '3000'}, {'cidr' => '0.0.0.0/0', 'from_port' => '443', 'protocol' => 'tcp', 'to_port' => '443'}],
region => 'us-west-2',
tags => {'created_by' => 'cbarker', 'department' => 'TSE', 'project' => 'Infrastructure'},
vpc => 'tse-vpc',
}
#!/bin/bash
echo "==> Delete the code-staging dir"
rm -rf /etc/puppetlabs/code-staging/environments
rm -rf /etc/puppetlabs/code-staging/.gitmodules
echo "==> Running r10k manually as pe-puppet to fetch new code"
sudo -u pe-puppet bash -c '/opt/puppetlabs/bin/r10k deploy environment -c /opt/puppetlabs/server/data/code-manager/r10k.yaml -p -v debug'
echo "==> Delete the code dir so file-sync can do its thing"
sudo rm -rf /etc/puppetlabs/code/*
✘-1 ~/repos/prosvc-engagement-docs [master|✔]
16:27 $ gem update rake
Updating installed gems
Updating rake
rake's executable "rake" conflicts with /Users/dave/.rbenv/versions/2.1.5/bin/rake
Overwrite the executable? [yN] y
Successfully installed rake-11.1.2
Gems updated: rake
✔ ~/repos/prosvc-engagement-docs [master|✔]
16:27 $ rake --version
# This script installs the windows puppet agent on the windows seteam vagrant vms
# from the master's pe_repo by downloading it to C:\tmp first and then running
# msiexec on it from there.
$puppet_master_server = "master.inf.puppetlabs.demo"
$msi_source = "https://${puppet_master_server}:8140/packages/current/windows-x86_64/puppet-agent-x64.msi"
$msi_dest = "C:\tmp\puppet-agent-x64.msi"
# Start the agent installation process and wait for it to end before continuing.
Write-Host "Installing puppet agent from $msi_source"
curl -k -X GET https://localhost:4433/rbac-api/v1/ds \
--cert /etc/puppetlabs/puppet/ssl/certs/master.inf.puppetlabs.demo.pem \
--key /etc/puppetlabs/puppet/ssl/private_keys/master.inf.puppetlabs.demo.pem \
--cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem \
-H "Content-Type: application/json"