Fix the data directory permissions. Add the default template.

This commit is contained in:
Andrea Dell'Amico 2024-01-18 12:53:50 +01:00
parent 3b1391d355
commit 8418ba8dd8
Signed by: andrea.dellamico
GPG Key ID: 147ABE6CEB9E20FF
2 changed files with 29 additions and 1 deletions

View File

@ -2,6 +2,28 @@
- name: cassandra-configuration | Manage the Cassandra configuration - name: cassandra-configuration | Manage the Cassandra configuration
tags: [cassandra, cassandra_conf, cassandra_service] tags: [cassandra, cassandra_conf, cassandra_service]
block: block:
- name: cassandra-configuration | Ensure that the data folders exist and have the proper permissions
ansible.builtin.file:
dest: "{{ item }}"
state: directory
owner: cassandra
group: cassandra
mode: "0750"
loop:
- "{{ cassandra_data_dir }}"
- "{{ cassandra_data_dir }}/.cache"
- "{{ cassandra_data_dir }}/commitlog"
- "{{ cassandra_data_dir }}/data"
- "{{ cassandra_data_dir }}/hints"
- "{{ cassandra_data_dir }}/saved_caches"
- name: cassandra-configuration | Install the default env file
ansible.builtin.template:
src: cassandra-default.j2
dest: "/etc/default/cassandra"
owner: root
group: cassandra
mode: "0640"
notify: Restart Cassandra
- name: cassandra-configuration | Install the main configuration file - name: cassandra-configuration | Install the main configuration file
ansible.builtin.template: ansible.builtin.template:
src: cassandra.yaml.j2 src: cassandra.yaml.j2
@ -10,7 +32,6 @@
group: cassandra group: cassandra
mode: "0640" mode: "0640"
notify: Restart Cassandra notify: Restart Cassandra
- name: cassandra-configuration | Install the rackdc configuration file - name: cassandra-configuration | Install the rackdc configuration file
ansible.builtin.template: ansible.builtin.template:
src: cassandra-rackdc.properties.j2 src: cassandra-rackdc.properties.j2

View File

@ -0,0 +1,7 @@
# NOTICE: See also /etc/cassandra/cassandra-env.sh
# EXTRA_CLASSPATH provides the means to extend Cassandra's classpath with
# additional libraries. It is formatted as a colon-delimited list of
# class directories and/or jar files. For example, to enable the
# JMX-to-web bridge install libmx4j-java and uncomment the following.
#EXTRA_CLASSPATH="/usr/share/java/mx4j-tools.jar"