samdoran / samdoran.macos / 1.0.6 / module / hostname Manage hostname | "added in version" 1.4 of samdoran.macos" Authors: Adrian Likins (@alikins), Hideki Saito (@saito-hideki)samdoran.macos.hostname (1.0.6) — module
Install with ansible-galaxy collection install samdoran.macos:==1.0.6
collections: - name: samdoran.macos version: 1.0.6
Set system's hostname. Supports most OSs/Distributions including those using C(systemd).
Windows, HP-UX, and AIX are not currently supported.
- name: Set a hostname hostname: name: web01
- name: Set a hostname specifying strategy hostname: name: web01 strategy: systemd
use: choices: - alpine - debian - freebsd - generic - macos - macosx - darwin - openbsd - openrc - redhat - sles - solaris - systemd description: - Which strategy to use to update the hostname. - If not set we try to autodetect, but this can be problematic, particularly with containers as they can present misleading information. type: str version_added: '2.9' version_added_collection: samdoran.macos name: description: - Name of the host - If the value is a fully qualified domain name that does not resolve from the given host, this will cause the module to hang for a few seconds while waiting for the name resolution attempt to timeout. required: true type: str