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

set hostname on Alpine Linux #20

Open
skyfaller opened this issue May 4, 2022 · 2 comments
Open

set hostname on Alpine Linux #20

skyfaller opened this issue May 4, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@skyfaller
Copy link
Contributor

skyfaller commented May 4, 2022

When I log in to Alpine Linux after running all roles, hostname is still localhost. sudo hostname dragon only works temporarily.

https://www.cyberciti.biz/faq/alpine-linux-change-hostname-computer-name/ suggests editing /etc/hostname to make it persist between reboots.

After doing this, you would have to run the motd and test page plays again to make them reflect the correct hostname.

@skyfaller skyfaller added the bug Something isn't working label May 4, 2022
@skyfaller
Copy link
Contributor Author

I forgot I already encountered this bug before:

- name: set system's hostname
hostname:
name: "{{ local_hostname }}"
# use: redhat # required on Alpine Linux: https://github.com/ansible/ansible/issues/77363
# only for Ansible versions < 2.12.5 tho
tags:
- hostname
when: ansible_os_family != 'Alpine'

The workaround is to enable the "redhat" methodology on Alpine Linux, which I'm currently doing manually.

The bug has already been fixed in the latest Ansible, but I'll leave this open until we either automate the workaround or we have the latest Ansible on all relevant systems.

@skyfaller
Copy link
Contributor Author

Welp, I'm using ansible [core 2.12.5] on macOS and the bug doesn't seem to actually be fixed, and my workaround broke. Time to file another bug I guess?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant