export VAULT_ADDR="http://127.0.0.1:8200"
vault status
vault init
vault init -key-shares=10 -key-threshold=2 > vault-storage.txt
vault unseal
vault auth <root-key>
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
= VPC | |
1. Crear VPC, asignar rango de IP (10.0.0.0/16) | |
2. Crear al menos | |
- Una subnet pública (10.0.1.0/24) | |
- Una subnet privada (10.0.2.0/24) | |
3. Crear un Internet Gateway y atacharlo a la VPC | |
4. Crear un NAT Gateway (debe estar en la VPC pública) | |
5. Routing table | |
- Asignar la subnet pública al Internet GW con destination 0.0.0.0/0 | |
- Asingar la subnet privada al NAT GW con destination 0.0.0.0/0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (ctx, done) { | |
var MongoClient = require('mongodb').MongoClient; | |
var assert = require('assert'); | |
var ObjectId = require('mongodb').ObjectID; | |
var url = ctx.data.MONGO_URL; | |
var insertValue = function(db) { | |
db.collection('cups').insertOne({ | |
'date': new Date(), | |
'coffee': 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
knife solo prepare user@host <- crea el nodes/host.json | |
knife solo cook user@host <- de acuerdo al archivo nodes/host.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
FIND=`docker ps -a | grep Exited | awk '{print $1}'` | |
for i in $FIND; | |
do | |
docker rm $i | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (ctx, done) { | |
var MongoClient = require('mongodb').MongoClient; | |
var assert = require('assert'); | |
var ObjectId = require('mongodb').ObjectID; | |
var url = ctx.data.MONGO_URL; | |
var insertValue = function(db) { | |
db.collection('cups').insertOne({ | |
'date': new Date(), | |
'coffee': 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def foo(x) | |
puts x*2 | |
end |
- Revisión de branch fix-prod-staging-path
- Aclaración de conceptos de chef:
- Environment: Como "mapeamos" nuestra infraestructura, de acá manejamos que versiones instalamos en desarrollo, staging y producción.
- Role: Definición de ciertos patrones que existen dentro de la infraestrucutra: web servers, backups, cron, lb, etc.
- Cookbook: Unidad fundamental. Define el escenario. Contiene recetas, atributos, archivos, templates, etc.
- Recipe: Es la unidad "mas" fundamental y define qué se debe hacer.
- Otros: workstation, node, server, run-list, chef-run
- Test Kitchen:
- Especie de integración continua, permite probar recetas en nuestra workstation
- Ejemplo.
Escribir un cookbook de chef que permita instalar la versión 2.8.0 de redis. Este cookbook debe tener la estructura típica de un cookbook standard. Esto es:
├── .gitignore
├── .kitchen.yml
├── CHANGELOG.md
├── README.md
├── attributes
│ ├── default.rb
│ └── source.rb
├── metadata.rb
git clone https://github.com/boris/chef.git
cd chef/site-cookbooks/packages