Skip to content

Commit

Permalink
Merge pull request #36 from noelmcloughlin/fix2
Browse files Browse the repository at this point in the history
fix(changes): set-fqdn should not always change state
  • Loading branch information
noelmcloughlin authored Aug 31, 2021
2 parents 09b9456 + 101fdc5 commit b03ddea
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 b03ddea

Please sign in to comment.