itamae-plugin-recipe-redis 0.1.1

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: b9884e4fd48287f753d7191ad784c03e46348e29
4
+ data.tar.gz: 7ec01ca45784809d61ae9cb6e5b9db78c83300be
5
+ SHA512:
6
+ metadata.gz: 528c6a0ee433f00afdca6b4a59cee46157173ab457253cbfd60372527a2e9a31d8a215aacb308882b78f833dd1d1a0ec3f014cc83ac16286ccb0001ddac8ab8f
7
+ data.tar.gz: 968688ef2d7437dd86a3ea6b953cdf73cfcc9b60eae721a27e5ba36f30709e1faff05fca6f3e9ff4c4ea973fdb6541c7d43d610aea71ad76ea4565fb71cd4b2f
@@ -0,0 +1,9 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
@@ -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
+
@@ -0,0 +1,81 @@
1
+ # Itamae::Plugin::Recipe::Redis
2
+
3
+ [Itamae](https://github.com/itamae-kitchen/itamae) plugin to install redis.
4
+
5
+ ## Installation
6
+
7
+ Add this line to your application's Gemfile:
8
+
9
+ ```ruby
10
+ gem 'itamae-plugin-recipe-redis'
11
+ ```
12
+
13
+ And then execute:
14
+
15
+ $ bundle
16
+
17
+ Or install it yourself as:
18
+
19
+ $ gem install itamae-plugin-recipe-redis
20
+
21
+ ## Usage
22
+
23
+ ### Recipe
24
+
25
+ #### package recipe
26
+
27
+ Install redis package.
28
+
29
+ ```
30
+ # your recipe
31
+ include_recipe 'redis::package'
32
+ ```
33
+
34
+ #### config recipe
35
+
36
+ Configure redis.
37
+
38
+ ```
39
+ # your recipe
40
+ include_recipe 'redis::package'
41
+ include_recipe 'redis::config'
42
+ ```
43
+
44
+ NOTE: `config` recipe depend on `package` recipe.
45
+
46
+ ##### Node
47
+
48
+ ```
49
+ redis:
50
+ port: 6379
51
+ ```
52
+
53
+ | name | description |
54
+ |:-----|:------------|
55
+ | redis.port | port number of redis |
56
+
57
+ #### enable recipe
58
+
59
+ Enable redis service.
60
+
61
+ ```
62
+ # your recipe
63
+ include_recipe 'redis::package'
64
+ include_recipe 'redis::enable'
65
+ ```
66
+
67
+ NOTE: `enable` recipe depend on `package` recipe.
68
+
69
+ ## Contributing
70
+
71
+ 1. Fork it ( https://github.com/[my-github-username]/itamae-plugin-recipe-redis/fork )
72
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
73
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
74
+ 4. Push to the branch (`git push origin my-new-feature`)
75
+ 5. Create a new Pull Request
76
+
77
+ # License
78
+
79
+ Copyright 2015 Leonis & Co.
80
+
81
+ MIT License
@@ -0,0 +1 @@
1
+ require "bundler/gem_tasks"
@@ -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
@@ -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-redis'
8
+ spec.version = Itamae::Plugin::Recipe::Redis::VERSION
9
+ spec.authors = ['Daisuke Hirakiuchi']
10
+ spec.email = ['devops@leonisand.co']
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/leonis/itamae-plugin-recipe-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,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
@@ -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', 'amazon'
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,22 @@
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', 'amazon'
16
+ package 'redis' do
17
+ version redis_version unless redis_version.nil?
18
+ options '--enablerepo=epel'
19
+ end
20
+ else
21
+ fail "Sorry, your platform(#{node[:platform]}) is not supported yet."
22
+ end
@@ -0,0 +1,9 @@
1
+ module Itamae
2
+ module Plugin
3
+ module Recipe
4
+ module Redis
5
+ VERSION = "0.1.1"
6
+ end
7
+ end
8
+ end
9
+ end
metadata ADDED
@@ -0,0 +1,100 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: itamae-plugin-recipe-redis
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Daisuke Hirakiuchi
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2016-10-12 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
+ - devops@leonisand.co
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/leonis/itamae-plugin-recipe-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.2.2
97
+ signing_key:
98
+ specification_version: 4
99
+ summary: Itamae plugin to install redis.
100
+ test_files: []