Skip to content

Commit

Permalink
hostname: update facts when there is a change (#705)
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Berendt <[email protected]>
  • Loading branch information
berendt authored Aug 23, 2024
1 parent 813d6c0 commit 1f0fe3a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions roles/hostname/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
- name: Gathers facts about hosts
ansible.builtin.setup:
filter: "{{ osism_setup_filter | default('') }}"
gather_subset: "{{ osism_setup_gather_subset | default('all') }}"
run_once: true
2 changes: 2 additions & 0 deletions roles/hostname/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
become: true
ansible.builtin.hostname:
name: "{{ hostname_name }}"
notify: Gathers facts about hosts

- name: Copy /etc/hostname
become: true
Expand All @@ -16,3 +17,4 @@
owner: root
group: root
mode: 0644
notify: Gathers facts about hosts

0 comments on commit 1f0fe3a

Please sign in to comment.