Skip to content

Commit 988ca4d

Browse files
committed
ruby and sqlite installation on ubuntu 18.04 .. needs more testing
1 parent c365596 commit 988ca4d

File tree

2 files changed

+90
-0
lines changed

2 files changed

+90
-0
lines changed

ruby.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# roles/ruby/tasks/main.yml
2+
# This file contains all the tasks that will be run for the ruby play
3+
---
4+
- name: install required packages
5+
become: true
6+
apt: name={{item}} state=present update_cache=yes
7+
with_items:
8+
- build-essential
9+
- cmake
10+
- zlib1g-dev
11+
- libyaml-dev
12+
- libncurses-dev
13+
- libssl-dev
14+
- libreadline-dev
15+
16+
- name: Get installed version
17+
command: ruby --version
18+
ignore_errors: True
19+
changed_when: false
20+
failed_when: false
21+
register: ruby_installed_version
22+
23+
- name: Force install if the version numbers do not match
24+
set_fact:
25+
ruby_reinstall_from_source: true
26+
when: '(ruby_installed_version|success and (ruby_installed_version.stdout | regex_replace("^.*?([0-9\.]+).*$", "\\1") | version_compare(ruby_version, operator="!=")))'
27+
28+
- when: ruby_installed_version|failed or ruby_reinstall_from_source
29+
block:
30+
- name: Download Ruby
31+
get_url:
32+
url: "https://cache.ruby-lang.org/pub/ruby/2.3/ruby-{{ruby_version}}.tar.gz"
33+
dest: "/tmp/ruby-{{ruby_version}}.tar.gz"
34+
sha256sum: "{{ruby_sha256sum}}"
35+
36+
- name: Extract archive
37+
unarchive:
38+
src: "/tmp/ruby-{{ruby_version}}.tar.gz"
39+
dest: /tmp/
40+
creates: "/tmp/ruby-{{ruby_version}}/README.md"
41+
copy: false
42+
43+
- name: Configure install
44+
command: ./configure --disable-install-doc
45+
args:
46+
chdir: "/tmp/ruby-{{ruby_version}}"
47+
creates: "/tmp/ruby-{{ruby_version}}/config.status"
48+
49+
- name: Build ruby
50+
command: make
51+
args:
52+
chdir: "/tmp/ruby-{{ruby_version}}"
53+
creates: "/tmp/ruby-{{ruby_version}}/ruby"
54+
55+
- name: Install ruby
56+
become: true
57+
command: make install
58+
args:
59+
chdir: "/tmp/ruby-{{ruby_version}}"
60+
creates: /usr/local/bin/ruby
61+
62+
- name: Remove build directory
63+
file:
64+
path: "/tmp/ruby-{{ruby_version}}"
65+
state: absent
66+
67+
- name: Remove archive
68+
file:
69+
path: "/tmp/ruby-{{ruby_version}}.tar.gz"
70+
state: absent

sqlite.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# I tried a bunch of different things, and as usual it's simple, but you have to get it right.
2+
# The important part is that you have to shell with /bin/bash -c and source nvm.sh
3+
---
4+
- name: run the caddy Server tasks on the localhost
5+
hosts: local
6+
become: yes
7+
become_user: siva
8+
tasks:
9+
# - name: Install caddy
10+
# shell: "curl https://sqlite.org/snapshot/sqlite-snapshot-201805081303.tar.gz"
11+
# args:
12+
# chdir: "/tmp/"
13+
14+
# # This works
15+
# - name: Install unixODBC
16+
# command: sudo {{ item }} chdir="/tmp/{{ mysql_odbc_unixodbc_url | basename | replace('.tar.gz', '') }}"
17+
# with_items:
18+
# - ./configure --prefix=/usr/local
19+
# - make
20+
# - make install

0 commit comments

Comments
 (0)