-
Notifications
You must be signed in to change notification settings - Fork 23.8k
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
If the hostname command is not installed, hostname
is failed.
#74556
Comments
Files identified in the description: If these files are incorrect, please update the |
It is explicitly mentioned in the documentation that |
You're right. [1] https://github.com/ansible/ansible/blob/v2.11.0/lib/ansible/modules/hostname.py#L406 |
Have you tried specifying the Systemd strategy as documented in https://docs.ansible.com/ansible/latest/collections/ansible/builtin/hostname_module.html#parameter-use? - hostname:
name: my_hostname
use: systemd |
The same is true if you run it with - hosts: localhost
tasks:
- name: set hostname
hostname:
name: example.com
use: systemd
|
ansible.built-in.hostname
is failed.hostname
is failed.
Seems to be broken since #70532 which moved the systemd logic and made |
@rearn @wookietreiber Could you please check if #74797 works for you and let us know? Thanks. |
@Akasurde |
@rearn Thanks for confirming this. I close this as resolved. |
Summary
If the hostname command is not installed,
hostname
is failed. (e.g. archlinux )I think the problem is that it is hard-coded in the following section.
https://github.com/ansible/ansible/blob/v2.11.0/lib/ansible/modules/hostname.py#L187
Issue Type
Bug Report
Component Name
hostname.py
Ansible Version
Configuration
OS / Environment
Archlinux
Steps to Reproduce
Expected Results
Expected hostname to change
Actual Results
Code of Conduct
The text was updated successfully, but these errors were encountered: