Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgresql examples #1238

Merged
merged 3 commits into from
Apr 7, 2020
Merged

Postgresql examples #1238

merged 3 commits into from
Apr 7, 2020

Conversation

treydock
Copy link
Collaborator

Pull Request Checklist

Description

Add example of remote postgresql with SSL that is part of the acceptance tests.

Also add example of postgresql replication that is not part of acceptance tests.

Add examples section to README

@treydock treydock requested a review from ghoneycutt March 31, 2020 21:53

The example `sensu-backend.pp` will be applied to the Sensu Go backend.

The example `postgersql.pp` will be applied to both the master and standby PostgreSQL servers.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo in filename

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed typo

```
systemctl stop postgresql-9.6.service
rm -rf /var/lib/pgsql/9.6/data/*
sudo -u postgres pg_basebackup -h 192.168.52.11 -D /var/lib/pgsql/9.6/data -P -U repl -R --xlog-method=stream
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have to use IP's here or can you just use the FQDN?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation I found used IPs, but I would think FQDN works too. I used IPs because it was easier in testing with Vagrant.

$password = 'sensu'
$repl_password = 'secret'
$pgpassword = 'password'
$master_ip = '192.168.52.11'
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should match docs and use primary instead of master

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replaced instances of master with primary

}
postgresql::server::config_entry { 'ssl':
value => 'on',
# path => $postgresql_config_file,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove commented out code

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed commented code

user => 'sensu',
password => postgresql_password('sensu', $password),
}
postgresql::server::pg_hba_rule { 'allow access to sensu database':
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add a new line between resources so it is easier to read

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added newlines

@treydock treydock force-pushed the postgresql-examples branch from 315c044 to dedd371 Compare April 1, 2020 21:08
@treydock treydock force-pushed the postgresql-examples branch from dedd371 to 178c4f5 Compare April 2, 2020 21:58
@ghoneycutt ghoneycutt merged commit ded2b5e into master Apr 7, 2020
@ghoneycutt ghoneycutt deleted the postgresql-examples branch April 7, 2020 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants