Skip to content

Commit

Permalink
set data directory for redis
Browse files Browse the repository at this point in the history
  • Loading branch information
aktech committed Jul 25, 2024
1 parent 69463d0 commit 94c6237
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 18 deletions.
1 change: 1 addition & 0 deletions roles/redis/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
redis_enabled: false
redis_port: 6379
redis_password: 1XoRW/Vgz+LdKLXeh9uwdBrYPBJKhIJR
redis_data_directory: /opt/conda-store/redis/
25 changes: 8 additions & 17 deletions roles/redis/tasks/redis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,21 @@
shell: echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/redis.list
become: true

- name: Ensure Redis data directory exists
ansible.builtin.file:
path: "{{ redis_data_directory }}"
state: directory
owner: redis
group: redis
mode: '0755'

- name: Install redis

Check failure on line 25 in roles/redis/tasks/redis.yaml

View workflow job for this annotation

GitHub Actions / Ansible Lint

fqcn[action-core]

Use FQCN for builtin module actions (apt).
apt:
name: redis
state: present
update_cache: yes
become: true

#- name: Add Redis PPA
# ansible.builtin.apt_repository:
# repo: "ppa:redislabs/redis"
# state: present
# become: true
#
#- name: Update apt cache
# ansible.builtin.apt:
# update_cache: yes
# become: true
#
#- name: Install specific Redis version
# ansible.builtin.apt:
# name: "redis-server=7.2*"
# state: present
# become: true

- name: Ensure Redis is started
service: name=redis-server state=started enabled=yes
become: true
Expand Down
2 changes: 1 addition & 1 deletion roles/redis/templates/redis.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ rdb-del-sync-files no
# The Append Only File will also be created inside this directory.
#
# Note that you must specify a directory here, not a file name.
dir ./
dir {{ redis_data_directory }}

################################# REPLICATION #################################

Expand Down

0 comments on commit 94c6237

Please sign in to comment.