base: Fix setting hostname on OpenBSD hosts
ansible.builtin.hostname seems to be broken on OpenBSD so set hostname directly using /etc/myname
This commit is contained in:
parent
e7458d14ff
commit
c5eafdbd04
3 changed files with 12 additions and 4 deletions
|
@ -1,4 +1,12 @@
|
||||||
---
|
---
|
||||||
|
- name: set correct hostname
|
||||||
|
ansible.builtin.copy:
|
||||||
|
dest: /etc/myname
|
||||||
|
content: "{{ inventory_hostname }}\n"
|
||||||
|
mode: 0644
|
||||||
|
owner: root
|
||||||
|
group: "{{ ansible_wheel }}"
|
||||||
|
|
||||||
- name: configure mirror for packages and updates
|
- name: configure mirror for packages and updates
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
dest: /etc/installurl
|
dest: /etc/installurl
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
---
|
---
|
||||||
|
- name: set correct hostname
|
||||||
|
ansible.builtin.hostname:
|
||||||
|
name: "{{ inventory_hostname }}"
|
||||||
|
|
||||||
- name: install os specific roles
|
- name: install os specific roles
|
||||||
ansible.builtin.include_role:
|
ansible.builtin.include_role:
|
||||||
name: "{{ role }}"
|
name: "{{ role }}"
|
||||||
|
|
|
@ -28,10 +28,6 @@
|
||||||
ansible.builtin.setup:
|
ansible.builtin.setup:
|
||||||
filter: ansible_local
|
filter: ansible_local
|
||||||
|
|
||||||
- name: set correct hostname
|
|
||||||
ansible.builtin.hostname:
|
|
||||||
name: "{{ inventory_hostname }}"
|
|
||||||
|
|
||||||
- name: include os specific tasks
|
- name: include os specific tasks
|
||||||
ansible.builtin.include_tasks:
|
ansible.builtin.include_tasks:
|
||||||
file: "{{ ansible_os_family }}.yml"
|
file: "{{ ansible_os_family }}.yml"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue