ansible-roles/cassandra/tasks/main.yml

40 lines
1.2 KiB
YAML
Raw Normal View History

2015-11-11 18:04:54 +01:00
---
- name: Install the cassandra apt key
raw: apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 350200F2B999A372
when: cassandra_install_from_external_repo
tags: cassandra
- name: Install the cassandra repository
copy: content="deb http://debian.datastax.com/community stable main" dest=/etc/apt/sources.list.d/cassandra.sources.list owner=root group=root mode=044
when: cassandra_install_from_external_repo
register: external_repo
tags: cassandra
- name: Update the apt cache
apt: update_cache=yes
when: ( external_repo | changed )
ignore_errors: True
tags: cassandra
- name: Install the latest version of cassandra server
apt: pkg={{ item }} state=latest
with_items:
- cassandra
- cassandra-tools
when:
- cassandra_install_from_external_repo
- cassandra_install_packages
- cassandra_latest_version
tags: cassandra
- name: Ensure mongodb is started
service: name=cassandra state=started enabled=yes
when: ( cassandra_start_server is defined ) and ( cassandra_start_server == 'yes' )
tags: cassandra
- name: Ensure cassandra is stopped and disabled
service: name=cassandra state=stopped enabled=no
when: ( cassandra_start_server is defined ) and ( cassandra_start_server == 'no' )
tags: cassandra