0

I need to execute the next Role with ansible and somehow it doesn't work. The idea is to create a sddm.conf file and add some lines in. When I run the role all goes like normal, even says that it did changes, but when I look in the destiny computer, the file is not there.

---
# tasks file for 5ssdm
- name: sddm.conf erstellen
  shell: |
    cat <<EOF
    >/etc/sddm.conf
    [Autologin]
    # Whether sddm should automatically log back into sessions when they exit
    Relogin=false

    # Name of session file for autologin session (if empty try last logged in)
    Session=

    # Username for autologin session
    User=


    [General]
    # Halt command
    HaltCommand=/bin/systemctl poweroff

    # Input method module
    InputMethod=compose

    # Initial NumLock state. Can be on, off or none.
    # If property is set to none, numlock won't be changed
    # NOTE: Currently ignored if autologin is enabled.
    Numlock=none

    # Reboot command
    RebootCommand=/bin/systemctl reboot


    [Theme]
    # Current theme name
    Current=maldives

    # Cursor theme used in the greeter
    CursorTheme=

    # Number of users to use as threshold
    # above which avatars are disabled
    # unless explicitly enabled with EnableAvatars
    DisableAvatarsThreshold=7

    # Enable display of custom user avatars
    EnableAvatars=true

    # Global directory for user avatars
    # The files should be named <username>.face.icon
    FacesDir=/usr/share/sddm/faces

    # Theme directory path
    ThemeDir=/usr/share/sddm/themes


    [Users]
    # Default $PATH for logged in users
    DefaultPath=/bin:/usr/bin


    EOF

  • Could give more detail of the contexte, the playbook where this task called? Do you have try to add -vvv to have more log of what happens exactly? – YLR Apr 22 '21 at 19:57

1 Answers1

0

Prefer using the template or the copy modules to accomplish that, like this:

---
- name: Create SDDM configuration
  copy:
    dest: /etc/sddm.conf
    group: root
    mode: 0644
    owner: root
    src: sddm.conf

Best regards.

Stefano Martins
  • 472
  • 2
  • 7
  • Thanks! I placed sddm.conf in the files directory and worked perfectly! –  Apr 20 '21 at 07:09