Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement nss for systemd resolved #11

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions roles/systemd_resolved/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ systemd_resolved_dnsovertls: false
systemd_resolved_cache: true
systemd_resolved_dnsstublistener: udp
systemd_resolved_readetchosts: true
systemd_resolved_nss: false
systemd_resolved_package_name: systemd-resolved
systemd_resolved_package_version: ""
systemd_resolved_package_state: present
3 changes: 3 additions & 0 deletions roles/systemd_resolved/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
ansible.builtin.import_tasks: environment.yml
- name: Ensure systemd resolved package
ansible.builtin.import_tasks: package.yml
- name: Ensure systemd resolved nss
ansible.builtin.import_tasks: nss.yml
when: systemd_resolved_nss
- name: Ensure systemd resolved resolved.conf
ansible.builtin.import_tasks: resolved.conf.yml
- name: Ensure systemd resolved systemd service
Expand Down
14 changes: 14 additions & 0 deletions roles/systemd_resolved/tasks/nss.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
- name: "ensure systemd resolved nss configuration is correct"

Check failure on line 2 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

name[casing]

All names should start with an uppercase letter.

Check failure on line 2 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[quoted-strings]

String value is redundantly quoted with double quotes

Check failure on line 2 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / yamllint

2:9 [quoted-strings] string value is redundantly quoted with double quotes

Check failure on line 2 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

name[casing]

All names should start with an uppercase letter.

Check failure on line 2 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[quoted-strings]

String value is redundantly quoted with double quotes

Check failure on line 2 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / yamllint

2:9 [quoted-strings] string value is redundantly quoted with double quotes
ansible.builtin.fail:
msg: "Please add resolve to nss_configuration.hosts"

Check failure on line 4 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[quoted-strings]

String value is redundantly quoted with double quotes

Check failure on line 4 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / yamllint

4:10 [quoted-strings] string value is redundantly quoted with double quotes

Check failure on line 4 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[quoted-strings]

String value is redundantly quoted with double quotes

Check failure on line 4 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / yamllint

4:10 [quoted-strings] string value is redundantly quoted with double quotes
when:
- "'resolve' not in nss_configuration.hosts"

- name: "ensure nss-resolve package"

Check failure on line 8 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

name[casing]

All names should start with an uppercase letter.

Check failure on line 8 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[quoted-strings]

String value is redundantly quoted with double quotes

Check failure on line 8 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / yamllint

8:9 [quoted-strings] string value is redundantly quoted with double quotes

Check failure on line 8 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

name[casing]

All names should start with an uppercase letter.

Check failure on line 8 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[quoted-strings]

String value is redundantly quoted with double quotes

Check failure on line 8 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / yamllint

8:9 [quoted-strings] string value is redundantly quoted with double quotes
ansible.builtin.apt:
name: "libnss-resolve"

Check failure on line 10 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[quoted-strings]

String value is redundantly quoted with double quotes

Check failure on line 10 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / yamllint

10:11 [quoted-strings] string value is redundantly quoted with double quotes

Check failure on line 10 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[quoted-strings]

String value is redundantly quoted with double quotes

Check failure on line 10 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / yamllint

10:11 [quoted-strings] string value is redundantly quoted with double quotes

- name: "ensure systemd resolved nss"

Check failure on line 12 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

fqcn[action-core]

Use FQCN for builtin module actions (include_role).

Check failure on line 12 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

name[casing]

All names should start with an uppercase letter.

Check failure on line 12 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[quoted-strings]

String value is redundantly quoted with double quotes

Check failure on line 12 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / yamllint

12:9 [quoted-strings] string value is redundantly quoted with double quotes

Check failure on line 12 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

fqcn[action-core]

Use FQCN for builtin module actions (include_role).

Check failure on line 12 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

name[casing]

All names should start with an uppercase letter.

Check failure on line 12 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[quoted-strings]

String value is redundantly quoted with double quotes

Check failure on line 12 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / yamllint

12:9 [quoted-strings] string value is redundantly quoted with double quotes
include_role:
name: "nss"

Check failure on line 14 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[quoted-strings]

String value is redundantly quoted with double quotes

Check failure on line 14 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / yamllint

14:11 [quoted-strings] string value is redundantly quoted with double quotes

Check failure on line 14 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / ansible-lint

yaml[quoted-strings]

String value is redundantly quoted with double quotes

Check failure on line 14 in roles/systemd_resolved/tasks/nss.yml

View workflow job for this annotation

GitHub Actions / yamllint

14:11 [quoted-strings] string value is redundantly quoted with double quotes
2 changes: 2 additions & 0 deletions roles/systemd_resolved/tasks/resolv.conf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
force: true
become: true
when: not systemd_resolved_dnsstublistener
and systemd_resolved_nss

Check failure on line 10 in roles/systemd_resolved/tasks/resolv.conf.yml

View workflow job for this annotation

GitHub Actions / yamllint

10:5 [indentation] wrong indentation: expected 8but found 4

Check failure on line 10 in roles/systemd_resolved/tasks/resolv.conf.yml

View workflow job for this annotation

GitHub Actions / yamllint

10:5 [indentation] wrong indentation: expected 8but found 4

- name: Ensure stub resolv.conf
ansible.builtin.file:
Expand All @@ -16,3 +17,4 @@
force: true
become: true
when: systemd_resolved_dnsstublistener
and not systemd_resolved_nss

Check failure on line 20 in roles/systemd_resolved/tasks/resolv.conf.yml

View workflow job for this annotation

GitHub Actions / yamllint

20:5 [indentation] wrong indentation: expected 8but found 4

Check failure on line 20 in roles/systemd_resolved/tasks/resolv.conf.yml

View workflow job for this annotation

GitHub Actions / yamllint

20:5 [indentation] wrong indentation: expected 8but found 4
Loading