From c81ddb40158d0e8639d6e1859802d0c9475e8519 Mon Sep 17 00:00:00 2001 From: Chris Hammer Date: Sat, 9 Dec 2023 23:38:04 -0500 Subject: [PATCH] - change to lineinfile - galaxy version bump --- galaxy.yml | 2 +- roles/hostname/tasks/main.yml | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/galaxy.yml b/galaxy.yml index 05fc78c..e5c3c39 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -8,7 +8,7 @@ namespace: jchristianh name: baseos # The version of the collection. Must be compatible with semantic versioning -version: 1.0.12 +version: 1.0.13 # The path to the Markdown (.md) readme file. This path is relative to the root of the collection readme: README.md diff --git a/roles/hostname/tasks/main.yml b/roles/hostname/tasks/main.yml index 89d79f3..03318e4 100644 --- a/roles/hostname/tasks/main.yml +++ b/roles/hostname/tasks/main.yml @@ -1,9 +1,15 @@ --- +# - name: Set hostname for host +# hostname: +# name: "{{ inventory_hostname }}" +# notify: +# - "restart_syslog_{{ ansible_distribution | lower }}_{{ ansible_distribution_major_version }}" + - name: Set hostname for host - hostname: - name: "{{ inventory_hostname }}" + ansible.builtin.lineinfile: + path: /etc/hostname + line: "{{ inventory_hostname }}" notify: - "restart_syslog_{{ ansible_distribution | lower }}_{{ ansible_distribution_major_version }}" - ...