# 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)
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
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', |
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
$ 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 |
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
$ 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 |
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
- hosts: registry | |
sudo: yes | |
vars: | |
conjur_login: "{{ lookup('env', 'CONJUR_AUTHN_LOGIN') }}" | |
conjur_api_key: "{{ lookup('env', 'CONJUR_AUTHN_API_KEY') }}" | |
conjur_policy_id: "{{ lookup('env', 'CONJUR_POLICY_ID') }}" | |
tasks: | |
- name: add docker repository Key | |
apt_key: keyserver=keyserver.ubuntu.com id=36A1D7869245C8950F966E92D8576A8BA88D21E9 | |
tags: prepare |
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
#cloud-config | |
manage_etc_hosts: localhost | |
ssh_authorized_keys: | |
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCcKhUGgzZTycTHQPjfd12MeSaFYl2pomE0pvzJuQVBJHAdMg0mTLphtAA7jUVp1mMaLXhONVZMTqyy9Jkb0lhZK6wzDC+MwyqB543Q/umHpRccULOWfjvB0S33ZA6414287kshqbH4tfkQ5+2lJitj2FDUIck9BPwUBSvOeyDsOuU6PeCY8qD2czvKk2QN96h2SngibuQ+ty7nLdqIGedAojevKk9YwtopTRey3Xxe4g++Ew4Jc40jH9oY0KHVS0vIVeKkpJow7W4xmS5zviMfdejjhmirDErpYP6DqIJwl0wlBn/D/ghoWgYfUzuBjUBQ+sHZRQ+mgUW3ZTaHdzBgwVLKuzckCovdq6fA3wL+x3rexR1avhR/AxnMmc4hFc5/TGhqTs9oRKRwo7A6wrufn7SKtrbbtoAB6tfwT+upUxqwTpuZVitLTbuUSafeKUSt09p/H0kvutwpenypBHunFpa1i+Z/pd/MJ+FIedJqpojFfFmYIyHktwO3rIigJnzdmuQF+oo3c/9Xuz8+vazfFVCTLEAzIkokIqJop04o4GCiZzFHZTj5p85vxnfZMgBiHnZ5ox6h6mpzwomJPJWf4cSokh3bLuB7lUVWbLlv7/HklEKSZpBAKN0v7qogEshCCLGH9UX8HkpWJcM81ikXri2dUCsxz3dcXJ54q1glfw== [email protected] |
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
# ---- RUN ON HOST | |
sudo apt-get install -y python-software-properties | |
sudo apt-add-repository -y ppa:ubuntu-lxc/stable | |
sudo apt-get update | |
sudo apt-get dist-upgrade | |
sudo apt-get install -y lxc | |
sudo lxc-create -t ubuntu -n conjur-baseimage -- -r precise | |
# fstab |
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
# Prepare your host machine | |
```sh-session | |
sudo apt-get install -y python-software-properties | |
sudo apt-add-repository -y ppa:ubuntu-lxc/stable | |
sudo apt-get update | |
sudo apt-get dist-upgrade | |
sudo apt-get install -y lxc | |
sudo modprobe ip6table_filter | |
``` |
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
sudo -i | |
service docker stop | |
lxc-stop -n conjur-standalone-01 | |
service lxc-net stop | |
service lxc stop | |
# Delete old bridges | |
ip link set dev docker0 down | |
brctl delbr docker0 |
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
#include <stdint.h> | |
#include "algos_number.h" | |
void* algos_number_alloc(algos_number_kind kind, void* value) { | |
algos_number *number = (algos_number*)enif_alloc(sizeof(algos_number)); | |
if (number == NULL) { | |
exit(1); | |
} |
OlderNewer