diff --git a/builtin/core/roles/native/init/tasks/main.yaml b/builtin/core/roles/native/init/tasks/main.yaml index 47bdce48..62adfbc8 100644 --- a/builtin/core/roles/native/init/tasks/main.yaml +++ b/builtin/core/roles/native/init/tasks/main.yaml @@ -3,7 +3,7 @@ hostnamectl set-hostname {{ .inventory_hostname }} \ && sed -i '/^127.0.1.1/s/.*/127.0.1.1 {{ .inventory_hostname }}/g' {{ .item }} when: - - .set_hostname + - .native.set_hostname - .inventory_hostname | ne "localhost" loop: "{{ .native.localDNS | toJson }}" - name: OS | Synchronize initialization script to remote node diff --git a/builtin/core/roles/precheck/os/tasks/main.yaml b/builtin/core/roles/precheck/os/tasks/main.yaml index ae318e3e..a27f6dc9 100644 --- a/builtin/core/roles/precheck/os/tasks/main.yaml +++ b/builtin/core/roles/precheck/os/tasks/main.yaml @@ -2,13 +2,13 @@ - name: OS | Assert valid system hostname format block: - name: OS | Validate inventory hostname is RFC-compliant - when: .set_hostname + when: .native.set_hostname assert: that: .inventory_hostname | regexMatch "^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$" fail_msg: >- The hostname "{{ .inventory_hostname }}" is invalid. Hostnames must use only lowercase alphanumeric characters, '.', or '-', and must start and end with an alphanumeric character. - name: OS | Validate current host system hostname is RFC-compliant - when: .set_hostname | not + when: .native.set_hostname | not assert: that: .hostname | regexMatch "^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$" fail_msg: >-