Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit b990360

Browse files
author
Jamie Snape
committed
Fix PostgreSQL provisioning and other minor fixes
1 parent d187b57 commit b990360

File tree

6 files changed

+102
-0
lines changed

6 files changed

+102
-0
lines changed

provisioning/ansible/roles/apache2/templates/etc-apache2-sites-available-vagrant.conf.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# {{ ansible_managed }}
2+
13
<Directory /var/www/vagrant>
24
Options FollowSymLinks
35
AllowOverride All

provisioning/ansible/roles/apache2/templates/etc-httpd-conf.d-vagrant.conf.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# {{ ansible_managed }}
2+
13
<Directory /var/www/vagrant>
24
Options FollowSymLinks
35
AllowOverride All

provisioning/ansible/roles/php/templates/etc-php.ini.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[PHP]
22

3+
; {{ ansible_managed }}
4+
35
;;;;;;;;;;;;;;;;;;;
46
; About php.ini ;
57
;;;;;;;;;;;;;;;;;;;

provisioning/ansible/roles/php/templates/etc-php5-apache2-php.ini.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
[PHP]
22

3+
; {{ ansible_managed }}
4+
35
;;;;;;;;;;;;;;;;;;;
46
; About php.ini ;
57
;;;;;;;;;;;;;;;;;;;

provisioning/ansible/roles/postgresql/tasks/main.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,13 @@
4242
command: postgresql-setup initdb creates=/var/lib/pgsql/data/postgresql.conf
4343
when: ansible_os_family == 'RedHat'
4444

45+
- name: pg_hba.conf
46+
template: src=var-lib-pgsql-data-pg_hba.conf.j2 dest=/var/lib/pgsql/data/pg_hba.conf
47+
notify:
48+
- restart postgresql
49+
sudo_user: postgres
50+
when: ansible_os_family == 'RedHat'
51+
4552
- name: start postgresql
4653
service: name=postgresql state=started
4754

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# {{ ansible_managed }}
2+
#
3+
# PostgreSQL Client Authentication Configuration File
4+
# ===================================================
5+
#
6+
# Refer to the "Client Authentication" section in the PostgreSQL
7+
# documentation for a complete description of this file. A short
8+
# synopsis follows.
9+
#
10+
# This file controls: which hosts are allowed to connect, how clients
11+
# are authenticated, which PostgreSQL user names they can use, which
12+
# databases they can access. Records take one of these forms:
13+
#
14+
# local DATABASE USER METHOD [OPTIONS]
15+
# host DATABASE USER ADDRESS METHOD [OPTIONS]
16+
# hostssl DATABASE USER ADDRESS METHOD [OPTIONS]
17+
# hostnossl DATABASE USER ADDRESS METHOD [OPTIONS]
18+
#
19+
# (The uppercase items must be replaced by actual values.)
20+
#
21+
# The first field is the connection type: "local" is a Unix-domain
22+
# socket, "host" is either a plain or SSL-encrypted TCP/IP socket,
23+
# "hostssl" is an SSL-encrypted TCP/IP socket, and "hostnossl" is a
24+
# plain TCP/IP socket.
25+
#
26+
# DATABASE can be "all", "sameuser", "samerole", "replication", a
27+
# database name, or a comma-separated list thereof. The "all"
28+
# keyword does not match "replication". Access to replication
29+
# must be enabled in a separate record (see example below).
30+
#
31+
# USER can be "all", a user name, a group name prefixed with "+", or a
32+
# comma-separated list thereof. In both the DATABASE and USER fields
33+
# you can also write a file name prefixed with "@" to include names
34+
# from a separate file.
35+
#
36+
# ADDRESS specifies the set of hosts the record matches. It can be a
37+
# host name, or it is made up of an IP address and a CIDR mask that is
38+
# an integer (between 0 and 32 (IPv4) or 128 (IPv6) inclusive) that
39+
# specifies the number of significant bits in the mask. A host name
40+
# that starts with a dot (.) matches a suffix of the actual host name.
41+
# Alternatively, you can write an IP address and netmask in separate
42+
# columns to specify the set of hosts. Instead of a CIDR-address, you
43+
# can write "samehost" to match any of the server's own IP addresses,
44+
# or "samenet" to match any address in any subnet that the server is
45+
# directly connected to.
46+
#
47+
# METHOD can be "trust", "reject", "md5", "password", "gss", "sspi",
48+
# "krb5", "ident", "peer", "pam", "ldap", "radius" or "cert". Note that
49+
# "password" sends passwords in clear text; "md5" is preferred since
50+
# it sends encrypted passwords.
51+
#
52+
# OPTIONS are a set of options for the authentication in the format
53+
# NAME=VALUE. The available options depend on the different
54+
# authentication methods -- refer to the "Client Authentication"
55+
# section in the documentation for a list of which options are
56+
# available for which authentication methods.
57+
#
58+
# Database and user names containing spaces, commas, quotes and other
59+
# special characters must be quoted. Quoting one of the keywords
60+
# "all", "sameuser", "samerole" or "replication" makes the name lose
61+
# its special character, and just match a database or username with
62+
# that name.
63+
#
64+
# This file is read on server startup and when the postmaster receives
65+
# a SIGHUP signal. If you edit the file on a running system, you have
66+
# to SIGHUP the postmaster for the changes to take effect. You can
67+
# use "pg_ctl reload" to do that.
68+
69+
# Put your actual configuration here
70+
# ----------------------------------
71+
#
72+
# If you want to allow non-local connections, you need to add more
73+
# "host" records. In that case you will also need to make PostgreSQL
74+
# listen on a non-local interface via the listen_addresses
75+
# configuration parameter, or via the -i or -h command line switches.
76+
77+
78+
# TYPE DATABASE USER ADDRESS METHOD
79+
80+
# "local" is for Unix domain socket connections only
81+
local all all peer
82+
83+
# IPv4 local connections:
84+
host all all 127.0.0.1/32 trust
85+
86+
# IPv6 local connections:
87+
host all all ::1/128 trust

0 commit comments

Comments
 (0)