abrizer 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 +7 -0
- data/.gitignore +11 -0
- data/.travis.yml +5 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +91 -0
- data/Rakefile +10 -0
- data/Vagrantfile +76 -0
- data/abrizer.gemspec +31 -0
- data/ansible/development-playbook.retry +1 -0
- data/ansible/development-playbook.yml +19 -0
- data/ansible/development.ini +2 -0
- data/ansible/roles/basic-setup/tasks/main.yml +39 -0
- data/ansible/roles/bento4/tasks/main.yml +14 -0
- data/ansible/roles/ffmpeg/defaults/main.yml +6 -0
- data/ansible/roles/ffmpeg/tasks/ff-libraries.yml +21 -0
- data/ansible/roles/ffmpeg/tasks/ffmpeg.yml +18 -0
- data/ansible/roles/ffmpeg/tasks/libfdk_aac.yml +19 -0
- data/ansible/roles/ffmpeg/tasks/libmp3lame.yml +20 -0
- data/ansible/roles/ffmpeg/tasks/libogg.yml +18 -0
- data/ansible/roles/ffmpeg/tasks/libopus.yml +20 -0
- data/ansible/roles/ffmpeg/tasks/libvorbis.yml +18 -0
- data/ansible/roles/ffmpeg/tasks/libvpx.yml +18 -0
- data/ansible/roles/ffmpeg/tasks/main.yml +80 -0
- data/ansible/roles/ffmpeg/tasks/x264.yml +18 -0
- data/ansible/roles/ffmpeg/tasks/x265.yml +14 -0
- data/ansible/roles/ffmpeg/tasks/yasm.yml +19 -0
- data/ansible/roles/franklinkim.environment/.clog.toml +4 -0
- data/ansible/roles/franklinkim.environment/.editorconfig +16 -0
- data/ansible/roles/franklinkim.environment/.gitignore +2 -0
- data/ansible/roles/franklinkim.environment/.travis.yml +17 -0
- data/ansible/roles/franklinkim.environment/CHANGELOG.md +14 -0
- data/ansible/roles/franklinkim.environment/LICENSE +22 -0
- data/ansible/roles/franklinkim.environment/Makefile +11 -0
- data/ansible/roles/franklinkim.environment/README.md +100 -0
- data/ansible/roles/franklinkim.environment/Vagrantfile +23 -0
- data/ansible/roles/franklinkim.environment/defaults/main.yml +13 -0
- data/ansible/roles/franklinkim.environment/meta/.galaxy_install_info +1 -0
- data/ansible/roles/franklinkim.environment/meta/main.yml +143 -0
- data/ansible/roles/franklinkim.environment/meta/readme.yml +11 -0
- data/ansible/roles/franklinkim.environment/tasks/config.yml +21 -0
- data/ansible/roles/franklinkim.environment/tasks/main.yml +8 -0
- data/ansible/roles/franklinkim.environment/tests/main.yml +8 -0
- data/ansible/roles/rvm_io.rvm1-ruby/.gitignore +6 -0
- data/ansible/roles/rvm_io.rvm1-ruby/.travis.yml +52 -0
- data/ansible/roles/rvm_io.rvm1-ruby/LICENSE +22 -0
- data/ansible/roles/rvm_io.rvm1-ruby/README.md +142 -0
- data/ansible/roles/rvm_io.rvm1-ruby/defaults/main.yml +44 -0
- data/ansible/roles/rvm_io.rvm1-ruby/meta/main.yml +21 -0
- data/ansible/roles/rvm_io.rvm1-ruby/tasks/main.yml +4 -0
- data/ansible/roles/rvm_io.rvm1-ruby/tasks/rubies.yml +78 -0
- data/ansible/roles/rvm_io.rvm1-ruby/tasks/rvm.yml +55 -0
- data/ansible/roles/rvm_io.rvm1-ruby/tests/inventory +1 -0
- data/ansible/roles/rvm_io.rvm1-ruby/tests/test.yml +14 -0
- data/ansible/roles/rvm_io.rvm1-ruby/vars/main.yml +22 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/exe/abrizer +5 -0
- data/lib/abrizer/adaptation.rb +53 -0
- data/lib/abrizer/adaptation_finder.rb +59 -0
- data/lib/abrizer/all.rb +20 -0
- data/lib/abrizer/cleaner.rb +37 -0
- data/lib/abrizer/cli.rb +84 -0
- data/lib/abrizer/ffmpeg_processor.rb +59 -0
- data/lib/abrizer/ffprobe_informer.rb +69 -0
- data/lib/abrizer/filepath_helpers.rb +33 -0
- data/lib/abrizer/package_dash_bento.rb +35 -0
- data/lib/abrizer/package_dash_shaka.rb +49 -0
- data/lib/abrizer/package_hls_bento.rb +35 -0
- data/lib/abrizer/package_hls_shaka.rb +50 -0
- data/lib/abrizer/processor.rb +8 -0
- data/lib/abrizer/progressive_mp4.rb +37 -0
- data/lib/abrizer/progressive_vp9.rb +57 -0
- data/lib/abrizer/sprites.rb +24 -0
- data/lib/abrizer/version.rb +3 -0
- data/lib/abrizer.rb +22 -0
- metadata +232 -0
@@ -0,0 +1,16 @@
|
|
1
|
+
# EditorConfig helps developers define and maintain consistent
|
2
|
+
# coding styles between different editors and IDEs
|
3
|
+
# editorconfig.org
|
4
|
+
|
5
|
+
root = true
|
6
|
+
|
7
|
+
[*]
|
8
|
+
# Change these settings to your own preference
|
9
|
+
indent_size = 2
|
10
|
+
indent_style = space
|
11
|
+
|
12
|
+
# We recommend you to keep these unchanged
|
13
|
+
charset = utf-8
|
14
|
+
end_of_line = lf
|
15
|
+
insert_final_newline = true
|
16
|
+
trim_trailing_whitespace = true
|
@@ -0,0 +1,17 @@
|
|
1
|
+
---
|
2
|
+
language: phyton
|
3
|
+
python: "2.7"
|
4
|
+
|
5
|
+
sudo: required
|
6
|
+
|
7
|
+
services:
|
8
|
+
- docker
|
9
|
+
|
10
|
+
before_install:
|
11
|
+
- docker pull williamyeh/ansible:ubuntu14.04
|
12
|
+
|
13
|
+
script:
|
14
|
+
- make test
|
15
|
+
|
16
|
+
notifications:
|
17
|
+
webhooks: https://galaxy.ansible.com/api/v1/notifications/
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<a name="1.2.0"></a>
|
2
|
+
## 1.2.0 (2016-07-25)
|
3
|
+
|
4
|
+
|
5
|
+
#### Features
|
6
|
+
|
7
|
+
* use ansible-role docgen to generate documentions ([857dc0f6](https://github.com/weareinteractive/ansible-environment/commit/857dc0f68c89a86bef35b407f73ca775afa77cce))
|
8
|
+
* add .editorconfig ([35798f5b](https://github.com/weareinteractive/ansible-environment/commit/35798f5bfc49ace1f9fdbfee5013725665a8c282))
|
9
|
+
* add CHANGELOG ([44b96586](https://github.com/weareinteractive/ansible-environment/commit/44b96586ecf38c20faf19f3466b0e5a0a690f0db))
|
10
|
+
* add environment file user and group vars ([d626b7bf](https://github.com/weareinteractive/ansible-environment/commit/d626b7bfaf515bfe123f2d6d66207d0af1bb498e))
|
11
|
+
* add environment_file var to allow writing alternative files ([df721dba](https://github.com/weareinteractive/ansible-environment/commit/df721dbab4511da678f05eba9a18fda2088a405a))
|
12
|
+
|
13
|
+
|
14
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) We Are Interactive
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person
|
4
|
+
obtaining a copy of this software and associated documentation
|
5
|
+
files (the "Software"), to deal in the Software without
|
6
|
+
restriction, including without limitation the rights to use,
|
7
|
+
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
8
|
+
copies of the Software, and to permit persons to whom the
|
9
|
+
Software is furnished to do so, subject to the following
|
10
|
+
conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be
|
13
|
+
included in all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
17
|
+
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
19
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
20
|
+
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
21
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
22
|
+
OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,11 @@
|
|
1
|
+
PWD=$(shell pwd)
|
2
|
+
ROLE_NAME=weareinteractive.environment
|
3
|
+
ROLE_PATH=/etc/ansible/roles/$(ROLE_NAME)
|
4
|
+
TEST_VERSION=ansible --version
|
5
|
+
TEST_SYNTAX=ansible-playbook -vv -i 'localhost,' -c local $(ROLE_PATH)/tests/main.yml --syntax-check
|
6
|
+
TEST_PLAYBOOK=ansible-playbook -vv -i 'localhost,' -c local $(ROLE_PATH)/tests/main.yml
|
7
|
+
TEST_CMD=$(TEST_VERSION); $(TEST_SYNTAX); $(TEST_PLAYBOOK)
|
8
|
+
|
9
|
+
.PHONY: test
|
10
|
+
test:
|
11
|
+
docker run -it --rm -e "ROLE_NAME=$(ROLE_NAME)" -v $(PWD):$(ROLE_PATH) williamyeh/ansible:ubuntu14.04 /bin/bash -c "$(TEST_CMD)"
|
@@ -0,0 +1,100 @@
|
|
1
|
+
# Ansible franklinkim.environment role
|
2
|
+
|
3
|
+
[](https://travis-ci.org/weareinteractive/ansible-environment)
|
4
|
+
[](https://galaxy.ansible.com/weareinteractive/environment)
|
5
|
+
[](https://github.com/weareinteractive/ansible-environment)
|
6
|
+
[](https://github.com/weareinteractive/ansible-environment)
|
7
|
+
|
8
|
+
> `franklinkim.environment` is an [Ansible](http://www.ansible.com) role which:
|
9
|
+
>
|
10
|
+
> * adds `/etc/environment` variables
|
11
|
+
|
12
|
+
## Installation
|
13
|
+
|
14
|
+
Using `ansible-galaxy`:
|
15
|
+
|
16
|
+
```shell
|
17
|
+
$ ansible-galaxy install franklinkim.environment
|
18
|
+
```
|
19
|
+
|
20
|
+
Using `requirements.yml`:
|
21
|
+
|
22
|
+
```yaml
|
23
|
+
- src: franklinkim.environment
|
24
|
+
```
|
25
|
+
|
26
|
+
Using `git`:
|
27
|
+
|
28
|
+
```shell
|
29
|
+
$ git clone https://github.com/weareinteractive/ansible-environment.git franklinkim.environment
|
30
|
+
```
|
31
|
+
|
32
|
+
## Dependencies
|
33
|
+
|
34
|
+
* Ansible >= 2.0
|
35
|
+
|
36
|
+
## Variables
|
37
|
+
|
38
|
+
Here is a list of all the default variables for this role, which are also available in `defaults/main.yml`.
|
39
|
+
|
40
|
+
```yaml
|
41
|
+
---
|
42
|
+
|
43
|
+
# Path to the environment file
|
44
|
+
environment_file: /etc/environment
|
45
|
+
# The environment file owner
|
46
|
+
environment_file_owner: root
|
47
|
+
# The environment file group
|
48
|
+
environment_file_group: root
|
49
|
+
# A dictionary of config parameters i.e
|
50
|
+
#
|
51
|
+
# environment_config:
|
52
|
+
# LC_ALL: en_US.UTF-8
|
53
|
+
environment_config:
|
54
|
+
|
55
|
+
```
|
56
|
+
|
57
|
+
|
58
|
+
## Usage
|
59
|
+
|
60
|
+
This is an example playbook:
|
61
|
+
|
62
|
+
```yaml
|
63
|
+
---
|
64
|
+
|
65
|
+
- hosts: all
|
66
|
+
roles:
|
67
|
+
- franklinkim.environment
|
68
|
+
vars:
|
69
|
+
environment_config:
|
70
|
+
LC_ALL: C
|
71
|
+
|
72
|
+
```
|
73
|
+
|
74
|
+
|
75
|
+
## Testing
|
76
|
+
|
77
|
+
```shell
|
78
|
+
$ git clone https://github.com/weareinteractive/ansible-environment.git
|
79
|
+
$ cd ansible-environment
|
80
|
+
$ make test
|
81
|
+
```
|
82
|
+
|
83
|
+
## Contributing
|
84
|
+
In lieu of a formal style guide, take care to maintain the existing coding style. Add unit tests and examples for any new or changed functionality.
|
85
|
+
|
86
|
+
1. Fork it
|
87
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
88
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
89
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
90
|
+
5. Create new Pull Request
|
91
|
+
|
92
|
+
*Note: To update the `README.md` file please install and run `ansible-role`:*
|
93
|
+
|
94
|
+
```shell
|
95
|
+
$ gem install ansible-role
|
96
|
+
$ ansible-role docgen
|
97
|
+
```
|
98
|
+
|
99
|
+
## License
|
100
|
+
Copyright (c) We Are Interactive under the MIT license.
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# -*- mode: ruby -*-
|
2
|
+
# vi: set ft=ruby :
|
3
|
+
|
4
|
+
Vagrant.configure("2") do |config|
|
5
|
+
config.vbguest.no_remote = true
|
6
|
+
config.vbguest.auto_update = false
|
7
|
+
|
8
|
+
config.vm.define 'trusty' do |instance|
|
9
|
+
instance.vm.box = 'ubuntu/trusty64'
|
10
|
+
end
|
11
|
+
|
12
|
+
config.vm.define 'precise' do |instance|
|
13
|
+
instance.vm.box = 'ubuntu/precise64'
|
14
|
+
end
|
15
|
+
|
16
|
+
# View the documentation for the provider you're using for more
|
17
|
+
# information on available options.
|
18
|
+
config.vm.provision "ansible" do |ansible|
|
19
|
+
ansible.playbook = "test.yml"
|
20
|
+
ansible.verbose = 'vv'
|
21
|
+
ansible.sudo = true
|
22
|
+
end
|
23
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
---
|
2
|
+
|
3
|
+
# Path to the environment file
|
4
|
+
environment_file: /etc/environment
|
5
|
+
# The environment file owner
|
6
|
+
environment_file_owner: root
|
7
|
+
# The environment file group
|
8
|
+
environment_file_group: root
|
9
|
+
# A dictionary of config parameters i.e
|
10
|
+
#
|
11
|
+
# environment_config:
|
12
|
+
# LC_ALL: en_US.UTF-8
|
13
|
+
environment_config:
|
@@ -0,0 +1 @@
|
|
1
|
+
{install_date: 'Wed Aug 17 13:28:33 2016', version: 1.2.0}
|
@@ -0,0 +1,143 @@
|
|
1
|
+
---
|
2
|
+
galaxy_info:
|
3
|
+
author: franklin
|
4
|
+
company: We Are Interactive
|
5
|
+
description: Adds /etc/environment variables
|
6
|
+
min_ansible_version: 2.0
|
7
|
+
license: MIT
|
8
|
+
# Optionally specify the branch Galaxy will use when accessing the GitHub
|
9
|
+
# repo for this role. During role install, if no tags are available,
|
10
|
+
# Galaxy will use this branch. During import Galaxy will access files on
|
11
|
+
# this branch. If travis integration is cofigured, only notification for this
|
12
|
+
# branch will be accepted. Otherwise, in all cases, the repo's default branch
|
13
|
+
# (usually master) will be used.
|
14
|
+
github_branch: master
|
15
|
+
#
|
16
|
+
# Below are all platforms currently available. Just uncomment
|
17
|
+
# the ones that apply to your role. If you don't see your
|
18
|
+
# platform on this list, let us know and we'll get it added!
|
19
|
+
#
|
20
|
+
platforms:
|
21
|
+
#- name: EL
|
22
|
+
# versions:
|
23
|
+
# - all
|
24
|
+
# - 5
|
25
|
+
# - 6
|
26
|
+
# - 7
|
27
|
+
#- name: GenericUNIX
|
28
|
+
# versions:
|
29
|
+
# - all
|
30
|
+
# - any
|
31
|
+
#- name: Solaris
|
32
|
+
# versions:
|
33
|
+
# - all
|
34
|
+
# - 10
|
35
|
+
# - 11.0
|
36
|
+
# - 11.1
|
37
|
+
# - 11.2
|
38
|
+
# - 11.3
|
39
|
+
#- name: Fedora
|
40
|
+
# versions:
|
41
|
+
# - all
|
42
|
+
# - 16
|
43
|
+
# - 17
|
44
|
+
# - 18
|
45
|
+
# - 19
|
46
|
+
# - 20
|
47
|
+
# - 21
|
48
|
+
# - 22
|
49
|
+
# - 23
|
50
|
+
#- name: Windows
|
51
|
+
# versions:
|
52
|
+
# - all
|
53
|
+
# - 2012R2
|
54
|
+
#- name: SmartOS
|
55
|
+
# versions:
|
56
|
+
# - all
|
57
|
+
# - any
|
58
|
+
#- name: opensuse
|
59
|
+
# versions:
|
60
|
+
# - all
|
61
|
+
# - 12.1
|
62
|
+
# - 12.2
|
63
|
+
# - 12.3
|
64
|
+
# - 13.1
|
65
|
+
# - 13.2
|
66
|
+
#- name: Amazon
|
67
|
+
# versions:
|
68
|
+
# - all
|
69
|
+
# - 2013.03
|
70
|
+
# - 2013.09
|
71
|
+
#- name: GenericBSD
|
72
|
+
# versions:
|
73
|
+
# - all
|
74
|
+
# - any
|
75
|
+
#- name: FreeBSD
|
76
|
+
# versions:
|
77
|
+
# - all
|
78
|
+
# - 10.0
|
79
|
+
# - 10.1
|
80
|
+
# - 10.2
|
81
|
+
# - 8.0
|
82
|
+
# - 8.1
|
83
|
+
# - 8.2
|
84
|
+
# - 8.3
|
85
|
+
# - 8.4
|
86
|
+
# - 9.0
|
87
|
+
# - 9.1
|
88
|
+
# - 9.1
|
89
|
+
# - 9.2
|
90
|
+
# - 9.3
|
91
|
+
- name: Ubuntu
|
92
|
+
versions:
|
93
|
+
- all
|
94
|
+
# - lucid
|
95
|
+
# - maverick
|
96
|
+
# - natty
|
97
|
+
# - oneiric
|
98
|
+
# - precise
|
99
|
+
# - quantal
|
100
|
+
# - raring
|
101
|
+
# - saucy
|
102
|
+
# - trusty
|
103
|
+
# - utopic
|
104
|
+
# - vivid
|
105
|
+
# - wily
|
106
|
+
#- name: SLES
|
107
|
+
# versions:
|
108
|
+
# - all
|
109
|
+
# - 10SP3
|
110
|
+
# - 10SP4
|
111
|
+
# - 11
|
112
|
+
# - 11SP1
|
113
|
+
# - 11SP2
|
114
|
+
# - 11SP3
|
115
|
+
#- name: GenericLinux
|
116
|
+
# versions:
|
117
|
+
# - all
|
118
|
+
# - any
|
119
|
+
- name: Debian
|
120
|
+
versions:
|
121
|
+
- all
|
122
|
+
# - etch
|
123
|
+
# - jessie
|
124
|
+
# - lenny
|
125
|
+
# - squeeze
|
126
|
+
# - wheezy categories:
|
127
|
+
#
|
128
|
+
# List tags for your role here, one per line. A tag is
|
129
|
+
# a keyword that describes and categorizes the role.
|
130
|
+
# Users find roles by searching for tags. Be sure to
|
131
|
+
# remove the '[]' above if you add tags to this list.
|
132
|
+
#
|
133
|
+
# NOTE: A tag is limited to a single word comprised of
|
134
|
+
# alphanumeric characters. Maximum 20 tags per role.
|
135
|
+
galaxy_tags:
|
136
|
+
- system
|
137
|
+
- environment
|
138
|
+
- env
|
139
|
+
# List your role dependencies here, one per line. Only
|
140
|
+
# dependencies available via galaxy should be listed here.
|
141
|
+
# Be sure to remove the '[]' above if you add dependencies
|
142
|
+
# to this list.
|
143
|
+
dependencies: []
|
@@ -0,0 +1,11 @@
|
|
1
|
+
---
|
2
|
+
galaxy_name: franklinkim.environment
|
3
|
+
github_user: weareinteractive
|
4
|
+
github_name: ansible-environment
|
5
|
+
badges: |
|
6
|
+
[](https://travis-ci.org/weareinteractive/ansible-environment)
|
7
|
+
[](https://galaxy.ansible.com/weareinteractive/environment)
|
8
|
+
[](https://github.com/weareinteractive/ansible-environment)
|
9
|
+
[](https://github.com/weareinteractive/ansible-environment)
|
10
|
+
description: |
|
11
|
+
> * adds `/etc/environment` variables
|
@@ -0,0 +1,21 @@
|
|
1
|
+
---
|
2
|
+
|
3
|
+
- name: Ensure file exists
|
4
|
+
file:
|
5
|
+
path: "{{ environment_file }}"
|
6
|
+
owner: "{{ environment_file_owner }}"
|
7
|
+
group: "{{ environment_file_group }}"
|
8
|
+
state: touch
|
9
|
+
|
10
|
+
- name: Remove previous values
|
11
|
+
lineinfile:
|
12
|
+
dest: "{{ environment_file }}"
|
13
|
+
regexp: '^{{ item.key | upper }}'
|
14
|
+
state: absent
|
15
|
+
with_dict: "{{ environment_config }}"
|
16
|
+
|
17
|
+
- name: Configuring environment
|
18
|
+
lineinfile:
|
19
|
+
dest: "{{ environment_file }}"
|
20
|
+
line: "{{ item.key | upper }}='{{ item.value }}'"
|
21
|
+
with_dict: "{{ environment_config }}"
|
@@ -0,0 +1,52 @@
|
|
1
|
+
---
|
2
|
+
language: 'python'
|
3
|
+
python: '2.7'
|
4
|
+
|
5
|
+
env:
|
6
|
+
- SITE_AND_INVENTORY='tests/test.yml -i tests/inventory'
|
7
|
+
|
8
|
+
before_install:
|
9
|
+
- '__rvm_unload ; rm -rf ~/.rvm'
|
10
|
+
|
11
|
+
install:
|
12
|
+
- 'pip install ansible==2.0.0'
|
13
|
+
- 'printf "[defaults]\nroles_path = ../" > ansible.cfg'
|
14
|
+
|
15
|
+
script:
|
16
|
+
- >
|
17
|
+
ruby -v
|
18
|
+
| grep -q 'ruby'
|
19
|
+
&& (echo 'No ruby test: pass' && exit 1)
|
20
|
+
|| (echo 'No ruby test: fail' && exit 0)
|
21
|
+
- 'ansible-playbook $SITE_AND_INVENTORY --syntax-check'
|
22
|
+
- 'ansible-playbook $SITE_AND_INVENTORY --connection=local -vvvv'
|
23
|
+
- >
|
24
|
+
ansible-playbook $SITE_AND_INVENTORY --connection=local
|
25
|
+
| grep -q 'changed=0.*failed=0'
|
26
|
+
&& (echo 'Idempotence test: pass' && exit 0)
|
27
|
+
|| (echo 'Idempotence test: fail' && exit 1)
|
28
|
+
- >
|
29
|
+
~/.rvm/wrappers/default/ruby -v
|
30
|
+
| grep -q '2.1.2'
|
31
|
+
&& (echo 'Default ruby test: pass' && exit 0)
|
32
|
+
|| (echo 'Default ruby test: fail' && exit 1)
|
33
|
+
- >
|
34
|
+
ls ~/.rvm/rubies
|
35
|
+
| grep -q 'ruby-2.1.0'
|
36
|
+
&& (echo 'Multiple rubies test: pass' && exit 0)
|
37
|
+
|| (echo 'Multiple rubies test: fail' && exit 1)
|
38
|
+
- >
|
39
|
+
ansible-playbook $SITE_AND_INVENTORY --connection=local --extra-vars='rvm1_delete_ruby=ruby-2.1.0'
|
40
|
+
| grep -q 'ok=1.*failed=0'
|
41
|
+
&& (echo 'Delete ruby test: pass' && exit 0)
|
42
|
+
|| (echo 'Delete ruby test: fail' && exit 1)
|
43
|
+
- >
|
44
|
+
ls ~/.rvm/rubies/ | wc -l
|
45
|
+
| grep -q '2'
|
46
|
+
&& (echo 'Really deleted ruby test: pass' && exit 0)
|
47
|
+
|| (echo 'Really deleted ruby test: fail' && exit 1)
|
48
|
+
- >
|
49
|
+
ls ~/.rvm/wrappers/default/
|
50
|
+
| grep -q 'bundler'
|
51
|
+
&& (echo 'Bundler symlinked on system path test: pass' && exit 0)
|
52
|
+
|| (echo 'Bundler symlinked on system path test: fail' && exit 1)
|
@@ -0,0 +1,22 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2014 Nick Janetakis nick.janetakis@gmail.com
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
'Software'), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
19
|
+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
20
|
+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
21
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
22
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
@@ -0,0 +1,142 @@
|
|
1
|
+
## What is rvm1-ansible? [](http://travis-ci.org/rvm/rvm1-ansible)
|
2
|
+
|
3
|
+
It is an [Ansible](http://www.ansible.com/home) role to install and manage ruby versions using rvm.
|
4
|
+
|
5
|
+
### Why should you use rvm?
|
6
|
+
|
7
|
+
In production it's useful because compiling a new version of ruby can easily
|
8
|
+
take upwards of 10 minutes. That's 10 minutes of your CPU being pegged at 100%.
|
9
|
+
|
10
|
+
rvm has pre-compiled binaries for a lot of operating systems. That means you can
|
11
|
+
install ruby in about 1 minute, even on a slow micro instance.
|
12
|
+
|
13
|
+
This role even adds the ruby binaries to your system path when doing a system
|
14
|
+
wide install. This allows you to access them as if they were installed without
|
15
|
+
using a version manager while still benefiting from what rvm has to offer.
|
16
|
+
|
17
|
+
## Installation
|
18
|
+
|
19
|
+
`$ ansible-galaxy install rvm_io.rvm1-ruby`
|
20
|
+
|
21
|
+
## Role variables
|
22
|
+
|
23
|
+
Below is a list of default values that you can configure:
|
24
|
+
|
25
|
+
```
|
26
|
+
---
|
27
|
+
|
28
|
+
# Install 1 or more versions of ruby
|
29
|
+
# The last ruby listed will be set as the default ruby
|
30
|
+
rvm1_rubies:
|
31
|
+
- 'ruby-2.1.3'
|
32
|
+
|
33
|
+
# Delete a specific version of ruby (ie. ruby-2.1.0)
|
34
|
+
rvm1_delete_ruby:
|
35
|
+
|
36
|
+
# Install path for rvm (defaults to system wide)
|
37
|
+
rvm1_install_path: '/usr/local/rvm'
|
38
|
+
|
39
|
+
# Add or remove any install flags
|
40
|
+
# NOTE: If you are doing a USER BASED INSTALL then
|
41
|
+
# make sure you ADD the --user-install flag below
|
42
|
+
rvm1_install_flags: '--auto-dotfiles'
|
43
|
+
|
44
|
+
# Add additional ruby install flags
|
45
|
+
rvm1_ruby_install_flags:
|
46
|
+
|
47
|
+
# Set the owner for the rvm directory
|
48
|
+
rvm1_user: 'root'
|
49
|
+
|
50
|
+
# URL for the latest installer script
|
51
|
+
rvm1_rvm_latest_installer: 'https://raw.githubusercontent.com/wayneeseguin/rvm/master/binscripts/rvm-installer'
|
52
|
+
|
53
|
+
# rvm version to use
|
54
|
+
rvm1_rvm_version: 'stable'
|
55
|
+
|
56
|
+
# Check and update rvm, disabling this will force rvm to never update
|
57
|
+
rvm1_rvm_check_for_updates: True
|
58
|
+
|
59
|
+
# GPG key verification, use an empty string if you want to skip this
|
60
|
+
# Note: Unless you know what you're doing, just keep it as is
|
61
|
+
# Identity proof: https://keybase.io/mpapis
|
62
|
+
# PGP message: https://rvm.io/mpapis.asc
|
63
|
+
rvm1_gpg_keys: 'D39DC0E3'
|
64
|
+
|
65
|
+
# The GPG key server
|
66
|
+
rvm1_gpg_key_server: 'hkp://keys.gnupg.net'
|
67
|
+
|
68
|
+
# autolib mode, see https://rvm.io/rvm/autolibs
|
69
|
+
rvm1_autolib_mode: 3
|
70
|
+
```
|
71
|
+
|
72
|
+
## Example playbook
|
73
|
+
|
74
|
+
```
|
75
|
+
---
|
76
|
+
|
77
|
+
- name: Configure servers with ruby support
|
78
|
+
hosts: all
|
79
|
+
|
80
|
+
roles:
|
81
|
+
- { role: rvm_io.rvm1-ruby, tags: ruby, sudo: True }
|
82
|
+
```
|
83
|
+
|
84
|
+
#### System wide installation
|
85
|
+
|
86
|
+
The above example would setup ruby system wide. It's very important that you
|
87
|
+
run the play with sudo because it will need to write to `/usr/local/rvm`.
|
88
|
+
|
89
|
+
#### To the same user as `ansible_ssh_user`
|
90
|
+
|
91
|
+
In this case, just overwrite `rvm_install_path` and set the `--user-install` flag:
|
92
|
+
|
93
|
+
**Note:** you still need to use sudo because during the ruby
|
94
|
+
installation phase rvm will internally make calls using sudo
|
95
|
+
to install certain ruby dependencies.
|
96
|
+
|
97
|
+
```
|
98
|
+
rvm1_install_flags: '--auto-dotfiles --user-install'
|
99
|
+
rvm1_install_path: '/home/{{ ansible_ssh_user }}/.rvm'
|
100
|
+
```
|
101
|
+
|
102
|
+
#### To a user that is not `ansible_ssh_user`
|
103
|
+
|
104
|
+
You **will need sudo here** because you will be writing outside the ansible
|
105
|
+
user's home directory. Other than that it's the same as above, except you will
|
106
|
+
supply a different user account:
|
107
|
+
|
108
|
+
```
|
109
|
+
rvm1_install_flags: '--auto-dotfiles --user-install'
|
110
|
+
rvm1_install_path: '/home/someuser/.rvm'
|
111
|
+
```
|
112
|
+
|
113
|
+
#### A quick note about `rvm1_user`
|
114
|
+
|
115
|
+
In some cases you may want the rvm folder and its files to be owned by a specific
|
116
|
+
user instead of root. Simply set `rvm1_user: 'foo'` and when ruby gets installed
|
117
|
+
it will ensure that `foo` owns the rvm directory.
|
118
|
+
|
119
|
+
## Upgrading and removing old versions of ruby
|
120
|
+
|
121
|
+
A common work flow for upgrading your ruby version would be:
|
122
|
+
|
123
|
+
1. Install the new version
|
124
|
+
2. Run your application role so that bundle install re-installs your gems
|
125
|
+
3. Delete the previous version of ruby
|
126
|
+
|
127
|
+
### Leverage ansible's `--extra-vars`
|
128
|
+
|
129
|
+
Just add `--extra-vars 'rvm1_delete_ruby=ruby-2.1.0'` to the end of your play book command and that version will be removed.
|
130
|
+
|
131
|
+
## Requirements
|
132
|
+
|
133
|
+
- Tested on ubuntu 12.04 LTS but it should work on other versions that are similar.
|
134
|
+
- Tested on RHEL6.5 and CentOS 6.5
|
135
|
+
|
136
|
+
## Ansible galaxy
|
137
|
+
|
138
|
+
You can find it on the official [ansible galaxy](https://galaxy.ansible.com/list#/roles/1087) if you want to rate it.
|
139
|
+
|
140
|
+
## License
|
141
|
+
|
142
|
+
MIT
|