Skip to content

Instantly share code, notes, and snippets.

View slyness's full-sized avatar
🏠
Working from home

Aaron Baer slyness

🏠
Working from home
View GitHub Profile
@slyness
slyness / rename_node.md
Last active November 11, 2023 18:09
Rename a Chef Node

How to rename a chef node

  1. Edit existing node name. Update name and save. Chef will copy the node and create a new client entry.
knife node edit oldnode
  1. ssh to node
  2. Change hostname and dns information
@slyness
slyness / upgrade_script.md
Last active August 8, 2023 22:03
Chef 1.4 to Chef 11 single server instance upgrade script

Upgrade Procedure:

  • Chef system has enough resources to perform the upgrade. 8GB ram, 4 CPUs confirmed to work
  • private-chef must be version 1.4.6 and above. If 1.4.4 is still installed upgrade to 1.4.9
  • Log on to system
  • Create working directory
  • Download private-chef-11.1.3-1.el6.x86_64.rpm to working directory ** http://172.31.56.93/downloads/private-chef-11.1.3-1.el6.x86_64.rpm
  • Install Gems needed for system cleanup
"Type": "AWS::CloudFormation::Stack",
"Properties": {
"Parameters": {
"IaasAdministratorAccessPolicyArn": {
"Fn::GetAtt": [
"IamPoliciesIaasAdministratorAccess",
"Outputs.IaasAdministratorAccessPolicyArn"
]
},
"DenyVpcPolicyArn": {
/opt/sensu/embedded/bin/ruby -r ./siteconf20160316-15494-msbj6r.rb extconf.rb
checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
@slyness
slyness / gist:8552294
Created January 22, 2014 02:03
ERROR: constant Chef::CookbookSynchronizer::EAGER_SEGMENTS not defined
192.168.56.102 96: # Force full cookbook downloads
192.168.56.102 97>> CookbookSynchronizer.send(:remove_const, :EAGER_SEGMENTS)
192.168.56.102 98: CookbookSynchronizer.const_set(:EAGER_SEGMENTS, CookbookVersion::COOKBOOK_SEGMENTS)
192.168.56.102 99: Chef::Log.warn 'Performing full cookbook sync...'
192.168.56.102 100: rest = Chef::REST.new(Chef::Config[:chef_server_url], node.name, Chef::Config[:client_key])
192.168.56.102 101: run_list_expansion = node.run_list.expand(node.chef_environment)
192.168.56.102 102: cookbook_hash = rest.post_rest(
192.168.56.102 103: "environments/#{node.chef_environment}/cookbook_versions",
192.168.56.102 104: :run_list => run_list_expansion.recipes.with_version_constraints_strings
192.168.56.102 105: )
@slyness
slyness / gist:8304699
Created January 7, 2014 19:00
Base container generated by vagabond inside a ubuntu 12.10 vm running in virtualbox hosted on OSX.
greenlantern :: Planet/ninefold/ninefold-test ‹master*› » sudo lxc-start -n ubuntu_1204
init: Unable to mount /dev/pts filesystem: Permission denied
<3>init: Failed to create pty - disabling logging for job
<4>init: Temporary process spawn error: No such file or directory
<3>init: Failed to create pty - disabling logging for job
<4>init: Temporary process spawn error: No such file or directory
<3>init: Failed to create pty - disabling logging for job
<4>init: Temporary process spawn error: No such file or directory
.
.
@slyness
slyness / gist:8292532
Created January 7, 2014 00:20
some more issue
elecksee status:
greenlantern :: Planet/ninefold/ninefold-test ‹master*› » gem query --local | grep elecksee
elecksee (1.0.18, 1.0.16, 1.0.10, 1.0.6, 1.0.4)
greenlantern :: Planet/ninefold/ninefold-test ‹master*› » bundle exec gem query --local | grep elecksee
elecksee (1.0.18)
greenlantern :: Planet/ninefold/ninefold-test ‹master*› » /opt/chef/embedded/bin/gem query --local | grep elecksee
elecksee (1.0.18, 1.0.16, 1.0.10, 1.0.6, 1.0.4)
New Error:
vagrant 1.4.2
vagabond 0.2.10
.vagabond/Cheffile
site 'http://community.opscode.com/api/v1'
cookbook 'vagabond', '1.0.4'
cookbook 'lxc', '1.1.4'
cookbook 'chef-server-populator', '0.3.0'
@slyness
slyness / gist:8063720
Created December 21, 2013 00:25
apt smash!
root@ubuntu_1204-orfqR8eue34M:/etc/apt/preferences.d# apt-cache policy wget
wget:
Installed: (none)
Candidate: 1.13.4-2ubuntu1
Version table:
1.13.4-2ubuntu1 0
999 http://apt.ninefold.slyness.org/ precise/ninefold amd64 Packages
500 http://archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
on 12.04
root@ubuntu_1204-Mp5FUZ2yj7JV:/opt/chef/embedded/bin# dpkg -l | grep whiptail
ii whiptail 0.52.11-2ubuntu10 Displays user-friendly dialog boxes from shell scripts
turns into:
"binary-Displays": {
"whiptail": [
"0.52.11-2ubuntu10"