Skip to content

Commit

Permalink
Merge pull request #170 from lae/feature/pg-collection-update
Browse files Browse the repository at this point in the history
Clarify community.postgresql usage in docs
  • Loading branch information
lae authored Feb 26, 2024
2 parents 7fda785 + 904ccc3 commit 7255caf
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
23 changes: 18 additions & 5 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Provided you have Ansible installed and are using defaults:
[source,bash,subs="attributes"]
----
ansible-galaxy install geerlingguy.postgresql davidwittman.redis {role}
ansible-galaxy collection install community.postgresql
ansible-playbook -i your.server.fqdn, ~/.ansible/roles/{role}/examples/playbook_single_host_deploy.yml -K
----

Expand All @@ -50,6 +51,7 @@ You can also use Vagrant, if you prefer, to bring up NetBox at `localhost:8080`:
[source,bash,subs="attributes"]
----
ansible-galaxy install geerlingguy.postgresql davidwittman.redis {role}
ansible-galaxy collection install community.postgresql
cd ~/.ansible/roles/{role}/
vagrant up
----
Expand All @@ -70,12 +72,23 @@ endif::[]

=== PostgreSQL

This role does not setup a PostgreSQL server (but will create a database if
needed), so you'll need to setup a PostgreSQL server and create a database user
separate from this role. Take a look at the _Example Playbook_ section.
This role does not setup a PostgreSQL server (but will create a database if needed), so you'll need to setup a PostgreSQL server and create a database user separate from this role.
Take a look at the _Example Playbook_ section.

WARNING: NetBox v2.2.0+ require PostgreSQL 9.4 at the minimum, which may not be
available in your distribution's repos. You may want to use a role for this.
In addition, for Ansible 2.10+, you may need to install the `community.postgresql` collection.
It is recommended to specify this in your playbook's `requirements.yml` file.
For example:

[source,yaml]
----
---
collections:
- name: community.postgresql
version: 3.4.0
----

WARNING: NetBox v2.2.0+ require PostgreSQL 9.4 at the minimum, which may not be available in your distribution's repos.
You may want to use a role for this.

=== Redis

Expand Down
4 changes: 2 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
home: "{{ netbox_home }}"

- name: Ensure Postgres database exists (via socket)
postgresql_db:
community.postgresql.postgresql_db:
name: "{{ netbox_database }}"
login_user: "{{ netbox_database_user }}"
login_unix_socket: "{{ netbox_database_socket }}"
Expand All @@ -54,7 +54,7 @@
- netbox_database_host is not defined

- name: Ensure Postgres database exists (via TCP)
postgresql_db:
community.postgresql.postgresql_db:
name: "{{ netbox_database }}"
login_host: "{{ netbox_database_host }}"
port: "{{ netbox_database_port }}"
Expand Down

0 comments on commit 7255caf

Please sign in to comment.