RethinkDB: OpsWorks - rethinkdb

I'm interested in using RethinkDB as an OpsWorks Layer in my existing Stack but I'm having trouble getting my cookbooks to work. If someone has a cookbook repo they could share, or any pointers that would be fantastic.
OS: Ubuntu 12.04 LTS
Recipes used (Git submodules in my cookbook repo)
https://github.com/AVVSDevelopment/chef-rethinkdb
https://github.com/opscode-cookbooks/apt
I added rethink and rethink::start to the setup phase of the layer, but when it runs it can't find apt.
Any help would be greatly appreciated.

What is the exact error message you're getting?
One thing I see in the recipe is that the RethinkDB version is set to 1.7.1. The current version is 1.11.3 -- I'd try to set that in the recipe.

With a bit of digging, I was able to sort out many of the differences between OpsWorks Chef and official Chef releases. I've included all OpsWorks cookbooks and trimmed the RethinkDB on down to the basics. Now it works and I just have cleanup / replication. Thanks everyone!

Related

Unable to configure non-latest chef-dk install

Our organization has not upgraded to Chef 13 or 14, so we have to pin all our cookbooks to version 12. This means pinning to chef-dk version 1.6.11.
I'm spinning a centos7 vm in Vagrant with a cookbook and have set the version, but it will only install the Latest of chefdk, which results in the machine getting Chef 14. I've added a dependency in metadata.rb of chef_version ~> 12, so the provision fails, as Chef 14 is installed but the cookbook demands 12.
I should mention that the VM is for cookbook dev, so i want the right version of chef on it.
What am i missing to get the right version installed?
Thanks.
recipes/default.rb:
node.default['chef_dk']['version'] = '1.6.11'
node.default['chef_dk']['global_shell_init'] = true
include_recipe 'chef-dk'
metadata.rb:
depends 'chef-dk'
chef_version '~> 12.0'
berksfile:
cookbook 'chef-dk'
The part that is failing is the "outer" Chef, the thing running the recipe, not the ChefDK install (it never gets that far). We don't generally recommend using Chef to install ChefDK because installing both the chef-client and ChefDK installers on the same machine can lead to confusion as there are overlapping command line tools. I would provision the dev VM using a simpler system, probably a bash script or similar. We also do provide chef/chefdk Docker images on Hub for this kind of thing. (also we don't recommend doing cookbook development inside a VM at all, but I would guess that ship has sailed for you)

ICP 3.1.0 Vagrant support

*I used * [1]: https://github.com/IBM/deploy-ibm-cloud-private/blob/master/docs/deploy-vagrant.md
to install ICP 2.1.0.3 on my mac.
Does it support also ICP 3.1.0?
As of right now, I believe this tool cannot be used to install ICP 3.1.0 because the relevant icp-inception image has not been added to Docker Hub. When that image is available, the tool might work if you change the version parameter on line 22 in the Vagrantfile.
Even with the correct image, there may be other configuration steps that need to be taken such as changing the k8s_version or the memory requirements, since these have changed in 3.1.0.
EDIT: The image is now available on Docker Hub, but I have not tested configuring the vagrantfile to install 3.1.0 yet.
I used it successfully to install ICP 3.1 on my Linux PC. I just had to set
version = "3.1.0"
in the Vagrantfile.

chef workstation setup softwares required

I am trying to execute chef commands and build the server for that I did below setup on MacOS but observed that I need to have vagrant and virtualbox but I am not sure if I need to install it on host macOS machine or Virtual machine. Could you please suggest on this.
Setup which I did so far is as below:
On Mac OS I have installed VirtualBox and created a base ubuntu Virtual Machine
Then Inside virtual machine having ubuntu as OS installed ChefDk, Hosted chef server setup, knife and git
created chef-repo repository
In order to complete setup, Do I need to install vagrant and one more instance of Virtualbox inside virtual machine on ubuntu OS and do I need any additional installation?
Install ChefDK and Vagrant as well as VirtualBox on your workstation. This allows you to use any editor/IDE to edit cookbooks and then provision a VM using Vagrant and Virtualbox (or other supported hypervisors).
In general, I would recommend to follow Learn Chef.
Honestly, the question is a little confusion on your objective. But from a high level, i can assume that you are trying to get started with chef using the hosted chef server. First i agree with #StephenKing pointing you to the learn chef site. That's a good starting point. But here are some things that should clear up your question:
Typically there will be a development workstation. In your case its the MacBook. This is where you will install chefDK and write your fancy cookbooks. It should have the chef-repo, knife.rb etc to talk with the chef server.
Once your initial cookbook writting is over, you upload the cookbook and other params like environment, data_bags, roles etc to the chef server (in the chef-org)
Its here you need a node to apply your cookbook. As a starter, use some nodes from a VPS that's far more easier rather then trying to use vagrant nodes or something. As the saying goes "one step at a time". Do not try to learn chef and vagrant or even more (which is what you will encounter with chef) at the same time.
Once you have the node, bootstrap the node to your chef-org where the cookbooks were uploaded. Then run chef-client on the node.
And you are on your way to the chef world.

vagrant install plugin from github

We are using Vagrant for deployment and we'd eventually like to deploy this cluster on Rackspace. The vagrant-rackspace plugin is a natural choice, but it has a few bugs that are not included in the latest 0.1.1 release (notably that vagrant provision doesn't work). I've resolved this issue in my personal fork of the repository by merging work from others. Is it possible to do install a vagrant plugin from github?
The obvious thing didn't work:
[unix]$ vagrant plugin install vagrant-rackspace --plugin-source https://github.com/deanmalmgren/vagrant-rackspace
Installing the 'vagrant-rackspace' plugin. This can take a few minutes...
The plugin 'vagrant-rackspace' could not be found in local or remote
repositories. Please check the name of the plugin and try again.
I'm new to vagrant and ruby, so any pointers here would be greatly appreciated. Thanks!
As of today I see only two workarounds:
you could rake build the plugin, upload the resulting .gem to gemfury, and then use this as the --plugin-source.
you could install the plugin from a local source, e.g. vagrant plugin install /path/to/your/bugfixed.gem
In the end, I would love to see something like a Gemfile for Vagrant plugins. AFAIK there ain't no such thing yet but here is a feature request
EDIT: actually there is an awesome project called bindler now. The feature request to add git location support in bindler is still outstanding, but this is the place where it should be fixed imho

Chef: Upload and re-apply a cookbook to a Node

This is kind of a n00b question, but the Chef docs don't help.
Say I changed the code of a cookbook. I upload it to my chef server. Ho do I apply the changes to my nodes using this cookbook?
As Draco commented, you run Chef on your node(s). They will automatically download the changed files in the cookbook from the server.
sudo chef-client
If you're running Chef as a service (setup via Opscode's chef-client cookbook service recipe or otherwise), it will automatically run at some point. Since you're using a Chef Server, you can also use knife ssh to perform a search and run the command on multiple nodes at one time.
knife ssh "*:*" "sudo chef-client" -x youruser
Replace ":" with any Chef Search Query.
Also, this is where Environments are useful, in that you can pin particular versions of cookbooks to nodes in an environment, so they don't get the changes that were made in the cookbook until you modify the version they're allowed to use. For example, if you have version 1.0.0 of your cookbook, and pin "production" to that ("= 1.0.0"), then increment the version (1.0.1) before uploading, then production nodes won't get the new version until the version in the environment is updated to the newer version.

Resources