Skip to content

Instantly share code, notes, and snippets.

View carlosonunez's full-sized avatar

Carlos Nunez carlosonunez

View GitHub Profile
# Env vars
PUPPET_MASTER="YOUR_PUPPET_MASTER_HERE"
GIT_REPOSITORY=https://github.com/carlosonunez/infrastructure_management
PUPPET_CONFIG_BRANCH="puppet_data_config"
# Add the Puppet Labs repository
cd ~ && wget https://apt.puppetlabs.com/puppetlabs-release-pc1-trusty.deb
sudo dpkg -i puppetlabs-release-pc1-trusty.deb
# Install puppet-agent
References
===========
1. Why puppetmaster-passenger
a. http://stackoverflow.com/questions/36625280/what-is-the-difference-between-puppetserver-1-1-3-vs-puppet-server-3-8-6-1
b. The long way: https://ubuntuforums.org/showthread.php?t=2085991
2. Differences between puppet-master and Passenger/puppet-master: https://docs.puppet.com/puppetserver/latest/puppetserver_vs_passenger.html
3. Upstart vs SysVinit (yes, it's that old):
a. http://askubuntu.com/questions/2075/whats-the-difference-between-service-and-etc-init-d
b. http://askubuntu.com/questions/5039/what-is-the-difference-between-etc-init-and-etc-init-d
4. puppet.conf documentation: https://docs.puppet.com/puppet/latest/configuration.html
Viewing all configuration parameters for Puppet
------------------------------------------------
$> sudo puppet config print all
Viewing all classes registered to a node
-----------------------------------------
$> cat $(puppet config print vardir)/cache/classes.txt
Doing a Puppet run of a specific module
---------------------------------------
@carlosonunez
carlosonunez / speaking_and_sponsorship_for_hashicorp_dfw.markdown
Last active May 17, 2017 01:00
HashiCorp DFW Speaking and Sponsoring Guidelines

Hey! Thanks for your interest in speaking at HashiCorp DFW. We're glad you're here!

This is a short document about what we're expecting from our speakers. If you have any feedback about this, feel free to leave a comment here or email me at dev@carlosnunez.me.

Speaking Guidelines

We're looking for talks that focus on using HashiCorp's tools in a given environment, namely:

  • Terraform
@carlosonunez
carlosonunez / gist:af38d604bd48eb771b4cdb9bbd0bd761
Created June 9, 2017 21:40
[Terraform] planVersionFormat magic byte issue
# Where is 'terraform'?
[2017-06-09 16:26:36 carlosnunez@DESKTOP-RHPB7LP <<master>> infrastructure] $: which terraform
/usr/local/bin/terraform
# Where is './terraform'?
[2017-06-09 16:27:02 carlosnunez@DESKTOP-RHPB7LP <<master>> infrastructure] $: readlink -f ./terraform
/home/cnunez/src/infrastructure/terraform
# Okay, cool. So we have two different terraform binaries installed. Let's see what their versions are.
[2017-06-09 16:20:26 carlosnunez@DESKTOP-RHPB7LP <<master>> infrastructure]$: terraform version
@carlosonunez
carlosonunez / ecs_learning_resources.md
Last active September 3, 2017 02:10
ECS Learning Resources
1. Create an etcd token; store it in Vault or some other secure location
2. Create file /etc/systemd/system/docker.service.d/custom.conf with contents:
[Service]
Environment="DOCKER_OPTS=-H=0.0.0.0:2376 -H unix:///var/run/docker.sock --cluster-advertise eth1:2376 --cluster-store etcd://127.0.0.1:2379"
This needs to be done in cloud-init since CoreOS is super bare-bones and "doesn't" contain support for config mgmt out of the box.
@carlosonunez
carlosonunez / kubernetes_study_notes.md
Last active October 6, 2017 13:59
Some notes I took while learning about Kubernetes.

Labels

You can use labels to select Pods and other objects in k8s.

DaemonSets

A DaemonSet ensures that Pods get created and run on Nodes predetermined by label selectors in spec.template.metadata. This is useful for logging drivers or databases, i.e. services that have particular Node constraints.

Resourcing

@carlosonunez
carlosonunez / troubleshooting_azure_arm_packer_builder.md
Created November 20, 2017 19:39
Troubleshooting the `azure-arm` Packer builder

This short guide contains a few tips on how to troubleshoot the Azure ARM Packer Builder when stuff goes wrong. I couldn't find a lot of information from my Google searches on this builder. I hope that this Gist fills in the gaps. Please contribute if you have anything to add!

API Responses

The azure-arm builder uses the Go Azure SDK, which, itself, is a wrapper for the Azure REST API. You might get weird exceptions from Packer that aren't reproducable by the Python or node.js clients.

I normally use Charles Web Proxy to figure out what's going on when this happens. Here's how I do that (I am assuming you are on OS X or Linux):

  1. Download Charles.
@carlosonunez
carlosonunez / azure_arm_builder_credentials_bug.md
Created November 20, 2017 19:59
azure_arm builder credentials bug

template.json:

{
  "description": "Basic RHEL 7.2 image.",
  "variables": {
    "client_id": null,
    "client_secret": null,
    "subscription_id": null,
    "azure_location": null,