|
1 | | -resolvers_test: |
| 1 | +test_resolv: |
2 | 2 | cmd.run: |
| 3 | +# If pillar["bootstrap"]["test"]["resolv"] is set to "works", only check resolving works, otherwise check for specific resolvers |
| 4 | +{% if pillar["bootstrap"].get("test", {}).get("resolv") == "works" %} |
| 5 | + - name: | |
| 6 | + ping -c 1 google.com && \ |
| 7 | + ping -c 1 cloudflare.com |
| 8 | +{% else %} |
| 9 | + {%- if grains["oscodename"] in ["bionic", "focal", "jammy", "bookworm", "noble", "trixie"] %} |
3 | 10 | - name: | |
4 | | -{% if grains["oscodename"] in ["bionic", "focal", "jammy", "bookworm", "noble", "trixie"] %} |
5 | 11 | grep "nameserver 8.8.8.8" /run/systemd/resolve/resolv.conf && \ |
6 | 12 | grep "nameserver 8.8.4.4" /run/systemd/resolve/resolv.conf && \ |
7 | 13 | grep "nameserver 1.1.1.1" /run/systemd/resolve/resolv.conf |
8 | | -{% elif grains["oscodename"] == "bullseye" %} |
9 | | - grep "nameserver 1.1.1.1" /etc/resolv.conf |
10 | | -{% elif grains["osfinger"] == "CentOS Linux-7" %} |
11 | | - grep "nameserver 8.8.8.8" /etc/resolv.conf && \ |
12 | | - grep "nameserver 8.8.4.4" /etc/resolv.conf && \ |
13 | | - grep "nameserver 1.1.1.1" /etc/resolv.conf |
| 14 | + {%- endif %} |
14 | 15 | {% endif %} |
15 | 16 |
|
16 | | -full_hostname: |
| 17 | +full_hostname_in_hostname: |
| 18 | + cmd.run: |
| 19 | + - name: | |
| 20 | + grep {{ grains["id"] }} /etc/hostname |
| 21 | +
|
| 22 | +full_hostname_in_hosts: |
| 23 | + cmd.run: |
| 24 | + - name: | |
| 25 | + grep {{ grains["id"] }} /etc/hosts |
| 26 | +
|
| 27 | +full_hostname_hostname_cmd: |
| 28 | + cmd.run: |
| 29 | + - name: | |
| 30 | + hostname | grep {{ grains["id"] }} |
| 31 | +
|
| 32 | +full_hostname_hostname_f_cmd: |
| 33 | + cmd.run: |
| 34 | + - name: | |
| 35 | + hostname -f | grep {{ grains["id"] }} |
| 36 | +
|
| 37 | +# Skip this if pillar["bootstrap"]["test"]["skip_domain_in_resolv_conf"] is set to True, otherwise check for specific search domain |
| 38 | +{% if not pillar["bootstrap"].get("test", {}).get("skip_domain_in_resolv_conf") %} |
| 39 | +domain_in_resolv_conf: |
17 | 40 | cmd.run: |
18 | 41 | - name: | |
19 | | - grep {{ grains["id"] }} /etc/hostname && \ |
20 | | - grep {{ grains["id"] }} /etc/hosts && \ |
21 | | - hostname | grep {{ grains["id"] }} && \ |
22 | | - hostname -f | grep {{ grains["id"] }} && \ |
23 | 42 | {%- if "domain" in pillar["bootstrap"] %} |
24 | 43 | grep "search {{ pillar["bootstrap"]["domain"] }}" /etc/resolv.conf |
25 | 44 | {%- elif "network" in pillar["bootstrap"] and "domain" in pillar["bootstrap"]["network"] %} |
26 | 45 | grep "search {{ pillar["bootstrap"]["network"]["domain"] }}" /etc/resolv.conf |
27 | 46 | {%- else %} |
28 | 47 | grep "search local" /etc/resolv.conf |
29 | 48 | {%- endif %} |
30 | | - |
31 | | -memory_accounting: |
32 | | - cmd.run: |
33 | | - - name: | |
34 | | - grep cgroup_enable=memory /proc/cmdline && \ |
35 | | - grep swapaccount=1 /proc/cmdline |
| 49 | +{% endif %} |
36 | 50 |
|
37 | 51 | {% if grains["virtual"] == "physical" %} |
38 | 52 | smartd_test: |
|
0 commit comments