Skip to content

Instantly share code, notes, and snippets.

@asakura
asakura / gist:05702aad03e757316741
Last active August 29, 2015 14:10
Seed example for cloud-init version < 0.7
$ mkdir seed
$ cd seed
# create user-data and meta-data files that will be used to modify image on first boot
# feel free to change `instance-id' and `local-hostname'
$ { echo instance-id: iid-local01; echo local-hostname: cloudimg; } > meta-data
# customize that with your user info
$ cat << EOF > user-data
#cloud-config
@asakura
asakura / session
Last active August 29, 2015 14:10
Seed example for cloud-init version > 0.7
$ mkdir seed
$ cd seed
# create user-data and meta-data files that will be used to modify image on first boot
# feel free to change `instance-id' and `local-hostname'
$ { echo instance-id: iid-local01; echo local-hostname: cloudimg; } > meta-data
# customize that with your user info
$ cat << EOF > user-data
#cloud-config
@asakura
asakura / app.js
Last active August 29, 2015 14:10
var assert = require('assert'),
conjur = require('conjur-api'),
netrc = require('netrc'),
url = require('url'),
yaml = require('js-yaml'),
fs = require('fs');
function main(baseUrl, account, login, password) {
var infoUrl = baseUrl + 'api/info',
authnUrl = baseUrl + 'api/authn',
# Ensure what variable is available
$ conjur env run --yaml '{CONJUR_GROUP: !var variable/name}' -- 'echo "$CONJUR_GROUP"'

# Install conjur's python api module first
$ sudo pip install conjur

# Okay, run ansible to affect localhost
# -K mean ask for sudo password
# (so you can be happy run this command by cron on a remote host. but better fill your own inventory file and run the play across multiple remote hosts at once)