Skip to content

Instantly share code, notes, and snippets.

@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 / 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'
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 / 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
$ 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