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

DNS forwarder value needs to be stripped of trailing spaces in rawhide #410

Open
flo-renaud opened this issue Dec 12, 2020 · 1 comment
Open
Labels
difficulty:easy groomed Issues already discussed by the dev team prio:high type:bug

Comments

@flo-renaud
Copy link
Contributor

When running the PRCI tests on rawhide, the dns_forwarder is extracted using resolvectl status command (https://github.com/freeipa/freeipa-pr-ci/blob/master/ansible/roles/machine/provision/tasks/main.yml#L18) but this results in a variable containing trailing spaces.

See for instance the PR #586 where the test_webui_users test fails. The generated ipa-test-config.yaml contains trailing spaces for the dns_forwarder value and this results in ipa-server-install failure visible in runner.log.gz:

2020-12-12 15:52:23,733    DEBUG  TASK [machine/provision_ipaserver : install freeipa] ***************************
2020-12-12 15:52:26,840    DEBUG  fatal: [master]: FAILED! => {
2020-12-12 15:52:26,840    DEBUG      "changed": true,
2020-12-12 15:52:26,841    DEBUG      "cmd": "ipa-server-install -U -n ipa.test -r IPA.TEST -p Secret.123 -a Secret.123 --setup-dns --setup-kra --forwarder='192.168.122.1            '\n",
2020-12-12 15:52:26,841    DEBUG      "delta": "0:00:02.142841",
2020-12-12 15:52:26,841    DEBUG      "end": "2020-12-12 15:52:26.301897",
2020-12-12 15:52:26,841    DEBUG      "rc": 2,
2020-12-12 15:52:26,842    DEBUG      "start": "2020-12-12 15:52:24.159056"
2020-12-12 15:52:26,842    DEBUG  }
2020-12-12 15:52:26,842    DEBUG  
2020-12-12 15:52:26,842    DEBUG  STDERR:
2020-12-12 15:52:26,842    DEBUG  
2020-12-12 15:52:26,843    DEBUG  Usage: ipa-server-install [options]
2020-12-12 15:52:26,843    DEBUG  
2020-12-12 15:52:26,843    DEBUG  ipa-server-install: error: option --forwarder: invalid IP address 192.168.122.1            : failed to detect a valid IP address from '192.168.122.1            '
2020-12-12 15:52:26,843    DEBUG  
2020-12-12 15:52:26,843    DEBUG  
2020-12-12 15:52:26,843    DEBUG  MSG:
2020-12-12 15:52:26,844    DEBUG  
2020-12-12 15:52:26,844    DEBUG  non-zero return code

The playbook should be fixed to strip the trailing spaces.

@netoarmando
Copy link
Member

Also, I saw that ipa-test-config.yaml is listing 2 addresses, one is the "global" DNS server and the other is for eth0.

netoarmando added a commit that referenced this issue Jan 14, 2021
Replace task command to fetch DNS sever from `resolvectl dns` command,
this will not return whitespaces.
Execute grep -m1 to limit the number of lines to 1.
Execute cut to return the first address.

Issue #410

Signed-off-by: Armando Neto <[email protected]>
@netoarmando netoarmando added difficulty:easy groomed Issues already discussed by the dev team prio:high type:bug labels Jan 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty:easy groomed Issues already discussed by the dev team prio:high type:bug
Projects
None yet
Development

No branches or pull requests

2 participants