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 the behavior of ipa modules in case IPA_HOST is empty #241

Merged
merged 3 commits into from
Jun 17, 2020

Conversation

xek
Copy link
Contributor

@xek xek commented Apr 27, 2020

SUMMARY

Fix the behavior of ipa modules in case IPA_HOST is empty

The expected behavior, when the env is empty, is to
fallback on DNS.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

ipa

ADDITIONAL INFORMATION

Without this fix, if IPA_HOST is empty,
there are different errors, depending on urllib version,
which additionally confuses the user. Example errors:

  • host_find: Request failed: <urlopen error no host given>
  • Failed to connect to None at port 443: [Errno 111] Connection refused", "status": -1, "url": "https:///ipa/session/json

2020-04-26 16:27:13 | fatal: [undercloud]: FAILED! => changed=false 
2020-04-26 16:27:13 |   msg: 'host_find: Request failed: <urlopen error no host given>'

fatal: [localhost]: FAILED! => {"changed": false,
   "msg": "Failed to connect to None at port 443: [Errno 111] Connection refused",
   "status": -1,
   "url": "https:///ipa/session/json"}

The expected behavior, when the env is empty, is to
fallback on DNS. Without this fix, if IPA_HOST is empty,
there are different errors, depending on urllib version,
which additionally confuses the user. Example errors:
 * host_find: Request failed: <urlopen error no host given>
 * Failed to connect to None at port 443: [Errno 111]
   Connection refused", "status": -1, "url":
   "https:///ipa/session/json
@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added affects_2.10 bug This issue/PR relates to a bug new_contributor Help guide this first time contributor labels Apr 27, 2020
@felixfontein
Copy link
Collaborator

Please add a changelog fragment (bugfixes:).

@xek
Copy link
Contributor Author

xek commented Apr 29, 2020

@felixfontein I added the changelog fragment, as per your suggestion.

openstack-gerrit pushed a commit to openstack-archive/tripleo-heat-templates that referenced this pull request May 6, 2020
When IPA_HOST is an empty string, the ansible module doesn't
fallback on DNS. The environment variable must be not defined,
if the value is an empty string. This might be fixed in a future:
ansible-collections/community.general#241
This change also adds a note to the description, because in case
the server is provided, the domain is required:
https://pagure.io/freeipa/issue/3912

Change-Id: Idf38c234e50442aed082d9a0ebbd488344d50a90
openstack-gerrit pushed a commit to openstack/openstack that referenced this pull request May 6, 2020
* Update tripleo-heat-templates from branch 'master'
  - Merge "Make sure IdMServer is optional"
  - Make sure IdMServer is optional
    
    When IPA_HOST is an empty string, the ansible module doesn't
    fallback on DNS. The environment variable must be not defined,
    if the value is an empty string. This might be fixed in a future:
    ansible-collections/community.general#241
    This change also adds a note to the description, because in case
    the server is provided, the domain is required:
    https://pagure.io/freeipa/issue/3912
    
    Change-Id: Idf38c234e50442aed082d9a0ebbd488344d50a90
openstack-mirroring pushed a commit to openstack-archive/tripleo-heat-templates that referenced this pull request May 13, 2020
When IPA_HOST is an empty string, the ansible module doesn't
fallback on DNS. The environment variable must be not defined,
if the value is an empty string. This might be fixed in a future:
ansible-collections/community.general#241
This change also adds a note to the description, because in case
the server is provided, the domain is required:
https://pagure.io/freeipa/issue/3912

Change-Id: Idf38c234e50442aed082d9a0ebbd488344d50a90
(cherry picked from commit 593d3c8)
@gundalow gundalow requested a review from Akasurde May 13, 2020 11:41
@ansibullbot ansibullbot added small_patch stale_ci CI is older than 7 days, rerun before merging labels May 13, 2020
@ansibullbot ansibullbot added community_review small_patch Hopefully easy to review labels Jun 16, 2020
@gundalow gundalow added the pr_day Has been reviewed during a PR review Day. https://github.com/ansible/community/issues/407 label Jun 17, 2020
@gundalow gundalow merged commit 25123ea into ansible-collections:master Jun 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug community_review new_contributor Help guide this first time contributor pr_day Has been reviewed during a PR review Day. https://github.com/ansible/community/issues/407 small_patch Hopefully easy to review stale_ci CI is older than 7 days, rerun before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants