haproxy-boshrelease icon indicating copy to clipboard operation
haproxy-boshrelease copied to clipboard

keepalived add job config for global_defs

Open akop opened this issue 2 years ago • 1 comments

We had the requirement to tweak keepalived global_defs but there is no option to change it with the job config. Would be great to have such an option.

For now we've created an ops file as quick fix.

Perhaps this is helping someone:

- type: replace
  path: /instance_groups/name=haproxy/jobs/-
  value:
    name: pre-start-script
    properties:
      script: |-
                #!/bin/bash
                KEEPALIVED_CONF_TEMPLATE='/var/vcap/jobs/keepalived/config/keepalived.config.template'
                SEARCH_STRING='lvs_id haproxy'
                REPLACE_STRING='lvs_id haproxy
                        max_auto_priority -1
                        vrrp_garp_master_repeat 5
                        vrrp_garp_interval 1
                        vrrp_garp_lower_prio_repeat 1
                        vrrp_garp_master_refresh 300
                        vrrp_garp_master_refresh_repeat 1
                        vrrp_higher_prio_send_advert true'
                
                cp $KEEPALIVED_CONF_TEMPLATE $KEEPALIVED_CONF_TEMPLATE.pre-pre-start-script
                sed -i "s|${SEARCH_STRING}|${REPLACE_STRING//$'\n'/\\n}|" $KEEPALIVED_CONF_TEMPLATE
    release: os-conf

- type: replace
  path: /releases/name=os-conf?
  value:
    name: os-conf
    version: latest # take just the one which is defined in runtime-config

akop avatar Oct 19 '23 14:10 akop

We are open for contributions! If you'd like to expose new properties via the job config feel free to submit a PR and we can discuss the details. If you prefer, you can first outline your proposed changes in this issue to discuss them beforehand.

maxmoehl avatar Oct 19 '23 15:10 maxmoehl

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within 15 days.

github-actions[bot] avatar Nov 11 '24 12:11 github-actions[bot]