Giter Club home page Giter Club logo

spiceweasel's Introduction

Build Status Code Climate

NO LONGER UNDER DEVELOPMENT

Spiceweasel has not been under active development for awhile, so I'm archiving the project unless there is some resurgence in interest. It was last tested with Chef 11, 13 is out now and 14 is coming April 2018.

Description

Spiceweasel is a command-line tool for batch loading Chef infrastructure. It provides a simple syntax in Ruby, JSON or YAML for describing and deploying infrastructure in order with the Chef command-line tool knife. This manifest may be bundled with a Chef repository to deploy the infrastructure contained within the repository and validate that the components listed are all present. The manifest may also be extracted from an existing repository.

The https://github.com/mattray/lab-repo provides a working example for bootstrapping a Chef repository with Spiceweasel.

The CHANGELOG.md covers current, previous and future development milestones and contains the features backlog.

Requirements

Spiceweasel currently depends on knife to run commands for it, and requires the chef gem for validating cookbook metadata. Berkshelf is a dependency for the Cookbook Berksfile support. Infrastructure files must end in .rb, .json or .yml to be processed.

Written and tested with the Chef 11.x series (previous versions of Chef may still work). It is tested with Ruby 1.9.3. Version 2.0 was the last version known to work with Ruby 1.8.7 due to the introduction of the Berkshelf dependency in 2.1. If you want to use Ruby 2.0, you will need to use the Chef 11.6 (or later) gem.

File Syntax

The syntax for the Spiceweasel file may be Ruby, JSON or YAML format of Chef primitives describing what is to be instantiated. Please refer to the test/examples/example.json or test/examples/example.yml for examples of the same infrastructure. Each subsection below shows the YAML syntax converted to knife commands.

Cookbooks

The cookbooks section of the manifest currently supports knife cookbook upload FOO where FOO is the name of the cookbook in the cookbooks directory. The default behavior is to download the cookbook as a tarball, untar it and remove the tarball. The --siteinstall option will allow for use of knife cookbook site install with the cookbook and the creation of a vendor branch if git is the underlying version control. Validation is done to ensure the cookbook matches the name (and version if given) in the metadata and that any cookbook dependencies are listed in the manifest. You may pass any additional options if necessary. Assuming the apt cookbook was not present, the example YAML snippet

cookbooks:
- apache2:
- apt:
    version: 1.2.0
    options: --freeze
- mysql:
- ntp:

produces the knife commands

knife cookbook upload apache2
knife cookbook site download apt 1.2.0 --file cookbooks/apt.tgz
tar -C cookbooks/ -xf cookbooks/apt.tgz
rm -f cookbooks/apt.tgz
knife cookbook upload apt --freeze
knife cookbook upload mysql ntp

Berkshelf

If you prefer to use Berkshelf for managing your cookbooks, Spiceweasel supports adding berksfile: and the ability to specify the path and any Berkshelf options. You may mix use of berksfile: with cookbooks: if you wish as well. Berkshelf-managed cookbooks will be included in the validation of roles, environments and run lists as well. You may simply use the YAML snippet

berksfile:

which produces the command

berks upload -b ./Berksfile

or you may use additional options like

berksfile:
    path: '/Users/mray/ws/lab-repo/Berksfile'
    options: '--skip_syntax_check --config some_config.json'

which produces the output

berks upload --skip_syntax_check --config some_config.json -b /Users/mray/ws/lab-repo/Berksfile

Environments

