Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
infrastructure
Commits
7cecb53c
Commit
7cecb53c
authored
Feb 11, 2020
by
Phillip Smith (fukawi2)
Browse files
avoid repeating the same complex tests - set a fact
parent
512a4a33
Changes
1
Hide whitespace changes
Inline
Side-by-side
roles/common/tasks/main.yml
View file @
7cecb53c
---
-
name
:
set fact for local dns resolver in use
set_fact
:
host_has_local_dns_resolver
:
"
{{dns_servers|length
==
1
and
'127.0.0.1'
in
dns_servers}}"
-
name
:
install inetutils for hostname
pacman
:
name=inetutils state=present update_cache=yes
...
...
@@ -48,19 +52,24 @@
-
name
:
create symlink to resolv.conf
file
:
src=/run/systemd/resolve/stub-resolv.conf dest=/etc/resolv.conf state=link force=yes
when
:
configure_network and not
(dns_servers|length == 1 and "127.0.0.1" in dns_ser
ver
s)
when
:
configure_network and not
host_has_local_dns_resol
ver
-
name
:
create resolv.conf
template
:
src=resolv.conf.j2 dest=/etc/resolv.conf owner=root group=root mode=0644
when
:
configure_network and
(dns_servers|length == 1 and "127.0.0.1" in dns_ser
ver
s)
when
:
configure_network and
host_has_local_dns_resol
ver
-
name
:
start networkd
service
:
name=systemd-networkd state=started enabled=yes
when
:
configure_network
-
name
:
start resolved
service
:
name=systemd-resolved state={{"stopped" if dns_servers|length == 1 and "127.0.0.1" in dns_servers else "started"}} enabled={{"no" if dns_servers|length == 1 and "127.0.0.1" in dns_servers else "yes"}}
service
:
name
:
systemd-resolved
state
:
"
{{'stopped'
if
host_has_local_dns_resolver
else
'started'}}"
enabled
:
"
{{'no'
if
host_has_local_dns_resolver
else
'yes'}}"
when
:
configure_network
tags
:
-
this
-
name
:
configure tcp receive window limits
sysctl
:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment