Skip to content

Commit

Permalink
implement nss for systemd resolved
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Kuzmitskii authored and damex committed Apr 22, 2024
1 parent ad762e7 commit b236c13
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
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

0 comments on commit b236c13

Please sign in to comment.