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

fix grpc_tls port value in config.json.j2 #606

Merged

Conversation

garry-t
Copy link
Contributor

@garry-t garry-t commented Oct 10, 2024

SUMMARY

fix grpc_tls port value in config.json.j2

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

task

ADDITIONAL INFORMATION

Task failed with error

{"changed": false, "cmd": ["/usr/local/bin/consul", "validate", "-quiet", "/etc/consul/config.json", "/etc/consul.d"], "delta": "0:00:00.120234", "end": "2024-10-10 07:57:18.225071", "msg": "non-zero return code", "rc": 1, "start": "2024-10-10 07:57:18.104837", "stderr": "Config validation failed: failed to parse /etc/consul/config.json: 1 error(s) decoding:\n\n* 'ports.grpc_tls' expected type 'int', got unconvertible type 'string', value: '127.0.0.1'", "stderr_lines": ["Config validation failed: failed to parse /etc/consul/config.json: 1 error(s) decoding:", "", "* 'ports.grpc_tls' expected type 'int', got unconvertible type 'string', value: '127.0.0.1'"], "stdout": "", "stdout_lines": []}

Copy link
Member

@bbaassssiiee bbaassssiiee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clear reporting and fix!

@bbaassssiiee bbaassssiiee merged commit ae50b15 into ansible-collections:master Feb 5, 2025
15 checks passed
@JonathanGun
Copy link
Contributor

this changes causes invalid config.

> head -n 6 /etc/consul/config.json
{
    "addresses": {
        "dns": "127.0.0.1",
        "grpc": "127.0.0.1",
        "grpc_tls": "-1",
        "http": "0.0.0.0",
> consul validate /etc/consul/config.json
Config validation failed: 1 error occurred:
	* addresses.grpc_tls: invalid ip address: -1

previous implementation would have been correct. default value of addresses.grpc_tls should be the client_addr . Ref. using the port value for address is incorrect.

The error mentioned in the PR, I believe, is coming from custom ansible inventory of @garry-t

https://github.com/ansible-collections/ansible-consul/pull/606/files#diff-32770839e59ae5da477388c7d674000df855dfcd601cc84471f8362bd24dd8ecR56

@bbaassssiiee please help to revert this commit. thanks

@bbaassssiiee
Copy link
Member

Sorry for the merge, I created a revert PR.

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.

3 participants