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

Add macOS support to hostname module #54439

Open
wants to merge 2 commits into
base: devel
from

Conversation

Projects
None yet
3 participants
@samdoran
Copy link
Member

commented Mar 27, 2019

SUMMARY

macOS has three seprate hostname params that need to be set: HostName, ComputerName, and LocalHostName. One of those params, LocalHostName, has more stringent requirements than the other two, which accept special characters and spaces. I created a method to scrub the hostname to ensure it works well with the system requirements

Closes #32214

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

lib/ansible/modules/system/hostname.py

ADDITIONAL INFORMATION

It's still up for debate if we should be setting all there of these values, as discussed in #32214. I think it seems to make the most sense to set at least ComputerName and LocalHostName. I found some Mac admins that reported setting HostName is not a good idea. We can omit that if needed.

I still need to write some docs on this.

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Mar 27, 2019

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Mar 27, 2019

The test ansible-test sanity --test pep8 [explain] failed with 1 error:

lib/ansible/modules/system/hostname.py:822:1: E302 expected 2 blank lines, found 1

click here for bot help

@Akasurde Akasurde added macos and removed needs_triage labels Mar 27, 2019

@samdoran samdoran force-pushed the samdoran:issue/32214-macos-hostname branch to b28faf0 Mar 29, 2019

@samdoran samdoran changed the title [WIP] Add macOS support to hostname module Add macOS support to hostname module Apr 1, 2019

@ansibot ansibot added community_review and removed WIP labels Apr 1, 2019

@ansibot ansibot added the stale_ci label Apr 10, 2019

samdoran added some commits Mar 27, 2019

Add DarwinStrategy class and integration tests
macOS has three seprate hostname params that need to be set. One of those params, LocalHostName, has more stringent requirements than the other two, which accept special characters and spaces. Create a method to scrub the hostname to ensure it works well with the system requirements.

@samdoran samdoran force-pushed the samdoran:issue/32214-macos-hostname branch from 91e2807 to 4b4f4b3 Apr 16, 2019

@ansibot ansibot removed the stale_ci label Apr 16, 2019

@samdoran

This comment has been minimized.

Copy link
Member Author

commented Apr 16, 2019

@sheagcraig Could you test this PR and see what you think? Currently it sets all three host names on the system though I have read conflicting advice about whether setting HostName on macOS is a good idea or not. I don't manage a fleet of Mac's, so I would appreciate input from the community.

@ansibot ansibot added the stale_ci label Apr 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.