diff --git a/handlers/main.yml b/handlers/main.yml index 0b3625b..4ed475b 100644 --- a/handlers/main.yml +++ b/handlers/main.yml @@ -2,7 +2,7 @@ # handlers file for neo4j - name: Restart Neo4j - service: + ansible.builtin.service: name: neo4j state: restarted become: true diff --git a/meta/main.yml b/meta/main.yml index 4f8ef05..24895d3 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -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, diff --git a/molecule/ansible-lint.yml b/molecule/ansible-lint.yml index 59a9020..8094e2a 100644 --- a/molecule/ansible-lint.yml +++ b/molecule/ansible-lint.yml @@ -1,6 +1,5 @@ --- warn_list: - internal-error - - fqcn skip_list: - yaml diff --git a/tasks/Debian.yml b/tasks/Debian.yml index 927836f..23c66f1 100644 --- a/tasks/Debian.yml +++ b/tasks/Debian.yml @@ -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 @@ -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: @@ -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 %} diff --git a/tasks/RedHat.yml b/tasks/RedHat.yml index b4251c5..b4e2c64 100644 --- a/tasks/RedHat.yml +++ b/tasks/RedHat.yml @@ -1,13 +1,13 @@ --- - 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 @@ -15,5 +15,5 @@ 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 %} diff --git a/tasks/main.yml b/tasks/main.yml index 712e699..e2a83dd 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,18 +1,18 @@ --- - 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' @@ -20,7 +20,7 @@ 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 @@ -28,7 +28,7 @@ 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 }}" @@ -36,7 +36,7 @@ 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 }}" @@ -44,7 +44,7 @@ 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 }}" @@ -52,7 +52,7 @@ 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 }}" @@ -60,7 +60,7 @@ 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" @@ -69,7 +69,7 @@ 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 }}" @@ -77,7 +77,7 @@ 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 }}" @@ -85,7 +85,7 @@ 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 }}" @@ -93,7 +93,7 @@ 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 @@ -101,21 +101,21 @@ 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