Merge "CIS 3.3.3 Ensure IPv6 is disabled"
diff --git a/.kitchen.yml b/.kitchen.yml
index c704da5..51d6a26 100644
--- a/.kitchen.yml
+++ b/.kitchen.yml
@@ -1,8 +1,8 @@
---
driver:
name: docker
- hostname: linux.ci.local
- use_sudo: false
+ hostname: linux-formula
+ run_options: -v /dev/log:/dev/log:ro
provisioner:
name: salt_solo
diff --git a/linux/network/hostname.sls b/linux/network/hostname.sls
index 99de653..fdbec11 100644
--- a/linux/network/hostname.sls
+++ b/linux/network/hostname.sls
@@ -16,18 +16,22 @@
{%- endif %}
+{# Change state to proper one, after releasing patch:
+ https://github.com/saltstack/salt/pull/45748/files/74599bbdfcf99f45d3a31296887097fade31cbf1
linux_enforce_hostname:
- cmd.wait:
+ network.system:
+ - enabled: True
+ - hostname: {{ network.hostname }}
+ - apply_hostname: True
+ - retain_settings: True
+#}
+
+linux_enforce_hostname:
+ cmd.run:
- name: hostname {{ network.hostname }}
- unless: test "$(hostname)" = "{{ network.hostname }}"
-
-{#
-linux_hostname_hosts:
- host.present:
- - ip: {{ grains.ip4_interfaces[network.get('default_interface', 'eth0')][0] }}
- - names:
- - {{ network.fqdn }}
- - {{ network.hostname }}
-#}
+ {%- if grains.get('noservices') %}
+ - onlyif: /bin/false
+ {%- endif %}
{%- endif %}
diff --git a/linux/network/init.sls b/linux/network/init.sls
index 8a7d458..448fbff 100644
--- a/linux/network/init.sls
+++ b/linux/network/init.sls
@@ -1,6 +1,8 @@
{%- from "linux/map.jinja" import network with context %}
include:
+{%- if network.hostname is defined %}
- linux.network.hostname
+{%- endif %}
{%- if network.host|length > 0 or network.get('purge_hosts', True) %}
- linux.network.host
{%- endif %}
diff --git a/tests/pillar/system.sls b/tests/pillar/system.sls
index 3540511..aad46ef 100644
--- a/tests/pillar/system.sls
+++ b/tests/pillar/system.sls
@@ -1,11 +1,14 @@
linux:
+ network:
+ enabled: true
+ hostname: linux
+ fqdn: linux.ci.local
system:
enabled: true
cluster: default
name: linux
- domain: local
+ domain: ci.local
environment: prd
- hostname: system.pillar.local
purge_repos: true
directory:
/tmp/test: