Skip to content

Instantly share code, notes, and snippets.

@asakura
Created January 19, 2015 20:48
Show Gist options
  • Save asakura/5ee103456409e5eddae6 to your computer and use it in GitHub Desktop.
Save asakura/5ee103456409e5eddae6 to your computer and use it in GitHub Desktop.
# ---- 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
# /lib/modules /var/lib/lxc/conjur-baseimage-3-1/rootfs/lib/modules none bind 0 0
sudo modprobe ip6table_filter
sudo lxc-start -n conjur-baseimage
sudo lxc-ls -f
# ssh -A to container
# put your pubkey to ~/.ssh/authorized_keys
# sudo visudo : %sudo ALL=NOPASSWD: ALL
# ---- RUN ON CONTAINER
sudo id # input password for first time
echo 'Defaults env_keep+=SSH_AUTH_SOCK' | sudo tee --append /etc/sudoers > /dev/null
echo 'Defaults timestamp_timeout=6000' | sudo tee --append /etc/sudoers > /dev/null
# password less sudo NOPASSWD: ALL
# upload pubkey
sudo apt-get update
sudo apt-get install -y git curl wget python-software-properties build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev autoconf dbus iptables
sudo apt-add-repository -y ppa:brightbox/ruby-ng
sudo apt-get update
sudo apt-get dist-upgrade -y
sudo apt-get install -y ruby2.0 ruby2.0-dev
sudo gem install --no-rdoc --no-ri berkshelf
curl https://opscode-omnibus-packages.s3.amazonaws.com/ubuntu/10.04/x86_64/chef_10.14.0-1.ubuntu.10.04_amd64.deb -o /tmp/chef.deb
sudo dpkg -i /tmp/chef.deb
rm /tmp/chef.deb
sudo mkdir -p /var/chef/cache
git clone [email protected]:conjurinc/appliance.git
cd appliance
git checkout dockerize
sudo mkdir -p /etc/chef/
sudo cp docker/solo.rb /etc/chef/solo.rb
git submodule init
git submodule update
echo -e "
source \"https://supermarket.getchef.com\"
metadata
# cookbook 'partial_search'
cookbook 'apt', path: '../apt'
cookbook 'build-essential', path: '../build-essential'
cookbook 'database', path: '../database'
cookbook 'github-connect', path: '../github-connect'
cookbook 'iptables-ng', path: '../iptables-ng'
cookbook 'mysql', path: '../../stub_cookbooks/mysql'
cookbook 'openssl', path: '../openssl'
cookbook 'postgresql', path: '../postgresql'
cookbook 'ssh_known_hosts', path: '../ssh_known_hosts'
cookbook 'sudo', path: '../sudo'
" > cookbooks/conjur/Berksfile
cd cookbooks/conjur
berks vendor ../.vendor
cd ../../..
sudo mv appliance /src
sudo rm /etc/apt/sources.list.d/brightbox-ruby-ng-precise.list
sudo chef-solo -o role[conjur]
sudo apt-get purge -y build-essential zlib1g-dev libssl-dev libreadline6-dev libyaml-dev autoconf
sudo apt-get clean
# ---- RUN ON HOST
sudo lxc-stop -n conjur-baseimage
sudo lxc-clone -o conjur-baseimage -n conjur-standalone-1
sudo lxc-start -n conjur-standalone-1
sudo lxc-ls -f
# ssh to container
# ---- RUN ON CONTAINER
# That's issue, should be resolved
sudo /opt/conjur/scripts/configure-conjur # if you run conjur-configure you will have `dbus socket doesn't exists' errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment