diff --git a/cassandra/defaults/main.yml b/cassandra/defaults/main.yml index 3bb42950..4b97239b 100644 --- a/cassandra/defaults/main.yml +++ b/cassandra/defaults/main.yml @@ -2,8 +2,13 @@ cassandra_install_from_external_repo: True cassandra_install_packages: True cassandra_latest_version: True -cassandra_start_server: 'no' +cassandra_start_server: True cassandra_cluster_enabled: False +cassandra_cluster_port: 7000 +cassandra_cluster_ssl_port: 7001 +cassandra_native_transport_port: 9042 +cassandra_rpc_port: 9160 +cassandra_jmx_port: 7199 cassandra_allowed_hosts: - 127.0.0.1/8 - '{{ ansible_default_ipv4.address }}/32' diff --git a/cassandra/handlers/main.yml b/cassandra/handlers/main.yml index b4e5b3bb..346c13af 100644 --- a/cassandra/handlers/main.yml +++ b/cassandra/handlers/main.yml @@ -1,7 +1,5 @@ --- -- name: Update apt cache - apt: update_cache=yes - ignore_errors: true - - name: Restart cassandra service: name=cassandra state=restarted + when: cassandra_start_server + diff --git a/cassandra/tasks/main.yml b/cassandra/tasks/main.yml index a92c0f94..ebc06a18 100644 --- a/cassandra/tasks/main.yml +++ b/cassandra/tasks/main.yml @@ -5,15 +5,8 @@ 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 + copy: content="deb http://debian.datastax.com/community stable main" dest=/etc/apt/sources.list.d/cassandra.sources.list owner=root group=root mode=0444 update_cache=yes 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 a specific version of cassandra server @@ -58,13 +51,13 @@ - cassandra_latest_version tags: cassandra -- name: Ensure cassandra is started +- name: Ensure cassandra is started and enabled service: name=cassandra state=started enabled=yes - when: ( cassandra_start_server is defined ) and ( cassandra_start_server == 'yes' ) + when: cassandra_start_server 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' ) + when: not cassandra_start_server tags: cassandra