The environments section of the manifest currently supports knife environment from file FOO where FOO is the name of the environment file ending in .rb or .json in the environments directory. You may also pass a wildcard as an entry to load all matching environments (ie. "*" or prod*"). Validation is done to ensure the filename matches the environment and that any cookbooks referenced are listed in the manifest. The example YAML snippet

environments:
- development:
- qa:
- "prod*":

assuming the production environment exists, produces the knife commands

knife environment from file development.rb qa.rb production.rb

Roles

The roles section of the manifest currently supports knife role from file FOO where FOO is the name of the role file ending in .rb or .json in the roles directory. You may also pass a wildcard as an entry to load all matching roles (ie. "*" or data*"). Validation is done to ensure the filename matches the role name and that any cookbooks or roles referenced are listed in the manifest. The example YAML snippet

roles:
- base:
- "data*":
- iisserver:
- monitoring:
- webserver:

assuming the database1.json and database2.json roles exist, this produces the knife commands

knife role from file base.rb database1.json database2.json iisserver.rb monitoring.rb webserver.rb

Data Bags

The data bags section of the manifest currently creates the data bags listed with knife data bag create FOO where FOO is the name of the data bag. Individual items may be added to the data bag as part of a JSON or YAML sequence, the assumption is made that they .json files and in the proper data_bags/FOO directory. You may also pass a wildcard as an entry to load all matching data bags (ie. "*" or "data*"). Encrypted data bags are supported by using the secret: secret_key_filename attribute. Validation is done to ensure the JSON is properly formatted, the id matches and any secret key files are in the correct locations. Assuming the presence of dataA.json and dataB.json in the data_bags/data directory, the YAML snippet

data bags:
- users:
    items:
    - alice
    - bob
    - chuck
- data:
    items:
    - "*"
- passwords:
    secret: secret_key_filename
    items:
    - mysql
    - rabbitmq

produces the knife commands

knife data bag create users
knife data bag from file users alice.json bob.json chuck.json
knife data bag create data
knife data bag from file data dataA.json dataB.json
knife data bag create passwords
knife data bag from file passwords mysql.json rabbitmq.json --secret-file secret_key_filename

Nodes

The nodes section of the manifest bootstraps a node for each entry given a hostname or a provider with a count. Windows nodes need to specify either windows_winrm or windows_ssh depending on the protocol used, followed by the name of the node(s). Each node may have a run_list and options. The run_list may be space or comma-delimited. Validation is performed on the run_list components to ensure that only cookbooks and roles listed in the manifest are used. Validation on the options ensures that any environments referenced are also listed. You may specify multiple nodes to have the same configuration by listing them separated by a space. If you want to give your nodes names, simply pass -N NAME{{n}} or --node-name NAME{{n}} and the {{n}} will be substituted by a number. The example YAML snippet

nodes:
- serverA:
    run_list: role[base]
    options: -i ~/.ssh/mray.pem -x user --sudo
- serverB serverC:
    run_list: role[base]
    options: -i ~/.ssh/mray.pem -x user --sudo -E production
- rackspace 3:
    run_list: recipe[mysql],role[monitoring]
    options: --image 49 --flavor 2 -N db{{n}}
- windows_winrm winboxA:
    run_list: role[base],role[iisserver]
    options: -x Administrator -P 'super_secret_password'
- windows_ssh winboxB winboxC:
    run_list: role[base],role[iisserver]
    options: -x Administrator -P 'super_secret_password'

produces the knife commands

knife bootstrap serverA -i ~/.ssh/mray.pem -x user --sudo -r 'role[base]'
knife bootstrap serverB -i ~/.ssh/mray.pem -x user --sudo -E production -r 'role[base]'
knife bootstrap serverC -i ~/.ssh/mray.pem -x user --sudo -E production -r 'role[base]'
knife rackspace server create --image 49 --flavor 2 --node-name db1.example.com -r 'recipe[mysql],role[monitoring]'
knife rackspace server create --image 49 --flavor 2 --node-name db2.example.com -r 'recipe[mysql],role[monitoring]'
knife rackspace server create --image 49 --flavor 2 --node-name db3.example.com -r 'recipe[mysql],role[monitoring]'
knife bootstrap windows winrm winboxA -x Administrator -P 'super_secret_password' -r 'role[base],role[iisserver]'
knife bootstrap windows ssh winboxB -x Administrator -P 'super_secret_password' -r 'role[base],role[iisserver]'
knife bootstrap windows ssh winboxC -x Administrator -P 'super_secret_password' -r 'role[base],role[iisserver]'

Providers

The following knife plugins are currently supported as providers: bluebox, clodo, cs, digital_ocean, ec2, gandi, google, hp, joyent, kvm, linode, lxc, openstack, rackspace, slicehost, terremark, vagrant, voxel and vsphere.

Bulk node creation

You may also use the --parallel flag from the command line, allowing provider commands to run simultaneously for faster deployment. Using --parallel with the following block and the -N webserver{{n}}:

nodes:
- ec2 3:
  - role[webserver]
  - -S mray -i ~/.ssh/mray.pem -x ubuntu -G default -I ami-7000f019 -f m1.small -N webserver{{n}}

produces the following

seq 3 | parallel -j 0 -v "knife ec2 server create -S mray -i ~/.ssh/mray.pem -x ubuntu -G default -I ami-7000f019 -f m1.small -N webserver{} -r 'role[base],role[tc],role[users]'"

which generates nodes named "webserver1", "webserver2" and "webserver3".

Clusters

Clusters are not a type supported by Chef, this is a logical construct added by Spiceweasel to enable managing sets of infrastructure together. The clusters section is a special case of nodes, where each member of the named cluster in the manifest will be put in the same Environment to ensure that the entire cluster (every node in the Environment) may be created and destroyed in sync. The node syntax is the same as that under nodes, the only addition is the cluster name.

clusters:
- amazon:
  - ec2 1:
      run_list: role[mysql]
      options: -S mray -i ~/.ssh/mray.pem -x ubuntu -G default -I ami-8af0f326 -f m1.medium
  - ec2 3:
      run_list: role[webserver] recipe[mysql::client]
      options: -S mray -i ~/.ssh/mray.pem -x ubuntu -G default -I ami-7000f019 -f m1.small

produces the knife commands

knife ec2 server create -S mray -i ~/.ssh/mray.pem -x ubuntu -G default -I ami-8af0f326 -f m1.medium -E amazon -r 'role[mysql]'
knife ec2 server create -S mray -i ~/.ssh/mray.pem -x ubuntu -G default -I ami-7000f019 -f m1.small -E amazon -r 'role[webserver],recipe[mysql::client]'
knife ec2 server create -S mray -i ~/.ssh/mray.pem -x ubuntu -G default -I ami-7000f019 -f m1.small -E amazon -r 'role[webserver],recipe[mysql::client]'
knife ec2 server create -S mray -i ~/.ssh/mray.pem -x ubuntu -G default -I ami-7000f019 -f m1.small -E amazon -r 'role[webserver],recipe[mysql::client]'

Another use of clusters is with the --cluster-file option, which will allow the use of a different file to define the members of the cluster. If there are any nodes or clusters defined in the primary manifest file, they will be removed and the content of the --cluster-file will be used instead. This allows you to switch the target destination of infrastructure by picking different --cluster-file endpoints.

options

The options section provides the ability to pass global options to all nodes being created.

options: -i ~/.ssh/mray.pem
nodes:
- serverA:
    run_list: role[base]
    options: -x user --sudo
clusters:
- amazon:
  - ec2 1:
      run_list: role[mysql]
      options: -S mray -x ubuntu -G default -I ami-8af0f326 -f m1.medium

produces the knife commands

knife bootstrap serverA -x user --sudo -r -i ~/.ssh/mray.pem 'role[base]'
knife ec2 server create -S mray -x ubuntu -G default -I ami-8af0f326 -f m1.medium -E amazon -i ~/.ssh/mray.pem -r 'role[mysql]'

knife

The knife section allows you to run arbitrary knife commands after you have deployed the infrastructure specified in the rest of the manifest. Validation is done to ensure that the knife commands called are installed on the system. The example YAML snippet

knife:
- ssh:
  - "'role:monitoring' 'sudo chef-client' -x user"
- rackspace server delete:
  - -y --node-name db3 --purge
- vsphere:
  - vm clone --bootstrap --template 'abc' my-new-webserver1
  - vm clone --bootstrap --template 'def' my-new-webserver2
- vsphere vm clone:
  - --bootstrap --template 'ghi' my-new-webserver3

assumes the knife-rackspace and knife-vsphere plugins are installed and produces the knife commands

knife ssh 'role:monitoring' 'sudo chef-client' -x user
knife rackspace server delete -y --node-name db3 --purge
knife vsphere vm clone --bootstrap --template 'abc' my-new-webserver1
knife vsphere vm clone --bootstrap --template 'def' my-new-webserver2
knife vsphere vm clone --bootstrap --template 'ghi' my-new-webserver3

Extract

Spiceweasel may be used to generate knife commands or Spiceweasel manifests in JSON or YAML from an existing Chef repository.

spiceweasel --extractlocal

When run in your Chef repository generates the knife commands required to upload all the existing infrastructure that is found in the cookbooks, roles, environments and data bags directories with validation.

spiceweasel --extractjson

When run in your Chef repository generates JSON-formatted output that may be captured and used as your Spiceweasel manifest file.

spiceweasel --extractyaml

When run in your Chef repository generates YAML-formatted output that may be captured and used as your Spiceweasel manifest file.

Usage

To parse a Spiceweasel manifest, run the following from your Chef repository directory:

spiceweasel path/to/infrastructure.yml

or to extract infrastructure

spiceweasel --extractlocal

This will generate the knife commands to build the described infrastructure. Infrastructure manifest files must end in either .json or .yml.

OPTIONS

--bulkdelete

When using the delete or rebuild commands, whether or not to attempt to delete all nodes managed by a provider. The assumption is that if Spiceweasel manages all the nodes, it is safe to delete them all.

-c/--knifeconfig

Specify a knife.rb configuration file to use with the knife commands.

--chef-client

This will generate the knife commands to run the chef-client on each of the nodes in the manifest. The nodes refreshed will be matched by node name, environment for clusters and by cloud provider run list otherwise.

knife ssh 'name:*' 'sudo chef-client' knife ssh 'role:base and recipe:apt::cacher-ng' 'uptime' knife ssh "role:web"

You may also use -a or --attribute to specify an attribute to use with knife ssh.

--cluster-file

Specify the file to use to override the nodes and clusters from the primary manifest file. This allows you to switch the target destination of infrastructure by picking different --cluster-file endpoints.

--debug

This provides verbose debugging messages.

-d/--delete

The delete option will generate the knife commands to delete the infrastructure described in the manifest. This includes each cookbook, environment, role, data bag and node listed. Node deletion will specify individual nodes and their clients, and attempt to pass the list of nodes to the cloud provider for deletion, and finish with knife node bulk delete. If you are mixing individual nodes with cloud provider nodes it is possible that nodes may be missed from cloud provider deletion and you should double-check (ie. knife ec2 server list). Some knife plugins do not use the node name as the ID, so they may fail at deletion (knife-rackspace for example).

-e/--execute

The execute option will directly execute the knife commands, creating (or deleting or rebuilding) the infrastructure described in the manifest.

--extractlocal

When run in a chef repository, this will print the knife commands to be run.

--extractjson

When run in a chef repository, this will print a new JSON manifest that may be used as input to spiceweasel.

--extractyaml

When run in a chef repository, this will print a new YAML manifest that may be used as input to spiceweasel.

-h/--help

Print the currently-supported usage options for spiceweasel.

--node-only

Loads from JSON or creates nodes on the server without bootstrapping, useful for pre-creating nodes. If you specify a run list with the node, it will override any run list specified within the JSON file.

--novalidation

Disable validation ensuring existence of the cookbooks, environments, roles, data bags and nodes in infrastructure file.

--parallel

Use the GNU 'parallel' command to execute 'knife VENDOR server create' commands that may be run simultaneously.

-r/--rebuild

The rebuild option will generate the knife commands to delete and recreate the infrastructure described in the manifest. This includes each cookbook, environment, role, data bag and node listed.

--siteinstall

Use the 'install' command with 'knife cookbook site' instead of the default 'download'.

-v/--version

Print the version of spiceweasel currently installed.

Testing

Spiceweasel uses RSpec for testing. You should run the following before commiting.

$ rspec test

License and Author

Author Matt Ray ([email protected])
Copyright Copyright (c) 2011-2014, Chef Software, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

spiceweasel's People

Contributors

auser avatar cgriego avatar chrisroberts avatar colinrymer avatar elliotcm avatar fnichol avatar gmacid avatar hh avatar mattray avatar miketheman avatar rberger avatar rickmzp avatar spheromak avatar tpbrown avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spiceweasel's Issues

resolve_cookbooks still being called even when `--only nodes` is specified

My limited understanding is that this should not happen. Anyway...

NOTE: This was run against the 2.8 branch.

Output tells all:

$ be spiceweasel --loglevel debug --debug --extractlocal ./spiceweasel/manifest.yml --only nodes
DEBUG: No chefignore file found at /Users/eherot/git_repos/evertrue/chefignore no files will be ignored
WARN: found a directory tmp in the cookbook path, but it contains no cookbook files. skipping.
DEBUG: dir_ext: apache_storm 3.0.0
DEBUG: dir_ext: application 2.0.4
DEBUG: dir_ext: application_nginx 1.1.0

Contents of ./spiceweasel/manifest.yml:

clusters:
- stage:
  - ec2 2:
    run_list: recipe[et_base]
    options: -flavor c3.large -g sg-c204d2a7 -N stage-test-eherot-N{{n}} -s subnet-a792da8f -E stage

Passing a number in a sequence to `knife create`

In my scenario, I have a convention of setting the hostname to be .

So if running spcieweasel on ec2 6:

I would have to output:

knife ec2 server .... -N foobar1.com
knife ec2 server .... -N foobar2.com
....
knife ec2 server .... -N foobar6.com

Can this be done with something like string interpretation, or some other mechanism?

Please add variable substitution

It would be nice for Spiceweasel to have the ability to dynamically replace variables at runtime.

For example, it would be nice to be able to set a Spiceweasel variable "password" to "mysecret123" and use a replacement string throughout the rest of the manifest file. Furthermore, it would also be nice to have the ability to not only define key/value pairs for variables, but also to define key/special_value variables that allow prompting the user at runtime (eg: prompting for a sensitive password that cannot be stored in plaintext).

As a possible path to take (assuming 2 special strings, prompt_for_password (no echo) and prompt_for_text (echo)):

variables:
- root_password:
    value: "prompt_for_password"
- admin_user_name:
    value: "prompt_for_text"
- mray_pem_file:
    value: "~/.ssh/mray.pem"

nodes:
- serverA:
    run_list: role[base]
    options: -i <%= variables[:mray_pem_file] %> -x <%= variables[:admin_user_name] %> --sudo -P <%= variables[:root_password] %>

Please mention "name:" in the README and/or the examples

Hi,

without knowing about the name: option introduced with #32 it's way to easy to delete infrastructure that is not described in the manifest.

For example, the manifest

berkshelf:
environments:
- testing:
roles:
- appnode:
clusters:
  - testing:
    - openstack 2:
      run_list: role[appnode]
      options: -f 2 -I IMAGEID -S KEYNAME -x root -N app{{n}}

used with spiceweasel -r ex.yml goes bulk_delete and does this:

knife node list | xargs knife openstack server delete -y

which helps me getting rid of way more than "the infrastructure described in the manifest".

With the manifest like this (snippet),

    - openstack 2:
      name: app{{n}}
      run_list: role[appnode]
      options: -f 2 -I IMAGEID -S KEYNAME -x root -N app{{n}}

everything is fine.

If this is a misunderstanding on my side, please help me catching on...

--chef-client produces lower-case search query

--chef-client produces:

knife ssh 'name:box1.foo.com and chef_environment:production and role:production-base' 'chef-client'

this returns the wrong results using Chef: 11.12.8

if I upper-case the boolean logic, it works fine

knife ssh 'name:box1.foo.com AND chef_environment:production AND role:production-base' 'chef-client'

Reference:
"Operators must be in ALL CAPS. Parentheses can be used to group clauses and to form sub-queries."
https://docs.getchef.com/knife_search.html

Please add ordered generic knife command support

It would be nice if Spiceweasel supported a set of arbitrary knife commands after the the initial meta data sections today that load the Chef Server.

This would be useful for executing commands to deploy servers (knife vsphere vm clone), bootstrap servers (knife bootstrap), execute runlists on those servers (knife ssh) and allow users to have some level of deployment orchestration with Spiceweasel.

An implementation option would be a new section called "commands" that would be executed in the order they were defined.

data_bag should be encrypted only if secret: is passed

We are using knife.rb to pass the path of our secret files, but this cause spiceweasel to encrypt all of our data bags, even if we didn't use secret: . The configuration in knife.rb should only be used to allow not to write the path. The data bag should be encrypted only if there is the secret: flag.

Request: Bulk node creation, allow for asynchronous layer creation?

It would be really great if there were a way to specify a layers in a bulk-provision environment that can come up asynchronously.

clusters:
- drupal:
  - ec2 1:
      run_list: role[drupal_lb]
      options: -i ~/bwolfe.pem -x ubuntu -I SNIP --region us-east-1 -Z us-east-1c
        -g SNIP --subnet SNIP -N bwolfe-drupal-lb-{{n}} -S bwolfe
  - ec2 1:
      run_list: role[drupal_db]
      options: -i ~/bwolfe.pem -x ubuntu -I SNIP --region us-east-1 -Z us-east-1c
        -g SNIP --subnet SNIP -N bwolfe-drupal-db-{{n}} -S bwolfe
  - ec2 2:
      run_list: role[drupal_elasticsearch]
      options: -i ~/bwolfe.pem -x ubuntu -I SNIP --region us-east-1 -Z us-east-1c
        -g SNIP --subnet SNIP -N bwolfe-drupal-es-{{n}} -S bwolfe
  - ec2 3:
      run_list: role[drupal_web]
      options: -i ~/bwolfe.pem -x ubuntu -I SNIP --region us-east-1 -Z us-east-1c
        -g SNIP --subnet SNIP -N bwolfe-drupal-web-{{n}} -S bwolfe

In this example, after the load balancer and database servers are up, the web servers and the elasticsearch boxes can safely come up in parallel, It would be nice to be able to have spiceweasel generate those commands so they're executed at the same time.

This idea could be represented like this (notice the & on ec2 2):

clusters:
- drupal:
  - ec2 1:
      run_list: role[drupal_lb]
      options: -i ~/bwolfe.pem -x ubuntu -I SNIP --region us-east-1 -Z us-east-1c
        -g SNIP --subnet SNIP -N bwolfe-drupal-lb-{{n}} -S bwolfe
  - ec2 1:
      run_list: role[drupal_db]
      options: -i ~/bwolfe.pem -x ubuntu -I SNIP --region us-east-1 -Z us-east-1c
        -g SNIP --subnet SNIP -N bwolfe-drupal-db-{{n}} -S bwolfe
  - ec2 2&:
      run_list: role[drupal_elasticsearch]
      options: -i ~/bwolfe.pem -x ubuntu -I SNIP --region us-east-1 -Z us-east-1c
        -g SNIP --subnet SNIP -N bwolfe-drupal-es-{{n}} -S bwolfe
  - ec2 3:
      run_list: role[drupal_web]
      options: -i ~/bwolfe.pem -x ubuntu -I SNIP --region us-east-1 -Z us-east-1c
        -g SNIP --subnet SNIP -N bwolfe-drupal-web-{{n}} -S bwolfe

That would generate commands similar to:

seq 1 | parallel -u -j 0 -v -- knife ec2 server create -i ~/bwolfe.pem -x ubuntu -I SNIP --region us-east-1 -Z us-east-1c -g SNIP --subnet SNIP -N bwolfe-drupal-lb-{} -S bwolfe -E drupal -r 'role[drupal_lb]'
seq 1 | parallel -u -j 0 -v -- knife ec2 server create -i ~/bwolfe.pem -x ubuntu -I SNIP --region us-east-1 -Z us-east-1c -g SNIP --subnet SNIP -N bwolfe-drupal-db-{} -S bwolfe -E drupal -r 'role[drupal_db]'
seq 2 | parallel -u -j 0 -v -- knife ec2 server create -i ~/bwolfe.pem -x ubuntu -I SNIP --region us-east-1 -Z us-east-1c -g SNIP --subnet SNIP -N bwolfe-nagios-test-{} -S bwolfe -E drupal -r 'role[drupal_elasticsearch]' &
seq 3 | parallel -u -j 0 -v -- knife ec2 server create -i ~/bwolfe.pem -x ubuntu -I SNIP --region us-east-1 -Z us-east-1c -g SNIP --subnet SNIP -N bwolfe-drupal-web-{} -S bwolfe -E drupal -r 'role[drupal_web]'

(Note the presence of & at the end of line 3, effectively executing the knife create commands for both drupal_elasticsearch boxes and drupal_web boxes in parallel)

Does spiceweasel support azure?

Hi all,

I want to use spiceweasel for batch loadinig azure infrastructure. Does anyone know whether spiceweasel support azure?

Thanks,
Jin

Google Support

There's no support for google. There's a knife-google plugin, so this tool should also support google.

[Feature] Allow bootstrap of a chef server

This is mostly to get a discussion started. Many times with tools like Vagrant, or SpiceWeasel, etc, etc... the first thing I have to do is spin up a chef server. (Think testing a cluster setup, testing books done by QE/Support, or from scratch testing, or Jenkins), etc.

Now, installing Chef Server is easy, but firing up an instance, installing chef server and doing all that jazz takes me outside of the tools used for the rest of the process. Aka, I have to do all of that first, then fire up spice weasel. Yes, I can create Rakefiles, and knife plugins, and more glue, and even more glue. But this gets dirty/complex.

If would be nice to be able to have it so I could use spiceweasel for the entire process.

Segmentation fault when calling spiceweasel

I'm trying to use spiceweasel in conjunction with https://github.com/stackforge/openstack-chef-repo. When I call spiceweasel infrastructure.yml, I get a segmentation fault that suggests a bug in Ruby itself or some extension library. The full output is at https://gist.github.com/scassiba/9480e23cc52b858e6ab4

What I've done:

I'm fully willing to blame my local environment for the segmentation fault, but the failure with ChefDK is probably worth a look as well.

Delta deployments

Feature request:

We face the same issue that Facebook had: how to keep our source control in sync with our Chef server(s). Spiceweasel does a great job here but it can't handle delta deployments.
As I see it upon running spiceweasel anything not in the manifest should be deleted from the server.

Does not work with .json infra files downloaded with: knife download

Hi,

today tried to run spiceweasel on infra downloaded with knife download ..

I got error messages like:

/gems/1.9.1/gems/spiceweasel-2.6.0/lib/spiceweasel/roles.rb:85:in `validate': undefined method `name' for #<Hash:0x3890c40> (NoMethodError)
        from c:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/spiceweasel-2.6.0/lib/spiceweasel/roles.rb:49:in `block in initialize'
        from c:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/spiceweasel-2.6.0/lib/spiceweasel/roles.rb:37:in `each'
        from c:/opscode/chef/embedded/lib/ruby/gems/1.9.1/gems/spiceweasel-2.6.0/lib/spiceweasel/roles.rb:37:in `initialize'

Looks like e.g.

c_role = Chef::JSONCompat.from_json(IO.read(file))

returns hash, not role object and further calls to ``c_role` methods fail.

Regards,

New buff-extensions problem.

Hi,

On a Ubuntu 14.04 with Ruby 1.9.3, I have the following dependances problems:
gem install spiceweasel
ERROR: While executing gem ... (Gem::DependencyError)
Unable to resolve dependencies: ridley requires buff-extensions (> 0.3); buff-config requires buff-extensions (> 0.3); varia_model requires buff-extensions (~> 1.0)

Installing both versions of buff-extensions make spiceweasel install working but when I launch the command this conflict problem appear:
/usr/lib/ruby/1.9.1/rubygems/specification.rb:1637:in `raise_if_conflicts': Unable to activate buff-config-0.4.0, because buff-extensions-1.0.0 conflicts with buff-extensions (~> 0.3) (Gem::LoadError)

I try to upgrade ridley and buff_config, no change.
Try to uninstall old ridley version but spiceweasel absolutly want ridley (~> 1.7.0).

Can you help me ?

Thanks.

Data bag wildcard syntax errors out

Env:
ruby 1.9.3-p392
chef 11.4.0
spiceweasel 2.1.2

from yml file:

data bags:
  - users:
      items:
      - "*"

From execution:

$ knife data bag from file users *.json miketheman.json
ERROR: Could not find or open file '*.json' in current directory or in 'data_bags/users/*.json'

Unless the syntax of invoking this has changed?

Support bundler for berkshelf/knife

If bundler is in use, fix paths to knife and berks.

$ bundle exec env | grep BUN
BUNDLE_BIN_PATH=/usr/share/rubygems-integration/1.9.1/gems/bundler-1.3.5/bin/bundle
BUNDLE_GEMFILE=/home/ctracey/src/git/craigtracey/unleashed/chef/Gemfile

cluster delete throws an error

The error:
/Users/alexandrerussel/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/spiceweasel-2.6.0/lib/spiceweasel/execute.rb:29:in block in initialize': undefined methodcommand' for #String:0x007fb3a5c54760 (NoMethodError)
from /Users/alexandrerussel/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/spiceweasel-2.6.0/lib/spiceweasel/execute.rb:27:in each' from /Users/alexandrerussel/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/spiceweasel-2.6.0/lib/spiceweasel/execute.rb:27:ininitialize'
from /Users/alexandrerussel/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/spiceweasel-2.6.0/lib/spiceweasel/cli.rb:198:in new' from /Users/alexandrerussel/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/spiceweasel-2.6.0/lib/spiceweasel/cli.rb:198:inrun'
from /Users/alexandrerussel/.rbenv/versions/1.9.3-p392/lib/ruby/gems/1.9.1/gems/spiceweasel-2.6.0/bin/spiceweasel:23:in <top (required)>' from /Users/alexandrerussel/.rbenv/versions/1.9.3-p392/bin/spiceweasel:23:inload'
from /Users/alexandrerussel/.rbenv/versions/1.9.3-p392/bin/spiceweasel:23:in `

'

it seems from:
https://github.com/mattray/spiceweasel/blob/master/lib/spiceweasel/clusters.rb line 53 that @delete is an array of String, not Command like @create, making execute.rb unhappy.

Running the command without -e outputs the correct commands.

Verification fails with "Cookbook does not match the name in metadata.rb"

Issue has been seen with Chef 11.16.2-1 and spiceweasel 2.5.1, 2.6.0 and the 2.8 branch.

With a minimal chef repo containing the "zsh" community cookbook (https://supermarket.getchef.com/cookbooks/zsh) and a spiceweasel infrastructure.yml file containing only the zsh cookbook (and empty roles, etc), running "spiceweasel infrastructure.yml" returns:

ERROR: Cookbook 'zsh' does not match the name 'zsh' in zsh/metadata.rb.

This appears to be a result of Chef loading the cookbook metadata with the cookbook name as a symbol, so when spiceweasel attempts to verify the cookbook name, it compares a string to a symbol and the comparison fails. By forcing the metadata.name to a string, it appears to work as intended.

I added a #to_s to the metadata.name message in lib/spiceweasel/cookbooks.rb, line 112 in the "cookbook != metadata.name" test, and it appears to have solved the issue for me, but I don't know if that's the right/best/useful way to fix the issue.

Zero padding with {{n}}

From:
fc034db#commitcomment-4532794

When it comes to the {{n}} formatting, zero padding would be nice, since having "server-01" ... "server-12" is easier to scan and sort than "server-1" to "server-12".

The code has all the information it would need to do so:

count = 12 # an example
digits = count.to_s.length
zero_padded = "%0*i" % [digits, i + 1]
the_string_from_above.gsub(/{{n}}/, zero_padded)

(That's one of my favorite printf tricks.)

Maybe you'd rather keep {{n}} as is? Perhaps we could use {{0n}} for zero-padding?

can't convert String into Integer (TypeError)

I wrote .yml like these lines...

cookbooks:
- test:

roles:
- base:
- web:

nodes:
- serverA:
    - role[base]
    - -i ~/.ssh/mray.pem -x user --sudo -d ubuntu10.04-gems

and when I did spiceweasel with this .yml, I got these errors.

/home/thirai/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/spiceweasel-2.0.1/lib/spiceweasel/nodes.rb:36:in `[]': can't convert String into Integer (TypeError)
        from /home/thirai/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/spiceweasel-2.0.1/lib/spiceweasel/nodes.rb:36:in `block in initialize'
        from /home/thirai/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/spiceweasel-2.0.1/lib/spiceweasel/nodes.rb:31:in `each'
        from /home/thirai/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/spiceweasel-2.0.1/lib/spiceweasel/nodes.rb:31:in `initialize'
        from /home/thirai/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/spiceweasel-2.0.1/lib/spiceweasel/cli.rb:150:in `new'
        from /home/thirai/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/spiceweasel-2.0.1/lib/spiceweasel/cli.rb:150:in `run'
        from /home/thirai/.rbenv/versions/1.9.2-p320/lib/ruby/gems/1.9.1/gems/spiceweasel-2.0.1/bin/spiceweasel:23:in `'
        from /home/thirai/.rbenv/versions/1.9.2-p320/bin/spiceweasel:23:in `load'
        from /home/thirai/.rbenv/versions/1.9.2-p320/bin/spiceweasel:23:in `'

Do you have any idea ?

configure spiceweasel to ignore invalid/unknown ssl cert

hi,
am new to this so apologies if i'm asking in the wrong place.

I'm trying to deploy openstack using:
https://github.com/stackforge/openstack-chef-repo/tree/stable/icehouse

when i run

spiceweasel -e infrastructure.yml
FATAL: There was an error connecting to the Chef Server
ERROR: Server returned error for https://my.chef.server.url/environments/example, retrying 1/5 in 3s

if i try wget I can see it's because server doesn't know abt ssl cert.

$ wget  https://my.chef.server.url/environments/example
--2014-10-09 11:15:13--  https://my.chef.server.url/environments/example
...
ERROR: cannot verifymy.chef.server.url's certificate, issued by `/C=US/ST=WA/L=Seattle/O=YouCorp/OU=Operations/CN=chef-server.van.sap.corp/[email protected]':

knife works fine (i.e. i believe i have my knife.rb configured properly because if i manually create a cookbook i have no issue)

Please advise. Thanks.

Circular dependency failure

Hi,

I'm getting this error with chef 10.12.0 when running spiceweasel --extractlocal:

ERROR: Dependencies not satisfied or circular dependencies in cookbook(s)

Any ideas on this?

Thanks,
Jay

json version X conflicts ??

MEB:chef-env elias$ clear ; spiceweasel --extractlocal
/Users/elias/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:1637:in raise_if_conflicts': Unable to activate chef-10.18.2, because json-1.7.6 conflicts with json (<= 1.6.1, >= 1.4.4) (Gem::LoadError) from /Users/elias/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/specification.rb:746:inactivate'
from /Users/elias/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:51:in block in require' from /Users/elias/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:50:ineach'
from /Users/elias/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:50:in require' from /Users/elias/.rvm/gems/ruby-1.9.2-p320/gems/spiceweasel-2.0.1/lib/spiceweasel/cookbooks.rb:19:in<top (required)>'
from /Users/elias/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in require' from /Users/elias/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:inrequire'
from /Users/elias/.rvm/gems/ruby-1.9.2-p320/gems/spiceweasel-2.0.1/lib/spiceweasel/cli.rb:24:in <top (required)>' from /Users/elias/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:inrequire'
from /Users/elias/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in require' from /Users/elias/.rvm/gems/ruby-1.9.2-p320/gems/spiceweasel-2.0.1/lib/spiceweasel.rb:20:in<top (required)>'
from /Users/elias/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:in require' from /Users/elias/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:55:inrequire'
from /Users/elias/.rvm/gems/ruby-1.9.2-p320/gems/spiceweasel-2.0.1/bin/spiceweasel:21:in <top (required)>' from /Users/elias/.rvm/gems/ruby-1.9.2-p320/bin/spiceweasel:19:inload'
from /Users/elias/.rvm/gems/ruby-1.9.2-p320/bin/spiceweasel:19:in <main>' from /Users/elias/.rvm/gems/ruby-1.9.2-p320/bin/ruby_noexec_wrapper:14:ineval'
from /Users/elias/.rvm/gems/ruby-1.9.2-p320/bin/ruby_noexec_wrapper:14:in `

'
MEB:chef-env elias$

spiceweasel does not recognize cookbooks outside of ./cookbooks

A common use case is to place custom non-community personalized cookbooks in an alternate path, such as site-cookbooks.

This is usually provided in the cookbooks_path of knife.rb, and allows one to differentiate between them.

spiceweasel should examine the paths in the array element of the knife.rb config and make decisions based on that as well.

Bug or Feature: Use of --cluster-file does not pick up environment (or anything else) from main config file

It seems that if I have all my roles, databags environments etc as well as some cluster definition in my main config file config.yml and I have just an alternate cluster definition in another file, alt-cluster.yml, and I run it like:

spiceweasel   config.yml --cluster-file alt-cluster.yml

nothing in the main config.yml seems to get applied.

I don't see any of the the knife commands to upload the roles, databags, environments, etc.

But most importantly it doesn't pick up the environment so I get the error:

ERROR: Environment 'qa' is listed in the cluster, but not specified as an 'environment' in the manifest.

Is this a bug or a "feature"?

buff-extensions problem

hello. i got a gem version issue..

how to solve this?

i found out that i have two version of buff-extensions like shown below

gem query --local | grep buff
buff-config (1.0.0, 0.4.0)
buff-extensions (1.0.0, 0.5.0)
buff-ignore (1.1.1)
buff-ruby_engine (0.1.0)
buff-shell_out (0.1.1)

the error msg that i run "spiceweasel -h"

spiceweasel -h
/usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:2064:in `raise_if_conflicts': Unable to activate varia_model-0.4.0, because buff-extensions-0.5.0 conflicts with buff-extensions (~> 1.0) (Gem::LoadError)
    from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/specification.rb:1262:in `activate'
    from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems.rb:214:in `block in finish_resolve'
    from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems.rb:213:in `each'
    from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems.rb:213:in `finish_resolve'
    from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/rdoc.rb:14:in `<top (required)>'
    from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:126:in `require'
    from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:126:in `require'
    from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/uninstaller.rb:10:in `<top (required)>'
    from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:126:in `require'
    from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:126:in `require'
    from /usr/local/rvm/gems/ruby-2.1.0/gems/chef-11.12.8/lib/chef/provider/package/rubygems.rb:43:in `<top (required)>'
    from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /usr/local/rvm/gems/ruby-2.1.0/gems/chef-11.12.8/lib/chef/providers.rb:64:in `<top (required)>'
    from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /usr/local/rvm/gems/ruby-2.1.0/gems/chef-11.12.8/lib/chef.rb:25:in `<top (required)>'
    from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /usr/local/rvm/gems/ruby-2.1.0/gems/spiceweasel-2.6.0/lib/spiceweasel/roles.rb:20:in `<top (required)>'
    from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /usr/local/rvm/gems/ruby-2.1.0/gems/spiceweasel-2.6.0/lib/spiceweasel/cli.rb:28:in `<top (required)>'
    from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /usr/local/rvm/gems/ruby-2.1.0/gems/spiceweasel-2.6.0/lib/spiceweasel.rb:20:in `<top (required)>'
    from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /usr/local/rvm/rubies/ruby-2.1.0/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:73:in `require'
    from /usr/local/rvm/gems/ruby-2.1.0/gems/spiceweasel-2.6.0/bin/spiceweasel:21:in `<top (required)>'
    from /usr/local/rvm/gems/ruby-2.1.0/bin/spiceweasel:23:in `load'
    from /usr/local/rvm/gems/ruby-2.1.0/bin/spiceweasel:23:in `<main>'
    from /usr/local/rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
    from /usr/local/rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `<main>'

Validation for encrypted data bag secret should expand path

Spiceweasel fails the validation if you use an encrypted data bag secret path like ~/.chef/organization-secret. The File.exists? check fails even when the file does exist. If Spiceweasel would call File.expand_path on the path before passing it to Fille.exists? then the validation would pass.

Support circular dependencies

Hi,

spiceweasel fails when dealing with circular dependencies but chef is fine with it. Can spiceweasel be updated to support this?

Thanks,
Jay

Berkshelf 3 support

Hi Matt,

any plans for Berkshelf 3 support? Looks like Berkshelf 2 is no longer actively developed and has some "significant" issues, to cite the Readme...

Thanks

Delete mode doesn't handle multi-version cookbooks

When doing something like:

spiceweasel -d mystack.yml | bash

in an environment with multiple versions of a cookbook, spiceweasel fails on this scenario:

...
Deleted cookbook[haproxy version 1.0.4]
Which version(s) do you want to delete?
1. munin 1.0.3
2. munin 1.0.2
3. All versions

ERROR: knife cookbook delete ntp  -y is not a valid choice, skipping it

This could probably be overridden with knife cookbook delete -y -a <cookbook>.

mixlib-cli dependency not declared in gemspec

After installing the gem (version 0.5) from rubygems, the 'spiceweasel' command crashed out with an error that it couldn't require 'mixlib/cli'. I would expect that dependency to be resolved by the gem.

--parallel doesn't work on ubuntu 12.04; Why is --parallel architected the way it is?

The current version of GNU parallel in ubuntu 12.04 seems to barf when cli switches are passed to a knife command that's used with --parallel, e.g.:

igneous@bwolfe-vm:~/famc-lab$ seq 1 | parallel -u -j 0 -v "knife client list --help"
knife\ client\ list\ --help 1
/bin/bash: knife client list --help: command not found

However, I can accomplish the same task by passing -- to parallel (to indicate that it's argument list is over):

igneous@bwolfe-vm:~/famc-lab$ seq 1 | parallel -u -j 0 -v -- knife client list --help{}
knife client list --help1
Error: invalid option: --help1
USAGE:
[snipped]
igneous@bwolfe-vm:~/famc-lab$ seq 1 | parallel -u -j 0 -v -- knife client list --help
knife client list --help 1
knife client list (options)
[snipped]

Using --, you no longer need to escape anything, everything after -- will be interpreted by gnu parallel as "command [arguments]"

Also, your process_providers method gets a bit simpler

        if Spiceweasel::Config[:parallel]
          parallel = "seq #{count} | parallel -u -j 0 -v -- "
          if provider.eql?('vsphere')
            parallel += "knife #{provider}#{Spiceweasel::Config[:knife_options]} vm clone #{options}".gsub(/\{\{n\}\}/, '{}')
          elsif provider.eql?('kvm')
            parallel += "knife #{provider}#{Spiceweasel::Config[:knife_options]} vm create #{options}".gsub(/\{\{n\}\}/, '{}')
          elsif provider.eql?('digital_ocean')
            parallel += "knife #{provider}#{Spiceweasel::Config[:knife_options]} droplet create #{options}".gsub(/\{\{n\}\}/, '{}')
          elsif provider.eql?('google')
            parallel += "knife #{provider}#{Spiceweasel::Config[:knife_options]} server create #{name} #{options}".gsub(/\{\{n\}\}/, '{}')
          else
            parallel += "knife #{provider}#{Spiceweasel::Config[:knife_options]} server create #{options}".gsub(/\{\{n\}\}/, '{}')
          end
          parallel += " -r '#{run_list}'" unless run_list.empty?
          create_command(parallel, create_command_options)
        else

I just wanted to bring this to your attention, because right now --parallel is totally unusable on 12.04.

Unable to resolve dependencies (buff-extensions ~>0.3 && ~>1.0)

gem install spiceweasel
ERROR: While executing gem ... (Gem::DependencyError)
Unable to resolve dependencies: ridley requires buff-extensions (> 0.3); buff-config requires buff-extensions (> 0.3); varia_model requires buff-extensions (~> 1.0)

my ruby version: 1.9.3-p547

[feature request] allows to tag each line of the manifest for processing

Use case: we're using spiceweasel mainly to deploy cluster in ec2 with manifest looking like:
cookbooks:

  • foo
    -bar
    environments:
  • production
  • test
    roles:
  • r1
  • r2
    nodes:
    -ec2 1:
    clusters:
  • production:
    -ec2 1:
    XXX
    -ec2 2:

The problem is:

  • we don't want to delete cookbooks, envs ... each time we want to delete the nodes
  • we want to be able to tell if all the cluster needs to get up or only some nodes (typically, we have few hundreds workers that needs to be brought down/up) each time, but we want to keep the DB node untouch.

We tried to get around this by creating multiple manifest file, but we still need have to include in the file the env used in the cluster.

I understand our use case diverge from the main purpose of spiceweasel (batch loading Chef infrastructure), but by just adding tag or similar capabilities, we would be able to manage our clusters with it. Something like:
cookbooks [create]:
roles [create]:
environments[create]:
nodes:

  • ec2 1 [dbcreate,create]
    cluster [*]

and running:
spiceweasel -t create => run everything
spiceweasel => run only cluster
spiceweasel -t dbcreate => run the node create/delete

Updates for Berkshelf 2.0.5 ?

Thanks a lot for the tool.

I would like to know if there were any updates happening to make it compatible with Berkshelf 2.0.5 please ?

I'm not sure how to get around this, in lib/spiceweasel/berksfile.rb:

berks.resolve(resolve_opts).each do |cb|
  @cookbook_list[cb.cookbook_name] = cb.version

Thanks in advance!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.