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

feat(inventory): handle servers that dont work with connect_with setting [2/3] #187

Merged
merged 1 commit into from
Feb 1, 2023

Conversation

apricote
Copy link
Collaborator

@apricote apricote commented Jan 30, 2023

SUMMARY

Currently if any of the servers in the inventory do not work with the selected connect_with mode, the script exits and returns 0 servers. This can happen for example if one of your servers does not have a public ipv4 address, but you set connect_with: public_ipv4 (default).

This commit changes the behaviour to log a warning message, and just skip setting ansible_host for this server. This server will not be reachable by ansible by default, but users can use compose to override the ansible_host that we set based on the other variables.

Related to #178

Rebased on #186

Part of a 3 PR series:

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

Inventory Plugin

ADDITIONAL INFORMATION

/

@apricote apricote requested a review from LKaemmerling January 30, 2023 12:05
@apricote apricote self-assigned this Jan 30, 2023
LKaemmerling
LKaemmerling previously approved these changes Jan 30, 2023
@apricote apricote force-pushed the inventory-2-handle-invalid-connect-with branch from cd25d48 to 7c14255 Compare January 30, 2023 12:07
@apricote apricote force-pushed the inventory-1-private-networks-info branch from 011bf75 to b491741 Compare January 31, 2023 10:24
@apricote apricote force-pushed the inventory-2-handle-invalid-connect-with branch from 7c14255 to 12983df Compare January 31, 2023 10:24
@apricote apricote force-pushed the inventory-1-private-networks-info branch from b491741 to a85d6b9 Compare January 31, 2023 10:56
@apricote apricote force-pushed the inventory-2-handle-invalid-connect-with branch from 12983df to aa84ac2 Compare January 31, 2023 10:59
Base automatically changed from inventory-1-private-networks-info to main January 31, 2023 16:09
@apricote apricote force-pushed the inventory-2-handle-invalid-connect-with branch from aa84ac2 to d8b9f50 Compare January 31, 2023 16:12
@apricote apricote requested a review from LKaemmerling February 1, 2023 08:57
Currently if any of the servers in the inventory do not work with the
selected `connect_with` mode, the script exits and returns 0 servers.
This can happen for example if one of your servers does not have a public
ipv4 address, but you set `connect_with: public_ipv4` (default).

This commit changes the behaviour to log a warning message, and just skip
setting `ansible_host` for this server. This server will not be reachable
by ansible by default, but users can use `compose` to override the
`ansible_host` that we set based on the other variables.
@apricote apricote force-pushed the inventory-2-handle-invalid-connect-with branch from d8b9f50 to a536ecf Compare February 1, 2023 09:16
@apricote apricote merged commit bfe0f7a into main Feb 1, 2023
@apricote apricote deleted the inventory-2-handle-invalid-connect-with branch February 1, 2023 09:41
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.

2 participants