diff --git a/README.md b/README.md index 0ae4a23..329e719 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,11 @@ postgres_ha_alter_system_settings: min_wal_size: '80MB' ``` +Container share memory can be configured with: +```yaml +postgres_share_memory: '1g' +``` + # Management The service is managed using [Docker Compose](https://docs.docker.com/compose/): diff --git a/defaults/main.yml b/defaults/main.yml index 056f268..5c8df96 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -15,6 +15,7 @@ postgres_ha_host_uid: '{{ 100000 + postgres_ha_cont_uid | int }}' postgres_ha_cont_run_size: '512K' postgres_ha_cont_tmp_size: '256K' +#postgres_share_memory: '64m' # Alter System postgres_ha_alter_system_settings: {} # max_wal_size: '1GB' diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index 5c0a5b3..b7de038 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -5,6 +5,9 @@ services: container_name: '{{ postgres_ha_cont_name }}' image: '{{ postgres_ha_cont_image }}' restart: always +{% if postgres_share_memory is defined %} + shm_size: '{{ postgres_share_memory }}' +{% endif %} environment: POSTGRES_DB: '{{ postgres_ha_db_name | mandatory }}' POSTGRES_USER: '{{ postgres_ha_admin_user }}'