Skip to content

Instantly share code, notes, and snippets.

View dgrstl's full-sized avatar

David Roberts dgrstl

View GitHub Profile
#!/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/*
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',
}
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_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_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'},
}
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
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
{
"details": {
"message": "throw+: {:kind :puppetlabs.code-manager/shell-failed, :result {:exit-code 1, :stderr \"\u001b[31m\\nError while running: #<R10K::Error: Unable to determine current branches for Git source 'puppet' (/etc/puppetlabs/code-staging/environments)>\u001b[0m\\n\", :stdout \"\"}}",
"trace": [
"puppetlabs.code_manager.core$collect_environments.invoke (core.clj:46)",
"puppetlabs.code_manager.shell_workers$build_collect_all_fn$collect_all__19045.invoke (shell_workers.clj:70)",
"puppetlabs.code_manager.app$build_deploy_handler$deploy_handler__18554.invoke (app.clj:76)",
"puppetlabs.code_manager.app$wrap_format_errors$format_errors__18564.invoke (app.clj:119)",
"ring.middleware.json$wrap_json_response$fn__14057.invoke (json.clj:65)",
"ring.middleware.json$wrap_json_body$fn__14040.invoke (json.clj:33)",
@dgrstl
dgrstl / foo
Created February 18, 2016 21:20
ash-3.2# puppet apply -d create_master.pp
Debug: Runtime environment: puppet_version=4.2.0, ruby_version=2.1.6, run_mode=user, default_encoding=US-ASCII
Debug: Evicting cache entry for environment 'production'
Debug: Caching environment 'production' (cache ttl: 0)
Debug: Evicting cache entry for environment 'production'
Debug: Caching environment 'production' (cache ttl: 0)
Not an EC2 host
value for agent_specified_environment is still nil
value for cfkey is still nil
Found no suitable resolves of 1 for filesystems
#!/bin/bash
#Only edit these two lines:
#username for the console:
PUPPET_PE_CONSOLEPWD='puppetlabs'
PUPPET_PE_VERSION='2015.3.2'
# STOP DO NOT EDIT BELOW THIS LINE
MD="http://169.254.169.254/latest/meta-data/"
PUBLIC_HOSTNAME=$(curl -fs $MD/public-hostname)