mirror of
https://gitlab.com/tildes/tildes.git
synced 2026-04-16 06:18:34 +02:00
Install prebuilt Redis and cmark-gfm from APT
See merge request tildes-community/tildes-cf!9
This commit is contained in:
@@ -1,40 +1,25 @@
|
||||
---
|
||||
- name: Check if cmark-gfm is installed
|
||||
stat:
|
||||
- name: Install cmark-gfm
|
||||
apt:
|
||||
name:
|
||||
- cmark-gfm
|
||||
- libcmark-gfm-dev
|
||||
- libcmark-gfm-extensions-dev
|
||||
|
||||
- name: Symlink cmark-gfm library to stable location
|
||||
file:
|
||||
path: /usr/local/lib/libcmark-gfm.so
|
||||
register: cmark_gfm_library
|
||||
src: /usr/lib/{{ ansible_facts['architecture'] }}-linux-gnu/libcmark-gfm.so
|
||||
state: link
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
- name: Download and install cmark-gfm
|
||||
when: not cmark_gfm_library.stat.exists
|
||||
block:
|
||||
- name: Download cmark-gfm from GitHub
|
||||
get_url:
|
||||
dest: /tmp/cmark-gfm.tar.gz
|
||||
url: https://github.com/github/cmark-gfm/archive/0.29.0.gfm.0.tar.gz
|
||||
checksum: sha256:6a94aeaa59a583fadcbf28de81dea8641b3f56d935dda5b2447a3c8df6c95fea
|
||||
|
||||
- name: Create temp directory to extract cmark-gfm to
|
||||
file:
|
||||
path: /tmp/cmark-gfm
|
||||
state: directory
|
||||
|
||||
- name: Extract cmark-gfm
|
||||
unarchive:
|
||||
remote_src: true
|
||||
src: /tmp/cmark-gfm.tar.gz
|
||||
dest: /tmp/cmark-gfm
|
||||
extra_opts:
|
||||
- --strip-components=1
|
||||
|
||||
- name: Install build dependencies for cmark-gfm
|
||||
apt:
|
||||
name:
|
||||
- build-essential
|
||||
- cmake
|
||||
|
||||
- name: Install cmark-gfm
|
||||
shell:
|
||||
chdir: /tmp/cmark-gfm
|
||||
cmd: |
|
||||
make
|
||||
make install
|
||||
- name: Symlink cmark-gfm-extensions library to stable location
|
||||
file:
|
||||
path: /usr/local/lib/libcmark-gfm-extensions.so
|
||||
src: /usr/lib/{{ ansible_facts['architecture'] }}-linux-gnu/libcmark-gfm-extensions.so
|
||||
state: link
|
||||
owner: root
|
||||
group: root
|
||||
mode: 0644
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
---
|
||||
- name: Install OpenJDK Java runtime
|
||||
- name: Install OpenJDK Java runtime (for html5validator)
|
||||
apt:
|
||||
name: openjdk-17-jre
|
||||
name: openjdk-17-jre-headless
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
---
|
||||
redis_version: 6.2.4
|
||||
redis_version: 6:6.2.17-1rl1~bookworm1
|
||||
|
||||
@@ -3,11 +3,12 @@ Description=redis daemon
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
PIDFile=/run/redis/pid
|
||||
User=redis
|
||||
Group=redis
|
||||
RuntimeDirectory=redis
|
||||
ExecStart=/usr/local/bin/redis-server /etc/redis.conf
|
||||
ExecStart=/usr/bin/redis-server /etc/redis.conf
|
||||
Restart=always
|
||||
|
||||
[Install]
|
||||
|
||||
@@ -1,41 +1,29 @@
|
||||
---
|
||||
- name: Check if Redis is installed
|
||||
stat:
|
||||
path: /usr/local/bin/redis-server
|
||||
register: redis_server
|
||||
- name: Add APT key for Redis repository
|
||||
apt_key:
|
||||
url: https://packages.redis.io/gpg
|
||||
|
||||
- name: Download and install Redis
|
||||
when: not redis_server.stat.exists
|
||||
block:
|
||||
- name: Download Redis from GitHub
|
||||
get_url:
|
||||
dest: /tmp/redis-{{ redis_version }}.tar.gz
|
||||
url: https://github.com/redis/redis/archive/{{ redis_version }}.tar.gz
|
||||
checksum: sha256:d53bb1f3e31c8893cbeda20195fa64132e35354d633231939c47b640fd401098
|
||||
- name: Add Redis APT repository
|
||||
apt_repository:
|
||||
repo: deb https://packages.redis.io/deb bookworm main
|
||||
|
||||
- name: Create temp directory to extract Redis to
|
||||
file:
|
||||
path: /tmp/redis-{{ redis_version }}
|
||||
state: directory
|
||||
- name: Install Redis
|
||||
apt:
|
||||
name:
|
||||
- redis={{ redis_version }}
|
||||
- redis-server={{ redis_version }}
|
||||
- redis-tools={{ redis_version }}
|
||||
|
||||
- name: Extract Redis
|
||||
unarchive:
|
||||
remote_src: true
|
||||
src: /tmp/redis-{{ redis_version }}.tar.gz
|
||||
dest: /tmp/redis-{{ redis_version }}
|
||||
extra_opts:
|
||||
- --strip-components=1
|
||||
- name: Remove redis-server from init.d (may conflict with systemd service)
|
||||
file:
|
||||
path: /etc/init.d/redis-server
|
||||
state: absent
|
||||
when: is_docker
|
||||
|
||||
- name: Install build dependencies for Redis
|
||||
apt:
|
||||
name: build-essential
|
||||
|
||||
- name: Install Redis
|
||||
shell:
|
||||
chdir: /tmp/redis-{{ redis_version }}
|
||||
cmd: |
|
||||
make
|
||||
make install
|
||||
- name: Update rc.d to reflect init.d removal
|
||||
command:
|
||||
cmd: update-rc.d redis-server remove
|
||||
when: is_docker
|
||||
|
||||
- name: Create group for redis user
|
||||
group:
|
||||
|
||||
Reference in New Issue
Block a user