by xero updated 10.29.24
Typing vagrant
from the command line will display a list of all available commands.
Be sure that you are in the same directory as the Vagrantfile when running these commands!
vagrant init
-- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.vagrant init <boxpath>
-- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example,vagrant init ubuntu/trusty64
.
vagrant up
-- starts vagrant environment (also provisions only on the FIRST vagrant up)
This uses terraform's template_file
resource to generate a yaml properties file for serverspec to use.
- create the Rakefile in your terraform project root
- create a
spec
directory and putspec_helper.rb
in it - create the
templates/properties.tmpl.yml
file - create the
serverspec.tf
terraform apply
Tests will be matched based on roles defined for a given node.
node_group { 'PE Master': | |
ensure => present, | |
classes => { | |
'pe_repo' => {}, | |
'pe_repo::platform::el_7_x86_64' => {}, | |
'puppet_enterprise::profile::master' => | |
{ | |
'code_manager_auto_configure' => true, | |
'file_sync_enabled' => true, | |
'r10k_private_key' => $code_manager_private_key_path, |
by Bjørn Friese
Beautiful is better than ugly. Explicit is better than implicit.
I frequently deal with collections of things in the programs I write. Collections of droids, jedis, planets, lightsabers, starfighters, etc. When programming in Python, these collections of things are usually represented as lists, sets and dictionaries. Oftentimes, what I want to do with collections is to transform them in various ways. Comprehensions is a powerful syntax for doing just that. I use them extensively, and it's one of the things that keep me coming back to Python. Let me show you a few examples of the incredible usefulness of comprehensions.
- using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
- using inventory:
127.0.0.1 ansible_connection=local
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
vault.barrier.* | |
name="vault_barrier" | |
method="$1" | |
vault.consul.* | |
name="vault_consul" | |
method="$1" | |
vault.route.*.* | |
name="vault_route" |
This is an example of hosting standalone web front-end (web) and data API (api) applications under the same domain via Nginx (acting as a reverse proxy) and Docker, where HTTP requests starting with example.com/graphql
and example.com/login/*
are being redirected to http://api:3000 and everything else under the same domain is going to be passed to http://web:3000.
.
├── /nginx.sites/ # Server configuration for each of web apps
├── /nginx.snippets/ # Nginx code snippets