hit counter

Timeline

My development logbook

Providing Mysqld Password to Chef Provisioner in Vagrant

I add a chef mysqld receipt to the Vagrant file and here is the error from vagrant up:

    ==> default: Required argument password is missing!
    ==> default:
    ==> default: Cookbook Trace:
    ==> default: ---------------
    ==> default:   /tmp/vagrant-chef/3aa2e36871bb373e4212367ce1b7d9af/cookbooks/mysqld/recipes/configure.rb:26:in `block in from_file'
    ==> default:   /tmp/vagrant-chef/3aa2e36871bb373e4212367ce1b7d9af/cookbooks/mysqld/recipes/configure.rb:25:in `from_file'
    ==> default:   /tmp/vagrant-chef/3aa2e36871bb373e4212367ce1b7d9af/cookbooks/mysqld/recipes/default.rb:22:in `from_file'
    ==> default:
    ==> default: Relevant File Content:
    ==> default: ----------------------
    ==> default: /tmp/vagrant-chef/3aa2e36871bb373e4212367ce1b7d9af/cookbooks/mysqld/recipes/configure.rb:
    ==> default:
    ==> default:  19:  #
    ==> default:  20:
    ==> default:
    ==> default:  21:  # Configure mysql/mariadb according to attributes
    ==> default:  22:  mysqld 'default'
    ==> default:  23:
    ==> default:  24:  # Set password according to attribute, if set
    ==> default:  25:  mysqld_password 'root' do
    ==> default:  26>>   password node['mysqld']['root_password']
    ==> default:
    ==> default:  27:    only_if { node['mysqld']['root_password'] }
    ==> default:  28:  end
    ==> default:  29:

Solution: Add this to set the root_password:

chef.json = {
  :mysqld   => {
    :root_password => "test"
  }
}

Now you can connect to the mysql server by running

 mysql -u root -p 

Cannot Find a Resource Matching Ruby_block[sensu_service_trigger]

This the error message:

    ==> default: ================================================================================
    ==> default: Error executing action `enable` on resource 'sensu_service[sensu-client]'
    ==> default: ================================================================================
    ==> default:
    ==> default: Chef::Exceptions::ResourceNotFound
    ==> default: ----------------------------------
    ==> default: Cannot find a resource matching ruby_block[sensu_service_trigger] (did you define it first?)
    ==> default:
    ==> default: Cookbook Trace:
    ==> default: ---------------
    ==> default: /tmp/vagrant-chef/c66d06dac7e6e1e4d559122d4d1a9f5c/cookbooks/sensu/providers/service.rb:52:in `block in load_current_resource'

It is because I did not include the sensu::default cookbook.

Brew and Cast

Reinstalling cask on another mac. Thought it is the command to install cask brew subcommand:

brew install cask

Wrong! This cask is actually an emacs package manager.

To install brew cask, it is the command:

brew tap caskroom/cask

Ochiwa Unable to Connect to Sensu

I used chef to install sensu and ochiwa.

In the ocihwa log I see a lot of ‘connection refused’ error

{"Date":"2015-02-05T09:42:23.516606749Z","Level":"warning","Src":{"Func":"github.com/sensu/uchiwa/uchiwa.Build","Line":49},"Output":"API call to \"http://127.0.0.1:4567/stashes\" returned: Get http://127.0.0.1:4567/stashes: dial tcp 127.0.0.1:4567: connection refused"}

With help from sensu irc chatroom, I checked

netstat -anp | grep 4567

There is no process.

service sensu-api status

The service is stopped.

After starting the service, ochiwa can talk to sensu server now.

Mandrill Is Sending Me a Strange Template Name

I have originally created a template hello_world. Then I renamed it to sayhi. Somehow the Template Slug stays as hello-world: in the webhook payload the template name carries hello-world instead of the new name sayhi