Skip to content

Instantly share code, notes, and snippets.

$ TF_LOG=INFO terraform apply -var cloud=private
2018/10/29 14:01:40 [INFO] Terraform version: 0.11.10 17850e9a55d33c43d7c31fd6ac122ba97a51d899
2018/10/29 14:01:40 [INFO] Go runtime version: go1.11.1
2018/10/29 14:01:40 [INFO] CLI args: []string{"/home/spiette/bin/terraform", "apply", "-var", "cloud=private"}
2018/10/29 14:01:40 [DEBUG] Attempting to open CLI config file: /home/spiette/.terraformrc
2018/10/29 14:01:40 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2018/10/29 14:01:40 [INFO] CLI command args: []string{"apply", "-var", "cloud=private"}
2018/10/29 14:01:40 [INFO] command: empty backend config, returning nil
2018/10/29 14:01:40 [INFO] command: backend <nil> is not enhanced, wrapping in local
2018/10/29 14:01:40 [INFO] backend/local: starting Apply operation
@spiette
spiette / cloud.py
Last active August 24, 2018 15:22
Spawn a process using clouds.yaml to populate OS_* environment variables
#!/usr/bin/env python3
# Spawn a process using clouds.yaml to populate OS_* environment variables
# Or use it to set environment variables in the current shell:
# $ eval $(cloud <cloud> --export)
import argparse
import os
import sys
import openstack
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
set nohlsearch
set listchars=tab:▸\ ,trail:·
set list
set ignorecase
set smartcase
set nohlsearch
@spiette
spiette / tasks.py
Last active June 9, 2017 12:04
WIP
#!/usr/bin/env python
import argparse
import logging
import os
import sys
import argcomplete
VERSION = '0.1.0'
@spiette
spiette / Dockerfile
Last active May 16, 2016 19:03
Dockerfile to run Helianthus application
FROM centos:latest
MAINTAINER Simon Piette <simon.piette@savoirfairelinux.com>
RUN yum install --assumeyes sudo vim git ; yum clean all
RUN export uid=1000 gid=1000 && \
cp -a /etc/skel /home/user && \
echo "user:x:${uid}:${gid}:User,,,:/home/user:/bin/bash" >> /etc/passwd && \
echo "user:x:${uid}:" >> /etc/group && \
mkdir -p /etc/sudoers.d && \
echo "user ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/user && \
chmod 0440 /etc/sudoers.d/user && \
@spiette
spiette / jinja_variables_types.yml
Created March 3, 2016 14:52
Test the variables types in jinja2 templates, used here with ansible
---
- hosts: all
gather_facts: no
vars:
string: "string"
list:
- item1
- item2
dict:
key1: value1

Keybase proof

I hereby claim:

  • I am spiette on github.
  • I am spiette (https://keybase.io/spiette) on keybase.
  • I have a public key whose fingerprint is 4191 7248 B2E0 C612 F7D2 4ECC 2E6E 40D4 0AFF CA06

To claim this, I am signing this object:

https://groups.google.com/forum/#!topic/puppet-dev/AbXgZEFl3ME
you can dump the entire catalogue to stdout with the following:
it { p subject.resources }
If you are interested in just the one resource, it is probably easier to use:
it { p subject.resource('User', 'foo') }
@spiette
spiette / desktop.pp
Created January 20, 2014 20:01
Very very [...] basic desktop setup manifest
case $::osfamily {
'RedHat': {
$vim = 'vim-enhanced'
$mtr = 'mtr'
}
'Debian': {
$vim = 'vim'
$mtr = 'mtr-tiny'
}
default: {
#!/usr/bin/env python
import urllib2
import json
url = 'http://localhost:8080/v3/nodes'
r = urllib2.Request(url)
r.add_header('Accept', 'application/json')
u = urllib2.urlopen(r)