ansible question

48 views
Skip to first unread message

Christoph Christ

unread,
Mar 4, 2024, 5:12:24 AM3/4/24
to Ansible Project
Hi all,

i have to implement an ansible task. where the action is, to reload the dconf for Gnome.

It is telling me: the requested handler "reload dconf" was not found in either the main handlers list nor in the listening handlers list.

---
- name: Ensure GDM disable-user-list option is enabled
  ansible.builtin.lineinfile:
      path: "{{ item.file }}"
      regexp: "{{ item.regexp }}"
      line: "{{ item.line }}"
      create: true
      owner: root
      group: root
      mode: '0644'
  notify: reload dconf
  loop:
      - { file: '/etc/dconf/profile/gdm', regexp: 'user-db', line: 'user-db:user' }
      - { file: '/etc/dconf/profile/gdm', regexp: 'system-db', line: 'system-db:gdm' }
      - { file: '/etc/dconf/profile/gdm', regexp: 'file-db', line: 'file-db:/usr/share/gdm/greeter-dconf-defaults'}
      - { file: '/etc/dconf/db/gdm.d/00-login-screen', regexp: '\[org\/gnome\/login-screen\]', line: '[org/gnome/login-screen]' }
      - { file: '/etc/dconf/db/gdm.d/00-login-screen', regexp: 'disable-user-list=', line: 'disable-user-list=true' }
...

Could you pleas point me into the right direction how to fix this issue? I have tested this manually and it is working, why is it not working, when called in a bigger scope?

KR
Christoph

Prady A

unread,
Mar 4, 2024, 6:02:26 AM3/4/24
to ansible...@googlegroups.com
Hi

Welcome..
There should be a handler to listen this notification..
The handler should have the same keyword.

Ex: 
--- # webserver.yml - name: "Install and configure web server" hosts: "all" handlers: - name: "Start and enable httpd Service" ansible.builtin.service: name: "httpd.service" state: "started" enabled: true become: true tasks: - name: "Install httpd Packages" ansible.builtin.package: name: "httpd" state: "present" become: true notify: - "Start and enable httpd Service"


Hope it helps..


--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/6837e6ad-d474-45d5-b60e-d4e2804684f0n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages