Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save peterberkenbosch/3283871 to your computer and use it in GitHub Desktop.

Select an option

Save peterberkenbosch/3283871 to your computer and use it in GitHub Desktop.

Revisions

  1. Gabriel Evans revised this gist May 14, 2012. 1 changed file with 0 additions and 4 deletions.
    4 changes: 0 additions & 4 deletions knife-solo-rvm-bootstrap-precise.erb
    Original file line number Diff line number Diff line change
    @@ -29,8 +29,4 @@ gem update --system
    gem update
    gem install ohai --verbose
    gem install chef --verbose <%= bootstrap_version_string %>
    if [ -f /usr/bin/chef-client ]; then
    rm -f /usr/bin/chef-client
    fi
    ln -nfs $(which chef-client) /usr/bin/chef-client
    '
  2. Gabriel Evans revised this gist May 14, 2012. 1 changed file with 4 additions and 4 deletions.
    8 changes: 4 additions & 4 deletions knife-solo-rvm-bootstrap-precise.erb
    Original file line number Diff line number Diff line change
    @@ -15,12 +15,12 @@ if [ ! -f /usr/bin/chef-client ]; then
    rvm install 1.9.3-p194 <%= "--proxy #{knife_config[:bootstrap_proxy]}" if knife_config[:bootstrap_proxy] %>
    rvm use 1.9.3-p194 --default

    if [ ! -d /usr/local/rvm/rubies/1.9.3-p194/etc ]; then
    mkdir /usr/local/rvm/rubies/1.9.3-p194/etc
    if [ ! -d /usr/local/rvm/rubies/ruby-1.9.3-p194/etc ]; then
    mkdir /usr/local/rvm/rubies/ruby-1.9.3-p194/etc
    fi

    if [ ! -f /usr/local/rvm/rubies/1.9.3-p194/etc/gemrc ]; then
    echo "gem: --no-rdoc --no-ri" > /usr/local/rvm/rubies/1.9.3-p194/etc/gemrc
    if [ ! -f /usr/local/rvm/rubies/ruby-1.9.3-p194/etc/gemrc ]; then
    echo "gem: --no-rdoc --no-ri" > /usr/local/rvm/rubies/ruby-1.9.3-p194/etc/gemrc
    fi
    fi

  3. Gabriel Evans revised this gist May 14, 2012. 2 changed files with 36 additions and 61 deletions.
    36 changes: 36 additions & 0 deletions knife-solo-rvm-bootstrap-precise.erb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,36 @@
    bash -c '
    <% if knife_config[:bootstrap_proxy] -%>
    (
    cat <<'EOP'
    <%= "proxy = #{knife_config[:bootstrap_proxy]}" %>
    EOP
    ) > ~/.curlrc
    <% end -%>

    if [ ! -f /usr/bin/chef-client ]; then
    apt-get update
    apt-get install -y build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
    curl -L get.rvm.io | bash -s stable
    source /etc/profile
    rvm install 1.9.3-p194 <%= "--proxy #{knife_config[:bootstrap_proxy]}" if knife_config[:bootstrap_proxy] %>
    rvm use 1.9.3-p194 --default

    if [ ! -d /usr/local/rvm/rubies/1.9.3-p194/etc ]; then
    mkdir /usr/local/rvm/rubies/1.9.3-p194/etc
    fi

    if [ ! -f /usr/local/rvm/rubies/1.9.3-p194/etc/gemrc ]; then
    echo "gem: --no-rdoc --no-ri" > /usr/local/rvm/rubies/1.9.3-p194/etc/gemrc
    fi
    fi

    source /etc/profile
    gem update --system
    gem update
    gem install ohai --verbose
    gem install chef --verbose <%= bootstrap_version_string %>
    if [ -f /usr/bin/chef-client ]; then
    rm -f /usr/bin/chef-client
    fi
    ln -nfs $(which chef-client) /usr/bin/chef-client
    '
    61 changes: 0 additions & 61 deletions ubuntu-11.10-gems.erb
    Original file line number Diff line number Diff line change
    @@ -1,61 +0,0 @@
    bash -c '
    <% if knife_config[:bootstrap_proxy] -%>
    (
    cat <<'EOP'
    <%= "proxy = #{knife_config[:bootstrap_proxy]}" %>
    EOP
    ) > ~/.curlrc
    <% end -%>

    if [ ! -f /usr/bin/chef-client ]; then
    apt-get update
    apt-get install -y build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
    bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
    source /etc/profile
    rvm install 1.9.3 <%= "--proxy #{knife_config[:bootstrap_proxy]}" if knife_config[:bootstrap_proxy] %>
    rvm use 1.9.3 --default
    fi

    source /etc/profile
    gem update --system --no-rdoc --no-ri
    gem update --no-rdoc --no-ri
    gem install ohai --no-rdoc --no-ri --verbose
    gem install chef --no-rdoc --no-ri --verbose <%= bootstrap_version_string %>
    if [ -f /usr/bin/chef-client ]; then
    rm -f /usr/bin/chef-client
    fi
    ln -nfs $(which chef-client) /usr/bin/chef-client

    mkdir -p /etc/chef

    (
    cat <<'EOP'
    <%= validation_key %>
    EOP
    ) > /tmp/validation.pem
    awk NF /tmp/validation.pem > /etc/chef/validation.pem
    rm /tmp/validation.pem

    <% if @chef_config[:encrypted_data_bag_secret] -%>
    (
    cat <<'EOP'
    <%= encrypted_data_bag_secret %>
    EOP
    ) > /tmp/encrypted_data_bag_secret
    awk NF /tmp/encrypted_data_bag_secret > /etc/chef/encrypted_data_bag_secret
    rm /tmp/encrypted_data_bag_secret
    <% end -%>

    (
    cat <<'EOP'
    <%= config_content %>
    EOP
    ) > /etc/chef/client.rb

    (
    cat <<'EOP'
    <%= { "run_list" => @run_list }.to_json %>
    EOP
    ) > /etc/chef/first-boot.json

    <%= start_chef %>'
  4. Kashif Rasul revised this gist Nov 23, 2011. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions ubuntu-11.10-gems.erb
    Original file line number Diff line number Diff line change
    @@ -12,8 +12,8 @@ if [ ! -f /usr/bin/chef-client ]; then
    apt-get install -y build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
    bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
    source /etc/profile
    rvm install 1.9.2 <%= "--proxy #{knife_config[:bootstrap_proxy]}" if knife_config[:bootstrap_proxy] %>
    rvm use 1.9.2 --default
    rvm install 1.9.3 <%= "--proxy #{knife_config[:bootstrap_proxy]}" if knife_config[:bootstrap_proxy] %>
    rvm use 1.9.3 --default
    fi

    source /etc/profile
  5. Kashif Rasul revised this gist Nov 23, 2011. No changes.
  6. Kashif Rasul renamed this gist Oct 15, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion ubuntu-11.04-gems.erb → ubuntu-11.10-gems.erb
    Original file line number Diff line number Diff line change
    @@ -9,7 +9,7 @@ EOP

    if [ ! -f /usr/bin/chef-client ]; then
    apt-get update
    apt-get install -y build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison
    apt-get install -y build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion
    bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
    source /etc/profile
    rvm install 1.9.2 <%= "--proxy #{knife_config[:bootstrap_proxy]}" if knife_config[:bootstrap_proxy] %>
  7. Kashif Rasul revised this gist Oct 10, 2011. 2 changed files with 61 additions and 43 deletions.
    43 changes: 0 additions & 43 deletions chef_bootstrap_rvm.erb
    Original file line number Diff line number Diff line change
    @@ -1,43 +0,0 @@
    bash -c '

    if [ ! -f /usr/bin/chef-client ]; then
    apt-get update
    apt-get install -y build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev autoconf libc6-dev
    bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
    (
    cat <<'EOP'
    [[ -s "/usr/local/rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm" # This loads RVM into a shell session.
    EOP
    ) > /etc/profile.d/rvm.sh
    source /etc/profile
    rvm install 1.9.2-p180
    rvm use 1.9.2-p180 --default
    fi

    gem install ohai --no-rdoc --no-ri --verbose
    gem install chef --no-rdoc --no-ri --verbose <%= bootstrap_version_string %>
    ln -nfs $(which chef-client) /usr/bin/chef-client

    mkdir -p /etc/chef

    (
    cat <<'EOP'
    <%= validation_key %>
    EOP
    ) > /tmp/validation.pem
    awk NF /tmp/validation.pem > /etc/chef/validation.pem
    rm /tmp/validation.pem

    (
    cat <<'EOP'
    <%= config_content %>
    EOP
    ) > /etc/chef/client.rb

    (
    cat <<'EOP'
    <%= { "run_list" => @run_list }.to_json %>
    EOP
    ) > /etc/chef/first-boot.json

    <%= start_chef %>'
    61 changes: 61 additions & 0 deletions ubuntu-11.04-gems.erb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,61 @@
    bash -c '
    <% if knife_config[:bootstrap_proxy] -%>
    (
    cat <<'EOP'
    <%= "proxy = #{knife_config[:bootstrap_proxy]}" %>
    EOP
    ) > ~/.curlrc
    <% end -%>

    if [ ! -f /usr/bin/chef-client ]; then
    apt-get update
    apt-get install -y build-essential openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison
    bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
    source /etc/profile
    rvm install 1.9.2 <%= "--proxy #{knife_config[:bootstrap_proxy]}" if knife_config[:bootstrap_proxy] %>
    rvm use 1.9.2 --default
    fi

    source /etc/profile
    gem update --system --no-rdoc --no-ri
    gem update --no-rdoc --no-ri
    gem install ohai --no-rdoc --no-ri --verbose
    gem install chef --no-rdoc --no-ri --verbose <%= bootstrap_version_string %>
    if [ -f /usr/bin/chef-client ]; then
    rm -f /usr/bin/chef-client
    fi
    ln -nfs $(which chef-client) /usr/bin/chef-client

    mkdir -p /etc/chef

    (
    cat <<'EOP'
    <%= validation_key %>
    EOP
    ) > /tmp/validation.pem
    awk NF /tmp/validation.pem > /etc/chef/validation.pem
    rm /tmp/validation.pem

    <% if @chef_config[:encrypted_data_bag_secret] -%>
    (
    cat <<'EOP'
    <%= encrypted_data_bag_secret %>
    EOP
    ) > /tmp/encrypted_data_bag_secret
    awk NF /tmp/encrypted_data_bag_secret > /etc/chef/encrypted_data_bag_secret
    rm /tmp/encrypted_data_bag_secret
    <% end -%>

    (
    cat <<'EOP'
    <%= config_content %>
    EOP
    ) > /etc/chef/client.rb

    (
    cat <<'EOP'
    <%= { "run_list" => @run_list }.to_json %>
    EOP
    ) > /etc/chef/first-boot.json

    <%= start_chef %>'
  8. @bensie bensie created this gist Jun 11, 2011.
    43 changes: 43 additions & 0 deletions chef_bootstrap_rvm.erb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    bash -c '

    if [ ! -f /usr/bin/chef-client ]; then
    apt-get update
    apt-get install -y build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev autoconf libc6-dev
    bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
    (
    cat <<'EOP'
    [[ -s "/usr/local/rvm/scripts/rvm" ]] && source "/usr/local/rvm/scripts/rvm" # This loads RVM into a shell session.
    EOP
    ) > /etc/profile.d/rvm.sh
    source /etc/profile
    rvm install 1.9.2-p180
    rvm use 1.9.2-p180 --default
    fi

    gem install ohai --no-rdoc --no-ri --verbose
    gem install chef --no-rdoc --no-ri --verbose <%= bootstrap_version_string %>
    ln -nfs $(which chef-client) /usr/bin/chef-client

    mkdir -p /etc/chef

    (
    cat <<'EOP'
    <%= validation_key %>
    EOP
    ) > /tmp/validation.pem
    awk NF /tmp/validation.pem > /etc/chef/validation.pem
    rm /tmp/validation.pem

    (
    cat <<'EOP'
    <%= config_content %>
    EOP
    ) > /etc/chef/client.rb

    (
    cat <<'EOP'
    <%= { "run_list" => @run_list }.to_json %>
    EOP
    ) > /etc/chef/first-boot.json

    <%= start_chef %>'