-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from kevincoakley/5.3.0
5.3.0
- Loading branch information
Showing
9 changed files
with
55 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
--- | ||
- name: Install Required RedHat Packages | ||
package: | ||
ansible.builtin.package: | ||
name: "{{ item }}" | ||
state: present | ||
with_items: | ||
- which | ||
|
||
- name: Add Neo4j Yum Repo | ||
yum_repository: | ||
ansible.builtin.yum_repository: | ||
name: neo4j | ||
description: Neo4j Yum Repo | ||
baseurl: https://yum.neo4j.com/stable | ||
gpgkey: https://debian.neo4j.com/neotechnology.gpg.key | ||
gpgcheck: true | ||
|
||
- name: Determine the neo4j package to install | ||
set_fact: | ||
ansible.builtin.set_fact: | ||
neo4j_package: neo4j{% if neo4j_edition == 'enterprise' %}-enterprise{% endif %}{% if neo4j_version is defined %}-{{ neo4j_version }}{% endif %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,137 +1,121 @@ | ||
--- | ||
- name: Include OS family specific variables | ||
include_vars: "{{ ansible_os_family }}.yml" | ||
ansible.builtin.include_vars: "{{ ansible_os_family }}.yml" | ||
|
||
- name: Include OS specific tasks | ||
include_tasks: "{{ ansible_os_family }}.yml" | ||
ansible.builtin.include_tasks: "{{ ansible_os_family }}.yml" | ||
|
||
- name: Install Neo4j | ||
package: | ||
ansible.builtin.package: | ||
name: "{{ neo4j_package }}" | ||
state: present | ||
when: neo4j_edition == 'community' | ||
|
||
- name: Install Neo4j Enterprise | ||
package: | ||
ansible.builtin.package: | ||
name: "{{ neo4j_package }}" | ||
state: present | ||
when: neo4j_edition == 'enterprise' | ||
environment: | ||
NEO4J_ACCEPT_LICENSE_AGREEMENT: 'yes' | ||
|
||
- name: Ensure graph DB folder exists and has the correct permissions | ||
file: | ||
ansible.builtin.file: | ||
path: "{{ neo4j_server_database_location }}" | ||
state: directory | ||
owner: neo4j | ||
group: "{{ neo4j_group }}" | ||
mode: 0755 | ||
|
||
- name: Set the neo4j data directory | ||
lineinfile: | ||
ansible.builtin.lineinfile: | ||
dest: /etc/neo4j/neo4j.conf | ||
regexp: '^dbms\.directories\.data=.*' | ||
line: "dbms.directories.data={{ neo4j_server_database_location }}" | ||
regexp: '^server\.directories\.data=.*' | ||
line: "server.directories.data={{ neo4j_server_database_location }}" | ||
state: present | ||
notify: Restart Neo4j | ||
|
||
- name: Set the neo4j heap inital size | ||
lineinfile: | ||
ansible.builtin.lineinfile: | ||
dest: /etc/neo4j/neo4j.conf | ||
regexp: '^dbms\.memory\.heap\.initial_size=.*' | ||
line: "dbms.memory.heap.initial_size={{ neo4j_memory_heap_initial_size }}" | ||
regexp: '^server\.memory\.heap\.initial_size=.*' | ||
line: "server.memory.heap.initial_size={{ neo4j_memory_heap_initial_size }}" | ||
state: present | ||
notify: Restart Neo4j | ||
|
||
- name: Set the neo4j heap max size | ||
lineinfile: | ||
ansible.builtin.lineinfile: | ||
dest: /etc/neo4j/neo4j.conf | ||
regexp: '^dbms\.memory\.heap\.max_size=.*' | ||
line: "dbms.memory.heap.max_size={{ neo4j_memory_heap_max_size }}" | ||
regexp: '^server\.memory\.heap\.max_size=.*' | ||
line: "server.memory.heap.max_size={{ neo4j_memory_heap_max_size }}" | ||
state: present | ||
notify: Restart Neo4j | ||
|
||
- name: Set the neo4j pagecache size | ||
lineinfile: | ||
ansible.builtin.lineinfile: | ||
dest: /etc/neo4j/neo4j.conf | ||
regexp: '^dbms\.memory\.pagecache\.size=.*' | ||
line: "dbms.memory.pagecache.size={{ neo4j_memory_pagecache_size }}" | ||
regexp: '^server\.memory\.pagecache\.size=.*' | ||
line: "server.memory.pagecache.size={{ neo4j_memory_pagecache_size }}" | ||
state: present | ||
notify: Restart Neo4j | ||
|
||
- name: Allow any connection to Neo4J | ||
lineinfile: | ||
ansible.builtin.lineinfile: | ||
dest: /etc/neo4j/neo4j.conf | ||
regexp: '^(# )?dbms.connectors.default_listen_address=0.0.0.0' | ||
line: "dbms.connectors.default_listen_address=0.0.0.0" | ||
regexp: '^(# )?server.default_listen_address=0.0.0.0' | ||
line: "server.default_listen_address=0.0.0.0" | ||
state: present | ||
when: neo4j_allow_any_connection | bool | ||
notify: Restart Neo4j | ||
|
||
- name: Set the neo4j bolt listen address | ||
lineinfile: | ||
ansible.builtin.lineinfile: | ||
dest: /etc/neo4j/neo4j.conf | ||
regexp: '^dbms\.connector\.bolt\.listen_address=.*' | ||
line: "dbms.connector.bolt.listen_address={{ neo4j_connector_bolt_listen_address }}" | ||
regexp: '^server\.bolt\.listen_address=.*' | ||
line: "server.bolt.listen_address={{ neo4j_connector_bolt_listen_address }}" | ||
state: present | ||
notify: Restart Neo4j | ||
|
||
- name: Set the neo4j http listen address | ||
lineinfile: | ||
ansible.builtin.lineinfile: | ||
dest: /etc/neo4j/neo4j.conf | ||
regexp: '^dbms\.connector\.http\.listen_address=.*' | ||
line: "dbms.connector.http.listen_address={{ neo4j_connector_http_listen_address }}" | ||
regexp: '^server\.http\.listen_address=.*' | ||
line: "server.http.listen_address={{ neo4j_connector_http_listen_address }}" | ||
state: present | ||
notify: Restart Neo4j | ||
|
||
- name: Set the neo4j https listen address | ||
lineinfile: | ||
ansible.builtin.lineinfile: | ||
dest: /etc/neo4j/neo4j.conf | ||
regexp: '^dbms\.connector\.https\.listen_address=.*' | ||
line: "dbms.connector.https.listen_address={{ neo4j_connector_https_listen_address }}" | ||
state: present | ||
notify: Restart Neo4j | ||
|
||
- name: Enable prometheus metrics | ||
lineinfile: | ||
dest: /etc/neo4j/neo4j.conf | ||
regexp: '^metrics\.prometheus\.enabled=.*' | ||
line: "metrics.prometheus.enabled={{ neo4j_prometheus_metrics_enabled }}" | ||
state: present | ||
notify: Restart Neo4j | ||
|
||
- name: Set prometheus metrics interface | ||
lineinfile: | ||
dest: /etc/neo4j/neo4j.conf | ||
regexp: '^metrics\.prometheus\.endpoint=.*' | ||
line: "metrics.prometheus.endpoint={{ neo4j_prometheus_metrics_endpoint }}" | ||
regexp: '^server\.https\.listen_address=.*' | ||
line: "server.https.listen_address={{ neo4j_connector_https_listen_address }}" | ||
state: present | ||
notify: Restart Neo4j | ||
|
||
- name: Ensure open files soft and hard limits are set | ||
copy: | ||
ansible.builtin.copy: | ||
src: etc/security/limits.d/neo4j.conf | ||
dest: /etc/security/limits.d/neo4j.conf | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
|
||
- name: Ensure pam_limits.so is enabled | ||
lineinfile: | ||
ansible.builtin.lineinfile: | ||
dest: /etc/pam.d/su | ||
regexp: '^(# )?session required pam_limits.so' | ||
line: "session required pam_limits.so" | ||
state: present | ||
|
||
- name: Ensure the Neo4j service is enabled and started | ||
service: | ||
ansible.builtin.service: | ||
name: neo4j | ||
enabled: true | ||
state: started | ||
|
||
# https://neo4j.com/docs/operations-manual/current/configuration/set-initial-password/ | ||
- name: Set Neo4j initial password | ||
command: "neo4j-admin set-initial-password '{{ neo4j_password }}'" | ||
ansible.builtin.command: "neo4j-admin set-initial-password '{{ neo4j_password }}'" | ||
args: | ||
creates: /var/lib/neo4j/data/dbms/auth.ini | ||
when: neo4j_password is defined and neo4j_password|string |