summaryrefslogtreecommitdiff
path: root/features/data/cookbooks
diff options
context:
space:
mode:
Diffstat (limited to 'features/data/cookbooks')
-rw-r--r--features/data/cookbooks/integration_setup/attributes/integration.rb25
-rw-r--r--features/data/cookbooks/integration_setup/recipes/default.rb25
-rw-r--r--features/data/cookbooks/manage_files/recipes/create_a_file.rb22
-rw-r--r--features/data/cookbooks/manage_files/recipes/default.rb19
-rw-r--r--features/data/cookbooks/manage_files/recipes/delete_a_file.rb24
-rw-r--r--features/data/cookbooks/manage_files/recipes/delete_a_file_that_does_not_already_exist.rb22
-rw-r--r--features/data/cookbooks/manage_files/recipes/set_the_owner_of_a_created_file.rb23
-rw-r--r--features/data/cookbooks/manage_files/recipes/touch_a_file.rb22
-rw-r--r--features/data/cookbooks/transfer_remote_files/files/default/transfer_a_file_from_a_cookbook.txt1
-rw-r--r--features/data/cookbooks/transfer_remote_files/recipes/default.rb18
-rw-r--r--features/data/cookbooks/transfer_remote_files/recipes/should_prefer_the_file_for_this_specific_host.rb22
-rw-r--r--features/data/cookbooks/transfer_remote_files/recipes/transfer_a_file_from_a_cookbook.rb22
12 files changed, 245 insertions, 0 deletions
diff --git a/features/data/cookbooks/integration_setup/attributes/integration.rb b/features/data/cookbooks/integration_setup/attributes/integration.rb
new file mode 100644
index 0000000000..7ee3a25090
--- /dev/null
+++ b/features/data/cookbooks/integration_setup/attributes/integration.rb
@@ -0,0 +1,25 @@
+#
+# Cookbook Name:: integration_setup
+# Recipe:: default
+#
+# Copyright 2009, Opscode
+#
+# 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.
+#
+
+require 'tmpdir'
+
+int(Mash.new)
+int[:tmpdir] = File.join(Dir.tmpdir, "chef_integration")
+
+tmpdir int[:tmpdir] \ No newline at end of file
diff --git a/features/data/cookbooks/integration_setup/recipes/default.rb b/features/data/cookbooks/integration_setup/recipes/default.rb
new file mode 100644
index 0000000000..0ada2aa485
--- /dev/null
+++ b/features/data/cookbooks/integration_setup/recipes/default.rb
@@ -0,0 +1,25 @@
+#
+# Cookbook Name:: integration_setup
+# Recipe:: default
+#
+# Copyright 2009, Opscode
+#
+# 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.
+#
+
+directory node[:int][:tmpdir] do
+ owner "root"
+ mode 1777
+ action :create
+end
+
diff --git a/features/data/cookbooks/manage_files/recipes/create_a_file.rb b/features/data/cookbooks/manage_files/recipes/create_a_file.rb
new file mode 100644
index 0000000000..5a327d64b3
--- /dev/null
+++ b/features/data/cookbooks/manage_files/recipes/create_a_file.rb
@@ -0,0 +1,22 @@
+#
+# Cookbook Name:: files
+# Recipe:: default
+#
+# Copyright 2009, Opscode
+#
+# 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.
+#
+
+file "#{node[:tmpdir]}/create_a_file.txt" do
+ action :create
+end \ No newline at end of file
diff --git a/features/data/cookbooks/manage_files/recipes/default.rb b/features/data/cookbooks/manage_files/recipes/default.rb
new file mode 100644
index 0000000000..8b9f7ab0cf
--- /dev/null
+++ b/features/data/cookbooks/manage_files/recipes/default.rb
@@ -0,0 +1,19 @@
+#
+# Cookbook Name:: files
+# Recipe:: default
+#
+# Copyright 2009, Opscode
+#
+# 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.
+#
+
diff --git a/features/data/cookbooks/manage_files/recipes/delete_a_file.rb b/features/data/cookbooks/manage_files/recipes/delete_a_file.rb
new file mode 100644
index 0000000000..5d3faf41cd
--- /dev/null
+++ b/features/data/cookbooks/manage_files/recipes/delete_a_file.rb
@@ -0,0 +1,24 @@
+#
+# Cookbook Name:: files
+# Recipe:: default
+#
+# Copyright 2009, Opscode
+#
+# 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.
+#
+
+include_recipe 'manage_files::create_a_file'
+
+file "#{node[:tmpdir]}/create_a_file.txt" do
+ action :delete
+end \ No newline at end of file
diff --git a/features/data/cookbooks/manage_files/recipes/delete_a_file_that_does_not_already_exist.rb b/features/data/cookbooks/manage_files/recipes/delete_a_file_that_does_not_already_exist.rb
new file mode 100644
index 0000000000..f6c2e33147
--- /dev/null
+++ b/features/data/cookbooks/manage_files/recipes/delete_a_file_that_does_not_already_exist.rb
@@ -0,0 +1,22 @@
+#
+# Cookbook Name:: files
+# Recipe:: default
+#
+# Copyright 2009, Opscode
+#
+# 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.
+#
+
+file "#{node[:tmpdir]}/create_a_file.txt" do
+ action :delete
+end \ No newline at end of file
diff --git a/features/data/cookbooks/manage_files/recipes/set_the_owner_of_a_created_file.rb b/features/data/cookbooks/manage_files/recipes/set_the_owner_of_a_created_file.rb
new file mode 100644
index 0000000000..28a92550e3
--- /dev/null
+++ b/features/data/cookbooks/manage_files/recipes/set_the_owner_of_a_created_file.rb
@@ -0,0 +1,23 @@
+#
+# Cookbook Name:: files
+# Recipe:: default
+#
+# Copyright 2009, Opscode
+#
+# 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.
+#
+
+file "#{node[:tmpdir]}/create_a_file.txt" do
+ owner 'nobody'
+ action :create
+end \ No newline at end of file
diff --git a/features/data/cookbooks/manage_files/recipes/touch_a_file.rb b/features/data/cookbooks/manage_files/recipes/touch_a_file.rb
new file mode 100644
index 0000000000..3aff3fa6d6
--- /dev/null
+++ b/features/data/cookbooks/manage_files/recipes/touch_a_file.rb
@@ -0,0 +1,22 @@
+#
+# Cookbook Name:: files
+# Recipe:: default
+#
+# Copyright 2009, Opscode
+#
+# 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.
+#
+
+file "#{node[:tmpdir]}/touch_test.txt" do
+ action :touch
+end \ No newline at end of file
diff --git a/features/data/cookbooks/transfer_remote_files/files/default/transfer_a_file_from_a_cookbook.txt b/features/data/cookbooks/transfer_remote_files/files/default/transfer_a_file_from_a_cookbook.txt
new file mode 100644
index 0000000000..9fb38fab62
--- /dev/null
+++ b/features/data/cookbooks/transfer_remote_files/files/default/transfer_a_file_from_a_cookbook.txt
@@ -0,0 +1 @@
+easy like sunday morning
diff --git a/features/data/cookbooks/transfer_remote_files/recipes/default.rb b/features/data/cookbooks/transfer_remote_files/recipes/default.rb
new file mode 100644
index 0000000000..8bba761657
--- /dev/null
+++ b/features/data/cookbooks/transfer_remote_files/recipes/default.rb
@@ -0,0 +1,18 @@
+#
+# Cookbook Name:: transfer_remote_files
+# Recipe:: default
+#
+# Copyright 2009, Opscode
+#
+# 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.
+#
diff --git a/features/data/cookbooks/transfer_remote_files/recipes/should_prefer_the_file_for_this_specific_host.rb b/features/data/cookbooks/transfer_remote_files/recipes/should_prefer_the_file_for_this_specific_host.rb
new file mode 100644
index 0000000000..98415d1b15
--- /dev/null
+++ b/features/data/cookbooks/transfer_remote_files/recipes/should_prefer_the_file_for_this_specific_host.rb
@@ -0,0 +1,22 @@
+#
+# Cookbook Name:: transfer_remote_files
+# Recipe:: default
+#
+# Copyright 2009, Opscode
+#
+# 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.
+#
+
+remote_file "#{node[:tmpdir]}/host_specific.txt" do
+ source "host_specific.txt"
+end \ No newline at end of file
diff --git a/features/data/cookbooks/transfer_remote_files/recipes/transfer_a_file_from_a_cookbook.rb b/features/data/cookbooks/transfer_remote_files/recipes/transfer_a_file_from_a_cookbook.rb
new file mode 100644
index 0000000000..70a650c803
--- /dev/null
+++ b/features/data/cookbooks/transfer_remote_files/recipes/transfer_a_file_from_a_cookbook.rb
@@ -0,0 +1,22 @@
+#
+# Cookbook Name:: transfer_remote_files
+# Recipe:: default
+#
+# Copyright 2009, Opscode
+#
+# 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.
+#
+
+remote_file "#{node[:tmpdir]}/transfer_a_file_from_a_cookbook.txt" do
+ source "transfer_a_file_from_a_cookbook.txt"
+end \ No newline at end of file