Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
configuration
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
configuration
Commits
682f069e
Commit
682f069e
authored
Oct 14, 2015
by
Edward Zarecor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding more tags
parent
28b5a73d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
1 deletions
+56
-1
playbooks/roles/rbenv/tasks/main.yml
+56
-1
No files found.
playbooks/roles/rbenv/tasks/main.yml
View file @
682f069e
...
...
@@ -39,15 +39,24 @@
name={{ rbenv_user }} home={{ rbenv_dir }}
shell=/bin/false createhome=no
when
:
rbenv_user != common_web_user
tags
:
-
install
-
install:base
-
name
:
create rbenv dir if it does not exist
file
:
>
path="{{ rbenv_dir }}" owner="{{ rbenv_user }}"
state=directory
tags
:
-
install
-
install:base
-
name
:
install build depends
apt
:
pkg={{ ",".join(rbenv_debian_pkgs) }} state=present install_recommends=no
with_items
:
rbenv_debian_pkgs
tags
:
-
install
-
install:base
-
name
:
update rbenv repo
git
:
>
...
...
@@ -55,22 +64,34 @@
dest={{ rbenv_dir }}/.rbenv version={{ rbenv_version }}
accept_hostkey=yes
sudo_user
:
"
{{
rbenv_user
}}"
tags
:
-
install
-
install:base
-
name
:
ensure ruby_env exists
template
:
>
src=ruby_env.j2 dest={{ rbenv_dir }}/ruby_env
sudo_user
:
"
{{
rbenv_user
}}"
tags
:
-
install
-
install:base
-
name
:
check ruby-build installed
command
:
test -x /usr/local/bin/ruby-build
register
:
rbuild_present
ignore_errors
:
yes
tags
:
-
install
-
install:base
-
name
:
if ruby-build exists, which versions we can install
command
:
/usr/local/bin/ruby-build --definitions
when
:
rbuild_present|success
register
:
installable_ruby_vers
ignore_errors
:
yes
tags
:
-
install
-
install:base
### in this block, we (re)install ruby-build if it doesn't exist or if it can't install the requested version
-
name
:
create temporary directory
...
...
@@ -78,6 +99,9 @@
register
:
tempdir
sudo_user
:
"
{{
rbenv_user
}}"
when
:
rbuild_present|failed or (installable_ruby_vers is defined and rbenv_ruby_version not in installable_ruby_vers)
tags
:
-
install
-
install:base
-
name
:
clone ruby-build repo
git
:
>
...
...
@@ -85,14 +109,23 @@
accept_hostkey=yes
when
:
tempdir.stdout is defined and (rbuild_present|failed or (installable_ruby_vers is defined and rbenv_ruby_version not in installable_ruby_vers))
sudo_user
:
"
{{
rbenv_user
}}"
tags
:
-
install
-
install:base
-
name
:
install ruby-build
command
:
./install.sh chdir={{ tempdir.stdout }}/ruby-build
when
:
tempdir.stdout is defined and (rbuild_present|failed or (installable_ruby_vers is defined and rbenv_ruby_version not in installable_ruby_vers))
tags
:
-
install
-
install:base
-
name
:
remove temporary directory
file
:
path={{ tempdir.stdout }} state=absent
when
:
tempdir.stdout is defined and (rbuild_present|failed or (installable_ruby_vers is defined and rbenv_ruby_version not in installable_ruby_vers))
tags
:
-
install
-
install:base
-
name
:
check ruby {{ rbenv_ruby_version }} installed
shell
:
"
rbenv
versions
|
grep
{{
rbenv_ruby_version
}}"
...
...
@@ -100,34 +133,55 @@
sudo_user
:
"
{{
rbenv_user
}}"
environment
:
"
{{
rbenv_environment
}}"
ignore_errors
:
yes
tags
:
-
install
-
install:base
-
name
:
install ruby {{ rbenv_ruby_version }}
shell
:
"
rbenv
install
{{
rbenv_ruby_version
}}
creates={{
rbenv_dir
}}/.rbenv/versions/{{
rbenv_ruby_version
}}"
when
:
ruby_installed|failed
sudo_user
:
"
{{
rbenv_user
}}"
environment
:
"
{{
rbenv_environment
}}"
tags
:
-
install
-
install:base
-
name
:
set global ruby {{ rbenv_ruby_version }}
shell
:
"
rbenv
global
{{
rbenv_ruby_version
}}"
sudo_user
:
"
{{
rbenv_user
}}"
environment
:
"
{{
rbenv_environment
}}"
tags
:
-
install
-
install:base
-
name
:
install bundler
shell
:
"
gem
install
bundler
-v
{{
rbenv_bundler_version
}}"
sudo_user
:
"
{{
rbenv_user
}}"
environment
:
"
{{
rbenv_environment
}}"
tags
:
-
install
-
install:base
-
name
:
remove rbenv version of rake
file
:
path="{{ rbenv_dir }}/.rbenv/versions/{{ rbenv_ruby_version }}/bin/rake" state=absent
when
:
jenkins_worker is not defined or not jenkins_worker
tags
:
-
install
-
install:base
-
name
:
install rake gem
shell
:
"
gem
install
rake
-v
{{
rbenv_rake_version
}}"
sudo_user
:
"
{{
rbenv_user
}}"
environment
:
"
{{
rbenv_environment
}}"
when
:
jenkins_worker is not defined or not jenkins_worker
tags
:
-
install
-
install:base
-
name
:
rehash
shell
:
"
rbenv
rehash"
sudo_user
:
"
{{
rbenv_user
}}"
environment
:
"
{{
rbenv_environment
}}"
tags
:
-
install
-
install:base
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment