Skip to content

Commit

Permalink
Fix fqcn
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Coakley <[email protected]>
  • Loading branch information
kevincoakley committed Jan 3, 2023
1 parent 4cdebb6 commit 8381a49
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 29 deletions.
2 changes: 1 addition & 1 deletion handlers/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# handlers file for neo4j

- name: Restart Neo4j
service:
ansible.builtin.service:
name: neo4j
state: restarted
become: true
Expand Down
2 changes: 1 addition & 1 deletion meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ galaxy_info:
description: Install Neo4j (http://neo4j.com/)
license: BSD

min_ansible_version: "2.4"
min_ansible_version: "2.14"

# Optionally specify the branch Galaxy will use when accessing the GitHub
# repo for this role. During role install, if no tags are available,
Expand Down
1 change: 0 additions & 1 deletion molecule/ansible-lint.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
warn_list:
- internal-error
- fqcn
skip_list:
- yaml
12 changes: 6 additions & 6 deletions tasks/Debian.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=863199
- name: Ensure 'man' directory exists.
file:
ansible.builtin.file:
path: /usr/share/man/man1
state: directory
recurse: true
Expand All @@ -10,11 +10,11 @@
- ansible_distribution == 'Ubuntu'

- name: Update repositories cache
apt:
ansible.builtin.apt:
update_cache: true

- name: Install Required Ubuntu Packages
package:
ansible.builtin.package:
name: "{{ item }}"
state: present
with_items:
Expand All @@ -23,16 +23,16 @@
- gpg-agent

- name: Import the signing key for the Neo Technology Debian repository for Neo4j
apt_key:
ansible.builtin.apt_key:
url: https://debian.neo4j.org/neotechnology.gpg.key
state: present

- name: Add the Neo Technology Debian repository for Neo4j
apt_repository:
ansible.builtin.apt_repository:
repo: "deb https://debian.neo4j.com stable {% if neo4j_version is defined %}{{ neo4j_version.split('.')[0:2] | join('.') }}{% else %}latest{% endif %}"
state: present
update_cache: 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 %}=1:{{ neo4j_version }}{% endif %}
6 changes: 3 additions & 3 deletions tasks/RedHat.yml
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 %}
34 changes: 17 additions & 17 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,66 @@
---
- 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: '^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: '^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: '^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: '^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: '^(# )?server.default_listen_address=0.0.0.0'
line: "server.default_listen_address=0.0.0.0"
Expand All @@ -69,53 +69,53 @@
notify: Restart Neo4j

- name: Set the neo4j bolt listen address
lineinfile:
ansible.builtin.lineinfile:
dest: /etc/neo4j/neo4j.conf
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: '^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: '^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

0 comments on commit 8381a49

Please sign in to comment.