Commit 3992d4ed authored by Marco Mariani's avatar Marco Mariani

netmask_bits options for postgres connections

parent 5debe3fb
......@@ -160,11 +160,13 @@ class Recipe(GenericBaseRecipe):
'host all all ::1/128 md5',
]
ipv4_netmask_bits = self.options.get('ipv4_netmask_bits', '32')
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:
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))
......
......@@ -30,7 +30,9 @@ recipe = slapos.cookbook:postgres
# Options
ipv6 = $${instance-parameters:ipv6}
ipv6_netmask_bits = 128
ipv4 = $${instance-parameters:ipv4}
ipv4_netmask_bits = 32
ipv6_random = $${instance-parameters:ipv6_random}
superuser = postgres
port = 5432
......
......@@ -17,7 +17,7 @@ parts =
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance.cfg.in
output = ${buildout:directory}/instance.cfg
md5sum = dfba09a7cccefc5d92d455aaed2c1835
md5sum = 6f0ec52fdd5f602c0f624cd0e9146e8d
mode = 0644
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment