ansible-role-cassandra/tasks/cassandra-repo.yml

53 lines
1.7 KiB
YAML

---
- name: cassandra-repo | Manage the Cassandra repository on deb systems
when:
- cassandra_install_from_external_repo
- ansible_distribution_file_variety == "Debian"
tags: ['cassandra', 'cassandra_repo', 'cassandra_pkgs']
block:
- name: cassandra-repo | Ensure that /etc/apt.d/keyrings exists
ansible.builtin.file:
dest: /etc/apt/keyrings
state: directory
owner: root
group: root
mode: "0755"
- name: cassandra-repo | Get the signing key for the cassandra.apache.org repository
ansible.builtin.get_url:
url: "{{ cassandra_repo_key_url }}"
dest: "{{ cassandra_deb_repo_key }}"
owner: root
group: root
mode: "0644"
- name: cassandra-repo | Install the repository for Ubuntu
ansible.builtin.deb822_repository:
name: cassandra
types: [deb]
uris: "{{ cassandra_deb_repository_url }}"
components:
- main
suites: ["{{ cassandra_repository_rel }}"]
signed_by: "{{ cassandra_deb_repo_key }}"
state: present
enabled: true
register: cassandra_repo
- name: cassandra-repo | Update the apt cache
ansible.builtin.apt:
update_cache: yes
when: cassandra_repo is changed
- name: cassandra-repo | Manage the Cassandra repository on EL systems
when:
- cassandra_install_from_external_repo
- ansible_distribution_file_variety == "RedHat"
tags: ['cassandra', 'cassandra_repo', 'cassandra_pkgs']
block:
- name: cassandra-repo | RPM repository for Cassandra packages
ansible.builtin.template:
src: cassandra.repo.j2
dest: /etc/yum.repos.d/cassandra.repo
owner: root
group: root
mode: "0644"