Skip to content

Commit

Permalink
fix(changes): set-fqdn should not alwasy change state
Browse files Browse the repository at this point in the history
  • Loading branch information
noelmcloughlin committed Aug 31, 2021
1 parent 6ca33f2 commit 101fdc5
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions hostsfile/hostname.sls
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
{%- set fqdn = grains['id'] %}
{%- if grains['os_family'] == 'Debian' %}
{% set hostname = fqdn.split('.')[0] %}
{% else %}
{% set hostname = fqdn %}
{%- else %}
{%- set hostname = fqdn %}
{% endif %}

{%- if grains['os_family'] == 'RedHat' %}
Expand All @@ -32,6 +32,8 @@ etc-sysconfig-network:
- contents: {{ hostname }}
- backup: false
{% endif %}
- onchanges_in:
- cmd: set-fqdn
set-fqdn:
cmd.run:
Expand Down

0 comments on commit 101fdc5

Please sign in to comment.