我需要使用 ansible 执行下一个角色,但不知何故它不起作用。这个想法是创建一个 sddm.conf 文件并添加一些行。 当我运行角色时一切正常,甚至说它确实发生了变化,但是当我查看命运计算机时,该文件不在那里。
---
# 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
答案 0 :(得分:0)
更喜欢使用 template
或 copy
模块来实现这一点,如下所示:
---
- name: Create SDDM configuration
copy:
dest: /etc/sddm.conf
group: root
mode: 0644
owner: root
src: sddm.conf
最好的问候。