Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keepalived add job config for global_defs #543

Open
akop opened this issue Oct 19, 2023 · 1 comment
Open

keepalived add job config for global_defs #543

akop opened this issue Oct 19, 2023 · 1 comment
Assignees

Comments

@akop
Copy link

akop commented Oct 19, 2023

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
@maxmoehl maxmoehl self-assigned this Oct 19, 2023
@maxmoehl
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Waiting for Changes | Open for Contribution
Development

No branches or pull requests

2 participants