├── cookbooks
├── netrumba
│ ├── attributes
│ │ └── default.rb
│ ├── files
│ │ └── ubuntu
│ │ │ ├── google.list
│ │ │ ├── medibuntu.list
│ │ │ ├── google-talkplugin.list
│ │ │ ├── skype.list
│ │ │ └── banshee.list
│ ├── templates
│ │ ├── default
│ │ │ ├── mailname.erb
│ │ │ ├── hosts.erb
│ │ │ └── sysvinit_skel.erb
│ │ └── ubuntu-10.04
│ │ │ ├── snmpd.erb
│ │ │ └── postfix_main.cf.erb
│ ├── README.rdoc
│ ├── metadata.rb
│ ├── resources
│ │ └── sysvinit.rb
│ ├── providers
│ │ └── sysvinit.rb
│ └── recipes
│ │ ├── apt-get-update.rb~
│ │ ├── apt-get-update.rb
│ │ ├── default.rb
│ │ ├── default.rb~
│ │ ├── repository.rb~
│ │ ├── repository.rb
│ │ ├── packages.rb
│ │ └── packages.rb~
└── README.md
├── solo-local.rb
├── solo.rb
├── nodes
├── netrumba.json
└── template.json
├── .chef
└── knife.rb
├── Rakefile
├── initial-config.sh
├── README.rdoc
├── roles
└── README.md
├── data_bags
└── README.md
├── certificates
└── README.md
└── config
└── rake.rb
/cookbooks/netrumba/attributes/default.rb:
--------------------------------------------------------------------------------
1 | set_unless[:timezone] = "Etc/UTC"
2 |
--------------------------------------------------------------------------------
/cookbooks/netrumba/files/ubuntu/google.list:
--------------------------------------------------------------------------------
1 | deb http://dl.google.com/linux/deb/ stable non-free main
2 |
--------------------------------------------------------------------------------
/cookbooks/netrumba/files/ubuntu/medibuntu.list:
--------------------------------------------------------------------------------
1 | deb http://packages.medibuntu.org/ maverick free non-free
2 |
--------------------------------------------------------------------------------
/cookbooks/netrumba/files/ubuntu/google-talkplugin.list:
--------------------------------------------------------------------------------
1 | deb http://dl.google.com/linux/talkplugin/deb/ stable main
--------------------------------------------------------------------------------
/cookbooks/netrumba/files/ubuntu/skype.list:
--------------------------------------------------------------------------------
1 | deb http://download.skype.com/linux/repos/debian/ stable non-free
2 |
--------------------------------------------------------------------------------
/cookbooks/netrumba/templates/default/mailname.erb:
--------------------------------------------------------------------------------
1 | <%= node[:alca][:hostname] + "." + node[:alca][:domain] %>
2 |
3 |
--------------------------------------------------------------------------------
/solo-local.rb:
--------------------------------------------------------------------------------
1 | here = Dir.getwd
2 | file_cache_path here
3 | cookbook_path ["#{here}/cookbooks"]
4 | role_path "#{here}/roles"
5 |
--------------------------------------------------------------------------------
/solo.rb:
--------------------------------------------------------------------------------
1 | file_cache_path "/tmp/chef-solo"
2 | cookbook_path [ "/tmp/chef-solo/cookbooks"]
3 | role_path "/tmp/chef-solo/roles"
4 |
--------------------------------------------------------------------------------
/nodes/netrumba.json:
--------------------------------------------------------------------------------
1 | {
2 | "ipaddress": "127.0.0.1",
3 | "timezone": "Europe/Rome",
4 | "run_list": [
5 | "recipe[netrumba]"
6 | ]
7 | }
8 |
9 |
--------------------------------------------------------------------------------
/.chef/knife.rb:
--------------------------------------------------------------------------------
1 | cookbook_copyright "fitzkarraldo"
2 | cookbook_email "fitzkarraldo@gmail.com"
3 | cookbook_license "apachev2"
4 | node_name "netrumba"
5 |
6 |
--------------------------------------------------------------------------------
/nodes/template.json:
--------------------------------------------------------------------------------
1 | {
2 | "resolver": {
3 | "nameservers": [ "10.0.0.1" ],
4 | "search":"int.example.com"
5 | },
6 | "run_list": [ "role[test]", "recipe[resolver]" ]
7 | }
8 |
9 |
--------------------------------------------------------------------------------
/cookbooks/netrumba/README.rdoc:
--------------------------------------------------------------------------------
1 | = DESCRIPTION:
2 |
3 | This cookbook install common used server package as ntp and snmpd
4 |
5 | = REQUIREMENTS:
6 |
7 |
8 | = ATTRIBUTES:
9 |
10 | = USAGE:
11 |
--------------------------------------------------------------------------------
/cookbooks/netrumba/files/ubuntu/banshee.list:
--------------------------------------------------------------------------------
1 | ## banshee stable
2 | deb http://ppa.launchpad.net/banshee-team/ppa/ubuntu maverick main
3 | # deb-src http://ppa.launchpad.net/banshee-team/ppa/ubuntu karmic main
4 |
--------------------------------------------------------------------------------
/cookbooks/netrumba/templates/default/hosts.erb:
--------------------------------------------------------------------------------
1 | 127.0.0.1 localhost.localdomain localhost
2 | <%= node[:ipaddress] %> <%= node[:alca][:hostname] + "." + node[:alca][:domain] %> <%= node[:alca][:hostname] %>
3 |
4 |
--------------------------------------------------------------------------------
/Rakefile:
--------------------------------------------------------------------------------
1 | #task :test_remote do
2 | # `thor chef_solo:run_ssh host.dev -u root -j nodes/development.json`
3 | #end
4 |
5 | task :netrumba do
6 | puts `chef-solo -c solo-local.rb -j nodes/netrumba.json -l debug`
7 | end
8 |
--------------------------------------------------------------------------------
/cookbooks/netrumba/metadata.rb:
--------------------------------------------------------------------------------
1 | maintainer "fitzkarraldo"
2 | maintainer_email "davide.saurino@alcacoop.it"
3 | license "GNU GPL v3"
4 | description "Installs/Configures NETRUMBA (with poulsbo packages)"
5 | long_description IO.read(File.join(File.dirname(__FILE__), 'README.rdoc'))
6 | version "0.1"
7 | supports "ubuntu"
8 |
--------------------------------------------------------------------------------
/initial-config.sh:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 |
3 | sudo apt-get install ruby ri rdoc ruby1.8-dev irb1.8 rdoc1.8 ri1.8 ruby1.8 irb libopenssl-ruby libopenssl-ruby1.8
4 | cd
5 | wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
6 | tar xvzf rubygems-1.3.7.tgz
7 | cd rubygems-1.3.7/
8 | sudo ruby setup.rb
9 | sudo ln -s /usr/bin/gem1.8 /usr/local/bin/gem
10 | sudo gem install chef --no-ri --no-rdoc
11 |
12 |
--------------------------------------------------------------------------------
/README.rdoc:
--------------------------------------------------------------------------------
1 | == chef-repo
2 |
3 | This is my personal {chef-repo}[http://www.opscode.com/chef] repository, actually I use it to restore my Ubuntu install into my netbook.
4 |
5 | == HOWTO
6 |
7 | Before executing your recipes you have to run the script initial-config.sh
8 | which installs rubygems (via src) and the chef gem (via rubygem).
9 |
10 | == Credits
11 |
12 | * sub @alcacoop
13 | * thanks to @lucagreco for the original skel!
--------------------------------------------------------------------------------
/cookbooks/netrumba/resources/sysvinit.rb:
--------------------------------------------------------------------------------
1 | actions :create, :delete
2 |
3 | attribute :name, :kind_of => String, :name_attribute => true
4 | attribute :required, :kind_of => String
5 | attribute :short_desc, :kind_of => String
6 | attribute :long_desc, :kind_of => String
7 | attribute :author, :kind_of => Hash
8 | attribute :executable, :kind_of => String
9 | attribute :executable_args, :kind_of => String
10 | attribute :path, :kind_of => String
11 |
12 | attribute :active, :kind_of => [TrueClass, FalseClass]
13 |
--------------------------------------------------------------------------------
/roles/README.md:
--------------------------------------------------------------------------------
1 | Create roles here, in either the Role Ruby DSL (.rb) or JSON (.json) files. To install roles on the server, use knife.
2 |
3 | For example, create `roles/base_example.rb`:
4 |
5 | name "base_example"
6 | description "Example base role applied to all nodes."
7 | # List of recipes and roles to apply. Requires Chef 0.8, earlier versions use 'recipes()'.
8 | #run_list()
9 | # Attributes applied if the node doesn't have it set already.
10 | #default_attributes()
11 | # Attributes applied no matter what the node has set already.
12 | #override_attributes()
13 |
14 | Then upload it to the Chef Server:
15 |
16 | knife role from file roles/base_example.rb
17 |
--------------------------------------------------------------------------------
/data_bags/README.md:
--------------------------------------------------------------------------------
1 | This directory contains directories of the various data bags you create for your infrastructure. Each subdirectory corresponds to a data bag on the Chef Server, and contains JSON files of the items that go in the bag.
2 |
3 | First, create a directory for the data bag.
4 |
5 | mkdir data_bags/BAG
6 |
7 | Then create the JSON files for items that will go into that bag.
8 |
9 | $EDITOR data_bags/BAG/ITEM.json
10 |
11 | The JSON for the ITEM must contain a key named "id" with a value equal to "ITEM". For example,
12 |
13 | {
14 | "id": "foo"
15 | }
16 |
17 | Next, create the data bag on the Chef Server.
18 |
19 | knife data bag create BAG
20 |
21 | Then upload the items in the data bag's directory to the Chef Server.
22 |
23 | knife data bag from file BAG ITEM.json
24 |
--------------------------------------------------------------------------------
/cookbooks/netrumba/templates/ubuntu-10.04/snmpd.erb:
--------------------------------------------------------------------------------
1 | # This file controls the activity of snmpd and snmptrapd
2 |
3 | # MIB directories. /usr/share/snmp/mibs is the default, but
4 | # including it here avoids some strange problems.
5 | export MIBDIRS=/usr/share/snmp/mibs
6 |
7 | # snmpd control (yes means start daemon).
8 | SNMPDRUN=yes
9 |
10 | # snmpd options (use syslog, close stdin/out/err).
11 | SNMPDOPTS='-Lsd -Lf /dev/null -u snmp -g snmp -I -smux -p /var/run/snmpd.pid 127.0.0.1'
12 |
13 | # snmptrapd control (yes means start daemon). As of net-snmp version
14 | # 5.0, master agentx support must be enabled in snmpd before snmptrapd
15 | # can be run. See snmpd.conf(5) for how to do this.
16 | TRAPDRUN=no
17 |
18 | # snmptrapd options (use syslog).
19 | TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid'
20 |
21 | # create symlink on Debian legacy location to official RFC path
22 | SNMPDCOMPAT=yes
23 |
--------------------------------------------------------------------------------
/cookbooks/netrumba/providers/sysvinit.rb:
--------------------------------------------------------------------------------
1 | action :create do
2 | template "/etc/init.d/#{new_resource.name}" do
3 | cookbook "base_server"
4 | source "sysvinit_skel.erb"
5 | owner "root"
6 | group "root"
7 | mode 0755
8 | variables ({
9 | :name => new_resource.name,
10 | :required => new_resource.required,
11 | :short_desc => new_resource.short_desc,
12 | :long_desc => new_resource.long_desc,
13 | :author => new_resource.author,
14 | :executable => new_resource.executable,
15 | :executable_args => new_resource.executable_args,
16 | :path => new_resource.path
17 | })
18 | end
19 |
20 | service new_resource.name do
21 | action [ :enable, :start ]
22 | only_if { new_resource.active }
23 | end
24 | end
25 |
26 | action :delete do
27 | service new_resource.name do
28 | action [ :enable, :stop ]
29 | end
30 | end
31 |
--------------------------------------------------------------------------------
/certificates/README.md:
--------------------------------------------------------------------------------
1 | Creating SSL certificates is a common task done in web application infrastructures, so a rake task is provided to generate certificates. These certificates are stored here by the ssl_cert task.
2 |
3 | Configure the values used in the SSL certificate by modifying `config/rake.rb`.
4 |
5 | To generate a certificate set for a new monitoring server, for example:
6 |
7 | rake ssl_cert FQDN=monitoring.example.com
8 |
9 | Once the certificates are generated, copy them into the cookbook(s) where you want to use them.
10 |
11 | cp certificates/monitoring.example.com.* cookbooks/COOKBOOK/files/default
12 |
13 | In the recipe for that cookbook, create a `cookbook_file` resource to configure a resource that puts them in place on the destination server.
14 |
15 | cookbook_file '/etc/apache2/ssl/monitoring.example.com.pem'
16 | owner 'root'
17 | group 'root'
18 | mode 0600
19 | end
20 |
--------------------------------------------------------------------------------
/cookbooks/netrumba/recipes/apt-get-update.rb~:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: base-server
3 | # Recipe:: default
4 | #
5 | # Copyright 2009, Alca Società Cooperativa
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU General Public License as published by
9 | # the Free Software Foundation, either version 3 of the License, or
10 | # (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU General Public License
18 | # along with this program. If not, see .
19 |
20 | bash "update-apt-package-list" do
21 | user "root"
22 | cwd "/root"
23 | code <<-EOC
24 | apt-get update -qq
25 | EOC
26 | end
27 |
--------------------------------------------------------------------------------
/cookbooks/netrumba/recipes/apt-get-update.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: netrumba
3 | # Recipe:: apt-get-update
4 | #
5 | # Copyright 2010, Alca Società Cooperativa
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU General Public License as published by
9 | # the Free Software Foundation, either version 3 of the License, or
10 | # (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU General Public License
18 | # along with this program. If not, see .
19 |
20 | bash "update-apt-package-list" do
21 | user "root"
22 | cwd "/root"
23 | code <<-EOC
24 | apt-get update -qq
25 | EOC
26 | end
27 |
--------------------------------------------------------------------------------
/cookbooks/netrumba/recipes/default.rb:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: netrumba
3 | # Recipe:: default
4 | #
5 | # Copyright 2010, Alca Società Cooperativa
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU General Public License as published by
9 | # the Free Software Foundation, either version 3 of the License, or
10 | # (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU General Public License
18 | # along with this program. If not, see .
19 |
20 | include_recipe 'netrumba::repository'
21 | include_recipe 'netrumba::apt-get-update'
22 | include_recipe 'netrumba::packages'
23 |
24 | # execute 'locale_generation' do
25 | # command 'locale-gen it_IT.UTF-8'
26 | # end
27 |
--------------------------------------------------------------------------------
/cookbooks/netrumba/recipes/default.rb~:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: netrumba
3 | # Recipe:: default
4 | #
5 | # Copyright 2009, Alca Società Cooperativa
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU General Public License as published by
9 | # the Free Software Foundation, either version 3 of the License, or
10 | # (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU General Public License
18 | # along with this program. If not, see .
19 |
20 | include_recipe 'netrumba::repository'
21 | include_recipe 'netrumba::apt-get-update'
22 | include_recipe 'netrumba::packages'
23 |
24 | # execute 'locale_generation' do
25 | # command 'locale-gen it_IT.UTF-8'
26 | # end
27 |
--------------------------------------------------------------------------------
/config/rake.rb:
--------------------------------------------------------------------------------
1 | # Configure the Rakefile's tasks.
2 |
3 | ###
4 | # Company and SSL Details
5 | # Used with the ssl_cert task.
6 | ###
7 |
8 | # The company name - used for SSL certificates, and in srvious other places
9 | COMPANY_NAME = "Example Com"
10 |
11 | # The Country Name to use for SSL Certificates
12 | SSL_COUNTRY_NAME = "US"
13 |
14 | # The State Name to use for SSL Certificates
15 | SSL_STATE_NAME = "Several"
16 |
17 | # The Locality Name for SSL - typically, the city
18 | SSL_LOCALITY_NAME = "Locality"
19 |
20 | # What department?
21 | SSL_ORGANIZATIONAL_UNIT_NAME = "Operations"
22 |
23 | # The SSL contact email address
24 | SSL_EMAIL_ADDRESS = "ops@example.com"
25 |
26 | # License for new Cookbooks
27 | # Can be :apachev2 or :none
28 | NEW_COOKBOOK_LICENSE = :apachev2
29 |
30 | ###
31 | # Useful Extras (which you probably don't need to change)
32 | ###
33 |
34 | # The top of the repository checkout
35 | TOPDIR = File.expand_path(File.join(File.dirname(__FILE__), ".."))
36 |
37 | # Where to store certificates generated with ssl_cert
38 | CADIR = File.expand_path(File.join(TOPDIR, "certificates"))
39 |
--------------------------------------------------------------------------------
/cookbooks/netrumba/recipes/repository.rb~:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: base-server
3 | # Recipe:: repository
4 | #
5 | # Copyright 2010, Alca Società Cooperativa
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU General Public License as published by
9 | # the Free Software Foundation, either version 3 of the License, or
10 | # (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU General Public License
18 | # along with this program. If not, see .
19 |
20 | #YORBA=shotwell
21 | bash 'add-third-party-ppa-repo' do
22 | code <<-EOC
23 | add-apt-repository ppa:banshee-team/banshee-daily
24 | add-apt-repository ppa:yorba/ppa
25 | add-apt-repository ppa:zedtux/rhythmbox-albumartsearch
26 | add-apt-repository ppa:gma500/ppa
27 | add-apt-repository ppa:gma500/fix
28 | EOC
29 | end
30 |
31 | +GMA500
32 |
33 | cookbook_file '/etc/apt/sources.list.d/google-talkplugin.list' do
34 | source 'google-talkplugin.list'
35 | end
36 |
37 | cookbook_file '/etc/apt/sources.list.d/medibuntu.list' do
38 | source 'medibuntu.list'
39 | end
40 |
--------------------------------------------------------------------------------
/cookbooks/netrumba/templates/ubuntu-10.04/postfix_main.cf.erb:
--------------------------------------------------------------------------------
1 | # See /usr/share/postfix/main.cf.dist for a commented, more complete version
2 |
3 |
4 | # Debian specific: Specifying a file name will cause the first
5 | # line of that file to be used as the name. The Debian default
6 | # is /etc/mailname.
7 | #myorigin = /etc/mailname
8 |
9 | smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
10 | biff = no
11 |
12 | # appending .domain is the MUA's job.
13 | append_dot_mydomain = no
14 |
15 | # Uncomment the next line to generate "delayed mail" warnings
16 | #delay_warning_time = 4h
17 |
18 | readme_directory = no
19 |
20 | # TLS parameters
21 | smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
22 | smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
23 | smtpd_use_tls=yes
24 | smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache
25 | smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
26 |
27 | # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
28 | # information on enabling SSL in the smtp client.
29 |
30 | myhostname = <%= node[:alca][:hostname] + "." + node[:alca][:domain] %>
31 | alias_maps = hash:/etc/aliases
32 | alias_database = hash:/etc/aliases
33 | myorigin = /etc/mailname
34 | mydestination = <%= node[:alca][:hostname] + "." + node[:alca][:domain] %>, localhost
35 | relayhost =
36 | mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
37 | mailbox_size_limit = 0
38 | recipient_delimiter = +
39 | inet_interfaces = all
40 |
--------------------------------------------------------------------------------
/cookbooks/netrumba/recipes/repository.rb:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | #
3 | # Cookbook Name:: netrumba
4 | # Recipe:: repository
5 | #
6 | # Copyright 2010, Alca Società Cooperativa
7 | #
8 | # This program is free software: you can redistribute it and/or modify
9 | # it under the terms of the GNU General Public License as published by
10 | # the Free Software Foundation, either version 3 of the License, or
11 | # (at your option) any later version.
12 | #
13 | # This program is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | # GNU General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU General Public License
19 | # along with this program. If not, see .
20 |
21 | #YORBA=shotwell
22 | bash 'add-third-party-ppa-repo' do
23 | user "root"
24 | code <<-EOC
25 | add-apt-repository ppa:banshee-team/banshee-daily
26 | add-apt-repository ppa:yorba/ppa
27 | add-apt-repository ppa:zedtux/rhythmbox-albumartsearch
28 | add-apt-repository ppa:gma500/ppa
29 | add-apt-repository ppa:gma500/fix
30 | add-apt-repository ppa:chromium-daily/ppa
31 | add-apt-repository ppa:ubuntu-mozilla-daily/ppa
32 | EOC
33 | end
34 |
35 | bash 'add-google-repo-key' do
36 | user "root"
37 | code <<-EOC
38 | wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -
39 | EOC
40 | end
41 |
42 | cookbook_file '/etc/apt/sources.list.d/google-talkplugin.list' do
43 | source 'google-talkplugin.list'
44 | end
45 |
46 | cookbook_file '/etc/apt/sources.list.d/medibuntu.list' do
47 | source 'medibuntu.list'
48 | end
49 |
50 | bash 'add-medibuntu-repo-key' do
51 | user "root"
52 | code <<-EOC
53 | sudo apt-get --yes --quiet --allow-unauthenticated install medibuntu-keyring
54 | EOC
55 | end
56 |
57 | cookbook_file '/etc/apt/sources.list.d/google.list' do
58 | source 'google.list'
59 | end
60 |
61 | cookbook_file '/etc/apt/sources.list.d/skype.list' do
62 | source 'skype.list'
63 | end
64 |
65 |
--------------------------------------------------------------------------------
/cookbooks/README.md:
--------------------------------------------------------------------------------
1 | This directory contains the cookbooks used to configure systems in your infrastructure with Chef.
2 |
3 | Configure knife to use your preferred copyright holder, email contact and license. Add the following lines to `~/chef-repo/.chef/knife.rb`.
4 |
5 | cookbook_copyright "Example, Com."
6 | cookbook_email "cookbooks@example.com"
7 | cookbook_license "apachev2"
8 |
9 | Supported values for `cookbook_license` are "apachev2" or "none". These settings are used to prefill comments in the default recipe, and the corresponding values in the metadata.rb. You are free to change these in those files.
10 |
11 | Create new cookbooks in this directory with Knife.
12 |
13 | knife cookbook create COOKBOOK
14 |
15 | This will create all the cookbook directory components. You don't need to use them all, and can delete the ones you don't need. It also creates a README file, metadata.rb and default recipe.
16 |
17 | You can also download cookbooks directly from the Opscode Cookbook Site. There are two subcommands to help with this depending on what your preference is.
18 |
19 | The first and recommended method is to use a vendor branch if you're using Git. This is automatically handled with Knife.
20 |
21 | knife cookbook site vendor COOKBOOK
22 |
23 | This will:
24 |
25 | * Download the cookbook tarball from cookbooks.opscode.com.
26 | * Ensure its on the git master branch.
27 | * Checks for an existing vendor branch, and creates if it doesn't.
28 | * Checks out the vendor branch (chef-vendor-COOKBOOK).
29 | * Removes the existing (old) version.
30 | * Untars the cookbook tarball it downloaded in the first step.
31 | * Adds the cookbook files to the git index and commits.
32 | * Creates a tag for the version downloaded.
33 | * Checks out the master branch again.
34 | * Merges the cookbook into master.
35 |
36 | The last step will ensure that any local changes or modifications you have made to the cookbook are preserved, so you can keep your changes through upstream updates.
37 |
38 | If you're not using Git, use the site download subcommand to download the tarball.
39 |
40 | knife cookbook site download COOKBOOK
41 |
42 | This creates the COOKBOOK.tar.gz from in the current directory (e.g., `~/chef-repo`). We recommend following a workflow similar to the above for your version control tool.
43 |
--------------------------------------------------------------------------------
/cookbooks/netrumba/recipes/packages.rb:
--------------------------------------------------------------------------------
1 | # -*- coding: utf-8 -*-
2 | #
3 | # Cookbook Name:: netrumba
4 | # Recipe:: packages
5 | #
6 | # Copyright 2010, Alca Società Cooperativa
7 | #
8 | # This program is free software: you can redistribute it and/or modify
9 | # it under the terms of the GNU General Public License as published by
10 | # the Free Software Foundation, either version 3 of the License, or
11 | # (at your option) any later version.
12 | #
13 | # This program is distributed in the hope that it will be useful,
14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 | # GNU General Public License for more details.
17 | #
18 | # You should have received a copy of the GNU General Public License
19 | # along with this program. If not, see .
20 |
21 | ## General Packages
22 | package 'etckeeper'
23 | package 'ant'
24 | #package 'apache2-mpm-prefork'
25 | package 'aptitude'
26 | package 'banshee'
27 | package 'build-essential'
28 | package 'chmsee'
29 | package 'emacs-snapshot'
30 | package 'emesene'
31 | package 'erlang'
32 | package 'espeak'
33 | package 'filezilla'
34 | package 'firefox-4.0'
35 | package 'flashplugin-installer'
36 | #package 'gimp'
37 | package 'git-core'
38 | package 'gitg'
39 | package 'gitk'
40 | #package 'gnome-bluetooth'
41 | package 'gnucash'
42 | package 'google-talkplugin'
43 | package 'gparted'
44 | package 'hddtemp'
45 | package 'hdparm'
46 | package 'htop'
47 | package 'linphone'
48 | package 'meld'
49 | package 'mercurial'
50 | package 'mysql-common'
51 | package 'mysql-client'
52 | #package 'nautilus-dropbox'
53 | #package 'nautilus-flickr-uploader'
54 | package 'nmap'
55 | package 'openssh-client'
56 | package 'openssh-server'
57 | package 'parcellite'
58 | package 'php5-cli'
59 | package 'picasa'
60 | package 'powertop'
61 | package 'rhythmbox-plugin-albumartsearch'
62 | package 'samba-common'
63 | #package 'skype'
64 | package 'smbclient'
65 | package 'smbfs'
66 | package 'sqlite3'
67 | package 'sshmenu'
68 | package 'sshmenu-gnome'
69 | package 'subversion'
70 | package 'tex-common'
71 | package 'texlive'
72 | package 'texlive-base'
73 | package 'texmaker'
74 | #package 'traceroute'
75 | package 'unrar-free'
76 | package 'vim'
77 | package 'virt-manager'
78 | package 'virt-viewer'
79 | package 'vlc'
80 | package 'w32codecs'
81 | package 'xchat'
82 |
83 | CHROMIUM_BROWSER = ['chromium-browser',
84 | 'chromium-browser-inspector',
85 | 'chromium-codecs-ffmpeg',
86 | 'chromium-codecs-ffmpeg-nonfree'
87 | ].each {|this| package this}
88 |
89 | POULSBO = ['poulsbo-driver-2d',
90 | 'poulsbo-driver-3d',
91 | 'poulsbo-config'
92 | ].each {|file| package file}
93 |
94 | bash 'install-rubygems' do
95 | code <<-EOC
96 | user "root"
97 | gem install capistrano chef cucumber gemcutter git jeweler jsc json json_pure mongo mongrel rails rake sinatra slideshow sqlite3-ruby xmpp4r --no-ri --no-rdoc
98 | gem install slideshow -v=0.6.1 --no-ri --no-rdoc
99 | EOC
100 | end
101 |
102 | ## EXTRA PACKAGES
103 | #package 'easytag'
104 | #package 'ejabberd'
105 | #package 'pppconfig'
106 | #package 'pppoeconf'
107 | #package 'screen'
108 | #package 'sopcast-player'
109 | #package 'sshfs
110 | #package 'ubuntuwintv''
111 | #package 'wine'
112 |
113 | ## NO-MORE
114 |
115 | #package 'b43-fwcutter'
116 |
117 | #VPN_CONFIG = ['network-manager-pptp',
118 | # 'network-manager-pptp-gnome',
119 | # 'pptp-linux'].each {|file| package file}
120 |
--------------------------------------------------------------------------------
/cookbooks/netrumba/recipes/packages.rb~:
--------------------------------------------------------------------------------
1 | #
2 | # Cookbook Name:: base-server
3 | # Recipe:: default
4 | #
5 | # Copyright 2009, Alca Società Cooperativa
6 | #
7 | # This program is free software: you can redistribute it and/or modify
8 | # it under the terms of the GNU General Public License as published by
9 | # the Free Software Foundation, either version 3 of the License, or
10 | # (at your option) any later version.
11 | #
12 | # This program is distributed in the hope that it will be useful,
13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 | # GNU General Public License for more details.
16 | #
17 | # You should have received a copy of the GNU General Public License
18 | # along with this program. If not, see .
19 |
20 | ## General Packages
21 | #package 'alsautils'
22 | package 'ant'
23 | #package 'apache2-mpm-prefork'
24 | package 'aptitude'
25 | package 'apturl'
26 | package 'b43-fwcutter'
27 | package 'banshee'
28 | package 'bash-completion'
29 | package 'build-essential'
30 | #package 'community-themes'
31 | package 'dkms'
32 | #package 'easytag'
33 | #package 'ejabberd'
34 | package 'emacs-snapshot'
35 | package 'emesene'
36 | package 'erlang'
37 | package 'espeak'
38 | package 'etckeeper'
39 | package 'filezilla'
40 | package 'firefox-4.0'
41 | package 'firefox-gnome-support'
42 | package 'flashplugin-installer'
43 | #package 'gimp'
44 | package 'git-core'
45 | package 'gitg'
46 | package 'gitk'
47 | package 'gnochm'
48 | package 'gnome-bluetooth'
49 | package 'gnucash'
50 | package 'gnupg'
51 | package 'google-talkplugin'
52 | package 'gparted'
53 | package 'hddtemp'
54 | package 'hdparm'
55 | package 'htop'
56 | package 'linphone'
57 | package 'lm-sensors'
58 | package 'medibuntu-keyring'
59 | package 'meld'
60 | package 'mercurial'
61 | package 'mplayer-nogui'
62 | package 'mplayer-skins'
63 | package 'mysql-common'
64 | package 'mysql-client-5.0'
65 | #package 'nautilus-dropbox'
66 | package 'nautilus-flickr-uploader'
67 | #package 'network-manager-pptp'
68 | #package 'network-manager-pptp-gnome'
69 | package 'nmap'
70 | package 'openoffice.org-base-core'
71 | package 'openoffice.org-gnome'
72 | package 'openssh-client'
73 | package 'openssh-server'
74 | package 'parcellite'
75 | package 'php5-cli'
76 | package 'picasa'
77 | package 'powertop'
78 | #package 'pppconfig'
79 | #package 'pppoeconf'
80 | #package 'pptp-linux'
81 | package 'rhythmbox-plugin-albumartsearch'
82 | package 'samba-common'
83 | #package 'screen'
84 | package 'shotwell'
85 | package 'skype'
86 | package 'smbclient'
87 | pacakge 'smbfs'
88 | #package 'sopcast-player'
89 | package 'sqlite3'
90 | #package 'sshfs'
91 | package 'sshmenu'
92 | package 'sshmenu-gnome'
93 | package 'subversion'
94 | package 'telnet'
95 | package 'tex-common'
96 | package 'texlive'
97 | package 'texlive-base'
98 | package 'texmaker'
99 | package 'traceroute'
100 | #package 'ubuntuwintv'
101 | package 'unrar-free'
102 | package 'vim'
103 | package 'virt-manager'
104 | package 'virt-viewer'
105 | package 'vlc'
106 | package 'w32codecs'
107 | package 'wget'
108 | #package 'wine'
109 | #package 'wpasupplicant'
110 | package 'xchat'
111 | package 'zip'
112 |
113 | CHROMIUM-BROWSER = ['chromium-browser',
114 | 'chromium-browser-inspector',
115 | 'chromium-codecs-ffmpeg',
116 | 'chromium-codecs-ffmpeg-nonfree'
117 | ].each {|this| package this}
118 |
119 | PIDGIN = ['pidgin',
120 | 'pidgin-extprefs',
121 | 'pidgin-ppa'
122 | ].each {|this| package this}
123 |
124 | POULSBO = ['poulsbo-driver-2d',
125 | 'poulsbo-driver-3d',
126 | 'poulsbo-config'
127 | ].each {|file| package file}
128 |
129 | RUBY = ['ruby', 'ri', 'rdoc', 'ruby1.8-dev', 'irb1.8', 'rdoc1.8', 'ri1.8', 'ruby1.8', 'irb', 'libopenssl-ruby', 'libopenssl-ruby1.8'].each {|this| package this}
130 |
131 | bash 'install-rubygems' do
132 | code <<-EOC
133 | user "root"
134 | cwd "/tmp"
135 | wget http://production.cf.rubygems.org/rubygems/rubygems-1.3.7.tgz
136 | tar xvzf rubygems-1.3.7.tgz
137 | cd rubygems-1.3.7
138 | ruby setup.rb
139 | ln -s /usr/bin/gem1.8 /usr/local/bin/gem
140 | ln -s /usr/bin/ruby1.8 /usr/local/bin/ruby
141 | ln -s /usr/bin/rdoc1.8 /usr/local/bin/rdoc
142 | ln -s /usr/bin/ri1.8 /usr/local/bin/ri
143 | ln -s /usr/bin/irb1.8 /usr/local/bin/irb
144 | gem install capistrano chef cucumber gemcutter git jeweler jsc json json_pure mongo mongrel rails rake sinatra slideshow sqlite3-ruby xmpp4r --no-rdoc --no-ri
145 | gem install slideshow -v=0.6.1 --no-ri --no-rdoc
146 | EOC
147 | end
148 |
--------------------------------------------------------------------------------
/cookbooks/netrumba/templates/default/sysvinit_skel.erb:
--------------------------------------------------------------------------------
1 | #! /bin/sh
2 | ### BEGIN INIT INFO
3 | # Provides: <%= @name %>
4 | <% if not @required.nil? %>
5 | # Required-Start: <%= @required %>
6 | # Required-Stop: <%= @required %>
7 | <% end %>
8 | # Default-Start: 2 3 4 5
9 | # Default-Stop: 0 1 6
10 | # Short-Description: <%= @short_desc %>
11 | # Description:
12 | <% if not @long_desc.nil? %>
13 | <% @long_desc.each_line do |line| %>
14 | # <%= line %>
15 | <% end %>
16 | <% end %>
17 | ### END INIT INFO
18 | <% if not @author.nil? %>
19 | # Author: <%= @author[:name] %> <<%= @author[:email] %>>
20 | <% end %>
21 |
22 | # Do NOT "set -e"
23 |
24 | # PATH should only include /usr/* if it runs after the mountnfs.sh script
25 | PATH=/sbin:/usr/sbin:/bin:/usr/bin:<%= @path %>
26 | DESC="<%= @short_desc %>"
27 | NAME=<%= @name %>
28 | DAEMON=<%= @executable %>
29 | PIDFILE=/var/run/$NAME.pid
30 | DAEMON_ARGS="<%= @executable_args %>"
31 | SCRIPTNAME=/etc/init.d/$NAME
32 |
33 | # Exit if the package is not installed
34 | [ -x "$DAEMON" ] || exit 0
35 |
36 | # Read configuration variable file if it is present
37 | [ -r /etc/default/$NAME ] && . /etc/default/$NAME
38 |
39 | # Load the VERBOSE setting and other rcS variables
40 | . /lib/init/vars.sh
41 |
42 | # Define LSB log_* functions.
43 | # Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
44 | . /lib/lsb/init-functions
45 |
46 | #
47 | # Function that starts the daemon/service
48 | #
49 | do_start()
50 | {
51 | # Return
52 | # 0 if daemon has been started
53 | # 1 if daemon was already running
54 | # 2 if daemon could not be started
55 | start-stop-daemon --start --quiet --pidfile $PIDFILE -b --exec $DAEMON --test > /dev/null \
56 | || return 1
57 | start-stop-daemon --start --quiet --pidfile $PIDFILE -b --exec $DAEMON -- \
58 | $DAEMON_ARGS \
59 | || return 2
60 | # Add code here, if necessary, that waits for the process to be ready
61 | # to handle requests from services started subsequently which depend
62 | # on this one. As a last resort, sleep for some time.
63 | }
64 |
65 | #
66 | # Function that stops the daemon/service
67 | #
68 | do_stop()
69 | {
70 | # Return
71 | # 0 if daemon has been stopped
72 | # 1 if daemon was already stopped
73 | # 2 if daemon could not be stopped
74 | # other if a failure occurred
75 | start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
76 | RETVAL="$?"
77 | [ "$RETVAL" = 2 ] && return 2
78 | # Wait for children to finish too if this is a daemon that forks
79 | # and if the daemon is only ever run from this initscript.
80 | # If the above conditions are not satisfied then add some other code
81 | # that waits for the process to drop all resources that could be
82 | # needed by services started subsequently. A last resort is to
83 | # sleep for some time.
84 | start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
85 | [ "$?" = 2 ] && return 2
86 | # Many daemons don't delete their pidfiles when they exit.
87 | rm -f $PIDFILE
88 | return "$RETVAL"
89 | }
90 |
91 | #
92 | # Function that sends a SIGHUP to the daemon/service
93 | #
94 | do_reload() {
95 | #
96 | # If the daemon can reload its configuration without
97 | # restarting (for example, when it is sent a SIGHUP),
98 | # then implement that here.
99 | #
100 | start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
101 | return 0
102 | }
103 |
104 | case "$1" in
105 | start)
106 | [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
107 | do_start
108 | case "$?" in
109 | 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
110 | 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
111 | esac
112 | ;;
113 | stop)
114 | [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
115 | do_stop
116 | case "$?" in
117 | 0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
118 | 2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
119 | esac
120 | ;;
121 | #reload|force-reload)
122 | #
123 | # If do_reload() is not implemented then leave this commented out
124 | # and leave 'force-reload' as an alias for 'restart'.
125 | #
126 | #log_daemon_msg "Reloading $DESC" "$NAME"
127 | #do_reload
128 | #log_end_msg $?
129 | #;;
130 | restart|force-reload)
131 | #
132 | # If the "reload" option is implemented then remove the
133 | # 'force-reload' alias
134 | #
135 | log_daemon_msg "Restarting $DESC" "$NAME"
136 | do_stop
137 | case "$?" in
138 | 0|1)
139 | do_start
140 | case "$?" in
141 | 0) log_end_msg 0 ;;
142 | 1) log_end_msg 1 ;; # Old process is still running
143 | *) log_end_msg 1 ;; # Failed to start
144 | esac
145 | ;;
146 | *)
147 | # Failed to stop
148 | log_end_msg 1
149 | ;;
150 | esac
151 | ;;
152 | *)
153 | #echo "Usage: $SCRIPTNAME {start|stop|restart|reload|force-reload}" >&2
154 | echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2
155 | exit 3
156 | ;;
157 | esac
158 |
159 | :
160 |
--------------------------------------------------------------------------------