itamae-plugin-recipe-kzyty_redis 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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 57e062b3766027ff773d7cb53ae4a912484fd159
4
+ data.tar.gz: 130507fd3c7d4456e53752caa5abf07d96576a82
5
+ SHA512:
6
+ metadata.gz: f75f991e37328e2485e77c8fff4d67fac1cef554eedee0b14fc0b9e9359591fb13225e959d8f972ac2f30b977734c67bc2acf5054e5f27664beb82f1af851d11
7
+ data.tar.gz: 3811414b05ce7ad12f9fe669a574b6a37f7e99e8995d6cd43f90b2bfac1df533a5fcfea194ac0beaf2ca34e63f5af716e7272f1a00a5bd35972bb3276678ea6e
data/.gitignore ADDED
@@ -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/.travis.yml ADDED
@@ -0,0 +1,3 @@
1
+ language: ruby
2
+ rvm:
3
+ - 2.1.2
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in itamae-plugin-recipe-redis.gemspec
4
+ gemspec
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 Leonis & Co.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
data/README.md ADDED
@@ -0,0 +1,84 @@
1
+ # Itamae::Plugin::Recipe::Redis
2
+
3
+ [Itamae](https://github.com/itamae-kitchen/itamae) plugin to install redis.
4
+
5
+ ## Forked for temporarily gem
6
+ https://github.com/leonis/itamae-plugin-recipe-redis/issues/1
7
+
8
+ ## Installation
9
+
10
+ Add this line to your application's Gemfile:
11
+
12
+ ```ruby
13
+ gem 'itamae-plugin-recipe-redis'
14
+ ```
15
+
16
+ And then execute:
17
+
18
+ $ bundle
19
+
20
+ Or install it yourself as:
21
+
22
+ $ gem install itamae-plugin-recipe-redis
23
+
24
+ ## Usage
25
+
26
+ ### Recipe
27
+
28
+ #### package recipe
29
+
30
+ Install redis package.
31
+
32
+ ```
33
+ # your recipe
34
+ include_recipe 'redis::package'
35
+ ```
36
+
37
+ #### config recipe
38
+
39
+ Configure redis.
40
+
41
+ ```
42
+ # your recipe
43
+ include_recipe 'redis::package'
44
+ include_recipe 'redis::config'
45
+ ```
46
+
47
+ NOTE: `config` recipe depend on `package` recipe.
48
+
49
+ ##### Node
50
+
51
+ ```
52
+ redis:
53
+ port: 6379
54
+ ```
55
+
56
+ | name | description |
57
+ |:-----|:------------|
58
+ | redis.port | port number of redis |
59
+
60
+ #### enable recipe
61
+
62
+ Enable redis service.
63
+
64
+ ```
65
+ # your recipe
66
+ include_recipe 'redis::package'
67
+ include_recipe 'redis::enable'
68
+ ```
69
+
70
+ NOTE: `enable` recipe depend on `package` recipe.
71
+
72
+ ## Contributing
73
+
74
+ 1. Fork it ( https://github.com/[my-github-username]/itamae-plugin-recipe-redis/fork )
75
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
76
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
77
+ 4. Push to the branch (`git push origin my-new-feature`)
78
+ 5. Create a new Pull Request
79
+
80
+ # License
81
+
82
+ Copyright 2015 Leonis & Co.
83
+
84
+ MIT License
data/Rakefile ADDED
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
data/bin/console ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require "bundler/setup"
4
+ require "itamae/plugin/recipe/redis"
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
data/bin/setup ADDED
@@ -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,24 @@
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/redis/version'
5
+
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'itamae-plugin-recipe-kzyty_redis'
8
+ spec.version = Itamae::Plugin::Recipe::Redis::VERSION
9
+ spec.authors = ['Taiyo Kojima']
10
+ spec.email = ['kozyty@gmail.com']
11
+ spec.licenses = ['MIT']
12
+
13
+ spec.summary = 'Itamae plugin to install redis.'
14
+ spec.description = 'Itamae plugin to install redis by package.'
15
+ spec.homepage = 'https://github.com/kozyty/itamae-plugin-recipe-kzyty_redis'
16
+
17
+ spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
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.9'
22
+ spec.add_development_dependency 'rake', '~> 10.0'
23
+ spec.add_runtime_dependency 'itamae', '~> 1.2'
24
+ end
@@ -0,0 +1,13 @@
1
+ # Configure redis
2
+
3
+ node.reverse_merge!(
4
+ redis: {
5
+ port: 6379
6
+ }
7
+ )
8
+
9
+ port = node[:redis][:port]
10
+ execute 'configure redis port ' do
11
+ command %(sed -i -e 's/^port [0-9]\\{1,\\}$/port #{port}/g' /etc/redis.conf)
12
+ not_if %(grep -e '^port #{port}$' /etc/redis.conf)
13
+ end
@@ -0,0 +1,15 @@
1
+ # Enable redis service
2
+
3
+ service_name = \
4
+ case node[:platform]
5
+ when 'debian', 'ubuntu'
6
+ 'redis-server'
7
+ when 'redhat', 'fedora'
8
+ 'redis'
9
+ else
10
+ fail "Sorry, your platform(#{node[:platform]}) is not supported yet."
11
+ end
12
+
13
+ service service_name do
14
+ action [:enable, :start]
15
+ end
@@ -0,0 +1,20 @@
1
+ # Install redis by package.
2
+
3
+ redis_version = \
4
+ if !node[:redis].nil? && !node[:redis][:version].nil?
5
+ node[:redis][:version]
6
+ else
7
+ nil
8
+ end
9
+
10
+ case node[:platform]
11
+ when 'debian', 'ubuntu'
12
+ package 'redis-server' do
13
+ version redis_version unless redis_version.nil?
14
+ end
15
+ when 'redhat', 'fedora'
16
+ package 'redis' do
17
+ version redis_version unless redis_version.nil?
18
+ options '--enablerepo=epel'
19
+ end
20
+ end
@@ -0,0 +1,9 @@
1
+ module Itamae
2
+ module Plugin
3
+ module Recipe
4
+ module Redis
5
+ VERSION = "0.1.0"
6
+ end
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ require "itamae/plugin/recipe/redis/version"
2
+
3
+ module Itamae
4
+ module Plugin
5
+ module Recipe
6
+ module Redis
7
+ # Your code goes here...
8
+ end
9
+ end
10
+ end
11
+ end
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: itamae-plugin-recipe-kzyty_redis
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Taiyo Kojima
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2015-12-24 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.9'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.9'
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: itamae
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '1.2'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '1.2'
55
+ description: Itamae plugin to install redis by package.
56
+ email:
57
+ - kozyty@gmail.com
58
+ executables: []
59
+ extensions: []
60
+ extra_rdoc_files: []
61
+ files:
62
+ - ".gitignore"
63
+ - ".travis.yml"
64
+ - Gemfile
65
+ - LICENSE
66
+ - README.md
67
+ - Rakefile
68
+ - bin/console
69
+ - bin/setup
70
+ - itamae-plugin-recipe-redis.gemspec
71
+ - lib/itamae/plugin/recipe/redis.rb
72
+ - lib/itamae/plugin/recipe/redis/config.rb
73
+ - lib/itamae/plugin/recipe/redis/enable.rb
74
+ - lib/itamae/plugin/recipe/redis/package.rb
75
+ - lib/itamae/plugin/recipe/redis/version.rb
76
+ homepage: https://github.com/kozyty/itamae-plugin-recipe-kzyty_redis
77
+ licenses:
78
+ - MIT
79
+ metadata: {}
80
+ post_install_message:
81
+ rdoc_options: []
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ requirements: []
95
+ rubyforge_project:
96
+ rubygems_version: 2.4.5
97
+ signing_key:
98
+ specification_version: 4
99
+ summary: Itamae plugin to install redis.
100
+ test_files: []