Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ophélie Gagnard
slapos
Commits
3992d4ed
Commit
3992d4ed
authored
Jan 29, 2013
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
netmask_bits options for postgres connections
parent
5debe3fb
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
slapos/recipe/postgres/__init__.py
slapos/recipe/postgres/__init__.py
+4
-2
software/postgres/instance.cfg.in
software/postgres/instance.cfg.in
+2
-0
software/postgres/software.cfg
software/postgres/software.cfg
+1
-1
No files found.
slapos/recipe/postgres/__init__.py
View file @
3992d4ed
...
@@ -160,11 +160,13 @@ class Recipe(GenericBaseRecipe):
...
@@ -160,11 +160,13 @@ class Recipe(GenericBaseRecipe):
'host all all ::1/128 md5'
,
'host all all ::1/128 md5'
,
]
]
ipv4_netmask_bits
=
self
.
options
.
get
(
'ipv4_netmask_bits'
,
'32'
)
for
ip
in
ipv4
:
for
ip
in
ipv4
:
cfg_lines
.
append
(
'host all all %s/
32 md5'
%
ip
)
cfg_lines
.
append
(
'host all all %s/
%s md5'
%
(
ip
,
ipv4_netmask_bits
)
)
ipv6_netmask_bits
=
self
.
options
.
get
(
'ipv6_netmask_bits'
,
'128'
)
for
ip
in
ipv6
:
for
ip
in
ipv6
:
cfg_lines
.
append
(
'host all all %s/
128 md5'
%
ip
)
cfg_lines
.
append
(
'host all all %s/
%s md5'
%
(
ip
,
ipv6_netmask_bits
)
)
cfg
.
write
(
'
\
n
'
.
join
(
cfg_lines
))
cfg
.
write
(
'
\
n
'
.
join
(
cfg_lines
))
...
...
software/postgres/instance.cfg.in
View file @
3992d4ed
...
@@ -30,7 +30,9 @@ recipe = slapos.cookbook:postgres
...
@@ -30,7 +30,9 @@ recipe = slapos.cookbook:postgres
# Options
# Options
ipv6 = $${instance-parameters:ipv6}
ipv6 = $${instance-parameters:ipv6}
ipv6_netmask_bits = 128
ipv4 = $${instance-parameters:ipv4}
ipv4 = $${instance-parameters:ipv4}
ipv4_netmask_bits = 32
ipv6_random = $${instance-parameters:ipv6_random}
ipv6_random = $${instance-parameters:ipv6_random}
superuser = postgres
superuser = postgres
port = 5432
port = 5432
...
...
software/postgres/software.cfg
View file @
3992d4ed
...
@@ -17,7 +17,7 @@ parts =
...
@@ -17,7 +17,7 @@ parts =
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg.in
url = ${:_profile_base_location_}/instance.cfg.in
output = ${buildout:directory}/instance.cfg
output = ${buildout:directory}/instance.cfg
md5sum =
dfba09a7cccefc5d92d455aaed2c1835
md5sum =
6f0ec52fdd5f602c0f624cd0e9146e8d
mode = 0644
mode = 0644
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment