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

Validate configuration if keepalived >= 2.0.4 #217

Merged
merged 3 commits into from
Jul 15, 2022
Merged

Conversation

evrardjp
Copy link
Owner

This should ensure the config is working well before attempting
a reboot.

Closes: #172

@evrardjp evrardjp changed the title Validate configuration if keepalived 2.0.4 Validate configuration if keepalived >= 2.0.4 Jul 14, 2022
@evrardjp
Copy link
Owner Author

It seems to work for rockylinux, but not for others, investigating tomorrow.

@Kariton
Copy link
Contributor

Kariton commented Jul 14, 2022

does work for me (well - EL 8 like):

# cat /etc/os-release
NAME="CentOS Stream"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Stream 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux 8"
REDHAT_SUPPORT_PRODUCT_VERSION="CentOS Stream"

This should ensure the config is working well before attempting
a reboot.

Closes: #172
This combined example is creating a sync group for only one
item, which doesn't make sense, and is confusing keepalived
validator.

We should not promote a wrong configuration, so I removed it.
This will allow the proper filtering on the playbook level.
@evrardjp
Copy link
Owner Author

evrardjp commented Jul 15, 2022

It was working well under centos/RH because the version of the package was directly linked to the version of keepalived.
For ubuntu/debian, the string is similar to 1:<version><otherdata> which was always parsed as v1, regardless of actual version of keepalived. As packge fact doesn't show the software version, I will be using keepalived directly instead.

@evrardjp
Copy link
Owner Author

evrardjp commented Jul 15, 2022

In my other branch, I have a job that rightfully failed now (Xenial doesn't test, the others do).

  TASK [ansible-keepalived : Configure keepalived] *******************************
  fatal: [keepalived-rockylinux8]: FAILED! => {"changed": false, "checksum": "f8c7de99baaf11d01c6b188cb382d4888c634be8", "exit_status": 4, "msg": "failed to validate", "stderr": "(/root/.ansible/tmp/ansible-tmp-1657871277.924054-15651-219966251520729/source: Line 1) Unknown keyword 'boop'\n(/root/.ansible/tmp/ansible-tmp-1657871277.924054-15651-219966251520729/source: Line 1) Unknown keyword 'boop'\n(/root/.ansible/tmp/ansible-tmp-1657871277.924054-15651-219966251520729/source: Line 1) Unknown keyword 'boop'\n", "stderr_lines": ["(/root/.ansible/tmp/ansible-tmp-1657871277.924054-15651-219966251520729/source: Line 1) Unknown keyword 'boop'", "(/root/.ansible/tmp/ansible-tmp-1657871277.924054-15651-219966251520729/source: Line 1) Unknown keyword 'boop'", "(/root/.ansible/tmp/ansible-tmp-1657871277.924054-15651-219966251520729/source: Line 1) Unknown keyword 'boop'"], "stdout": "", "stdout_lines": []}
  fatal: [keepalived-bullseye]: FAILED! => {"changed": false, "checksum": "54b51a0c21d865a6ff9635a4ba758b0d4449695a", "exit_status": 4, "msg": "failed to validate", "stderr": "(/root/.ansible/tmp/ansible-tmp-1657871277.785569-15646-202748968320221/source: Line 1) Unknown keyword 'boop'\n(/root/.ansible/tmp/ansible-tmp-1657871277.785569-15646-202748968320221/source: Line 1) Unknown keyword 'boop'\n(/root/.ansible/tmp/ansible-tmp-1657871277.785569-15646-202748968320221/source: Line 1) Unknown keyword 'boop'\n(/root/.ansible/tmp/ansible-tmp-1657871277.785569-15646-202748968320221/source: Line 1) Unknown keyword 'boop'\n", "stderr_lines": ["(/root/.ansible/tmp/ansible-tmp-1657871277.785569-15646-202748968320221/source: Line 1) Unknown keyword 'boop'", "(/root/.ansible/tmp/ansible-tmp-1657871277.785569-15646-202748968320221/source: Line 1) Unknown keyword 'boop'", "(/root/.ansible/tmp/ansible-tmp-1657871277.785569-15646-202748968320221/source: Line 1) Unknown keyword 'boop'", "(/root/.ansible/tmp/ansible-tmp-1657871277.785569-15646-202748968320221/source: Line 1) Unknown keyword 'boop'"], "stdout": "", "stdout_lines": []}
  fatal: [keepalived-focal]: FAILED! => {"changed": false, "checksum": "0cc19aa3db7999c52b816ee083908181530094cc", "exit_status": 4, "msg": "failed to validate", "stderr": "(Line 1) Unknown keyword 'boop'\n(Line 1) Unknown keyword 'boop'\n(Line 1) Unknown keyword 'boop'\n(Line 1) Unknown keyword 'boop'\n", "stderr_lines": ["(Line 1) Unknown keyword 'boop'", "(Line 1) Unknown keyword 'boop'", "(Line 1) Unknown keyword 'boop'", "(Line 1) Unknown keyword 'boop'"], "stdout": "", "stdout_lines": []}
  changed: [keepalived-xenial]

@evrardjp evrardjp merged commit a38c6c1 into master Jul 15, 2022
@evrardjp evrardjp deleted the validate_template branch July 15, 2022 08:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use keepalived --config-test flag for keepalived > 2.0.4
2 participants