itamae-plugin-recipe-raspberry_pi 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: e6454ec6438d3918fbcdd05b1af63ac01a5efea7
4
+ data.tar.gz: 7b29ca0a554c59ff045048cefd263be76f338164
5
+ SHA512:
6
+ metadata.gz: 164af91e155e62e557dea808393b8b68cd79eb5363ce3e7ed3efde85db68d6e8c28c2f4acdfa03fbd35360265b2e18fcbc55cc4cc008d3a9df1acd998881247d
7
+ data.tar.gz: ce1e37fe09cc8aa52dc4a25b3a7d09c2d29792a5b5573967e190b1a962b81aa84190116ba177190a5041a2f7fcc2c97159e7d8c84229316d6757ec48c13fab1d
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
data/.rspec ADDED
@@ -0,0 +1,2 @@
1
+ --format documentation
2
+ --color
@@ -0,0 +1 @@
1
+ itamae-plugin-recipe-raspberry_pi
@@ -0,0 +1 @@
1
+ ruby-2.2.2
@@ -0,0 +1,4 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.2.2
4
+ before_install: gem install bundler -v 1.10.6
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in itamae-plugin-recipe-raspberry_pi.gemspec
4
+ gemspec
@@ -0,0 +1,30 @@
1
+ Itamae::Plugin::Recipe::RaspberryPi
2
+ ========
3
+
4
+ Itamae plugin for Setup RaspberryPi.
5
+
6
+ Installation
7
+ --------
8
+
9
+ Add this line to your application's Gemfile:
10
+
11
+ ```ruby
12
+ gem 'itamae-plugin-recipe-raspberry_pi'
13
+ ```
14
+
15
+ And then execute:
16
+
17
+ $ bundle
18
+
19
+ Or install it yourself as:
20
+
21
+ $ gem install itamae-plugin-recipe-raspberry_pi
22
+
23
+ ## Usage
24
+
25
+ Include your recipe.
26
+
27
+ ```ruby
28
+ include_recipe 'raspberry_pi'
29
+ ```
30
+
@@ -0,0 +1,6 @@
1
+ require "bundler/gem_tasks"
2
+ require "rspec/core/rake_task"
3
+
4
+ RSpec::Core::RakeTask.new(:spec)
5
+
6
+ task :default => :spec
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "itamae/plugin/recipe/raspberry_pi"
5
+
6
+ # You can add fixtures and/or initialization code here to make experimenting
7
+ # with your gem easier. You can also use a different console, if you like.
8
+
9
+ # (If you use this, don't forget to add pry to your Gemfile!)
10
+ # require "pry"
11
+ # Pry.start
12
+
13
+ require "irb"
14
+ IRB.start
@@ -0,0 +1,7 @@
1
+ #!/bin/bash
2
+ set -euo pipefail
3
+ IFS=$'\n\t'
4
+
5
+ bundle install
6
+
7
+ # Do any other automated setup that you need to do here
@@ -0,0 +1,26 @@
1
+ # coding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'itamae/plugin/recipe/raspberry_pi/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'itamae-plugin-recipe-raspberry_pi'
8
+ spec.version = Itamae::Plugin::Recipe::RaspberryPi::VERSION
9
+ spec.authors = ['Takahiro HAMAGUCHI']
10
+ spec.email = ['tk.hamaguchi@gmail.com']
11
+
12
+ spec.summary = 'Raspberry Pi installer with itemae'
13
+ spec.description = 'Raspberry Pi installer with itemae.'
14
+ spec.homepage = ''
15
+
16
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ spec.bindir = 'exe'
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_development_dependency 'bundler', '~> 1.10'
22
+ spec.add_development_dependency 'rake', '~> 10.0'
23
+ spec.add_development_dependency 'rspec'
24
+ spec.add_runtime_dependency 'itamae', '~> 1.4.1'
25
+
26
+ end
@@ -0,0 +1,77 @@
1
+ execute 'update package list' do
2
+ user 'root'
3
+ command 'apt-get update -y'
4
+ end
5
+
6
+ execute 'update packages' do
7
+ user 'root'
8
+ command 'apt-get upgrade -y'
9
+ end
10
+
11
+ execute 'rpi update' do
12
+ user 'root'
13
+ command 'SKIP_WARNING=1 rpi-update'
14
+ end
15
+
16
+ execute 'swap off' do
17
+ user 'root'
18
+ command 'swapoff --all'
19
+ not_if "free | grep '^Swap: \+0 \+ \+0 \+ \+0$'"
20
+ end
21
+
22
+ package 'dphys-swapfile' do
23
+ action :remove
24
+ end
25
+
26
+ file '/etc/rc.local' do
27
+ user 'root'
28
+ action :edit
29
+ block do |content|
30
+ content.gsub!(/^exit 0$/, <<-"EOS".gsub(/^\s+\|/, ''))
31
+ |### Itamae cooked
32
+ |mkdir -p /var/log/ConsoleKit
33
+ |mkdir -p /var/log/samba
34
+ |mkdir -p /var/log/fsck
35
+ |mkdir -p /var/log/apt
36
+ |mkdir -p /var/log/ntpstats
37
+ |chown root.ntp /var/log/ntpstats
38
+ |chown root.adm /var/log/samba
39
+ |touch /var/log/lastlog
40
+ |touch /var/log/wtmp
41
+ |touch /var/log/btmp
42
+ |chown root.utmp /var/log/lastlog
43
+ |chown root.utmp /var/log/wtmp
44
+ |chown root.utmp /var/log/btmp
45
+ |### Itamae cooked
46
+ |
47
+ |exit 0
48
+ EOS
49
+ end
50
+ not_if "grep '^### Itamae cooked$' /etc/rc.local"
51
+ end
52
+
53
+ file '/etc/fstab' do
54
+ user 'root'
55
+ action :edit
56
+ block do |content|
57
+ content.concat(<<-"EOS".gsub(/^\s+\|/, ''))
58
+ |
59
+ |### Itamae cooked
60
+ |tmpfs /tmp tmpfs defaults,size=32m,noatime,mode=1777 0 0
61
+ |tmpfs /var/tmp tmpfs defaults,size=16m,noatime,mode=1777 0 0
62
+ |tmpfs /var/log tmpfs defaults,size=32m,noatime,mode=0755 0 0
63
+ |### Itamae cooked
64
+ EOS
65
+ end
66
+ not_if "grep '^### Itamae cooked$' /etc/fstab"
67
+ end
68
+
69
+ execute 'expand rootfs' do
70
+ user 'root'
71
+ command 'raspi-config --expand-rootfs'
72
+ end
73
+
74
+ execute 'reboot' do
75
+ user 'root'
76
+ command 'reboot'
77
+ end
@@ -0,0 +1,9 @@
1
+ module Itamae
2
+ module Plugin
3
+ module Recipe
4
+ module RaspberryPi
5
+ VERSION = "0.1.0"
6
+ end
7
+ end
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,112 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: itamae-plugin-recipe-raspberry_pi
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Takahiro HAMAGUCHI
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2015-07-26 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: bundler
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.10'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.10'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rake
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '10.0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '10.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: itamae
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 1.4.1
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 1.4.1
69
+ description: Raspberry Pi installer with itemae.
70
+ email:
71
+ - tk.hamaguchi@gmail.com
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".rspec"
78
+ - ".ruby-gemset"
79
+ - ".ruby-version"
80
+ - ".travis.yml"
81
+ - Gemfile
82
+ - README.md
83
+ - Rakefile
84
+ - bin/console
85
+ - bin/setup
86
+ - itamae-plugin-recipe-raspberry_pi.gemspec
87
+ - lib/itamae/plugin/recipe/raspberry_pi.rb
88
+ - lib/itamae/plugin/recipe/raspberry_pi/version.rb
89
+ homepage: ''
90
+ licenses: []
91
+ metadata: {}
92
+ post_install_message:
93
+ rdoc_options: []
94
+ require_paths:
95
+ - lib
96
+ required_ruby_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ required_rubygems_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ requirements: []
107
+ rubyforge_project:
108
+ rubygems_version: 2.4.8
109
+ signing_key:
110
+ specification_version: 4
111
+ summary: Raspberry Pi installer with itemae
112
+ test_files: []