From 89e40ca874f56126fe1b4ad07a9a0e21c939046d Mon Sep 17 00:00:00 2001 From: neingeist Date: Sun, 12 Nov 2017 14:30:27 +0100 Subject: [PATCH] change line in file instead of copy the whole config --- files/automatic.conf | 81 -------------------------------------------- tasks/main.yml | 5 ++- 2 files changed, 4 insertions(+), 82 deletions(-) delete mode 100644 files/automatic.conf diff --git a/files/automatic.conf b/files/automatic.conf deleted file mode 100644 index 9422fcc..0000000 --- a/files/automatic.conf +++ /dev/null @@ -1,81 +0,0 @@ -[commands] -# What kind of upgrade to perform: -# default = all available upgrades -# security = only the security upgrades -upgrade_type = default -random_sleep = 300 - -# To just receive updates use dnf-automatic-notifyonly.timer - -# Whether updates should be downloaded when they are available, by -# dnf-automatic.timer. notifyonly.timer, download.timer and -# install.timer override this setting. -download_updates = yes - -# Whether updates should be applied when they are available, by -# dnf-automatic.timer. notifyonly.timer, download.timer and -# install.timer override this setting. -apply_updates = yes - - -[emitters] -# Name to use for this system in messages that are emitted. Default is the -# hostname. -# system_name = my-host - -# How to send messages. Valid options are stdio, email and motd. If -# emit_via includes stdio, messages will be sent to stdout; this is useful -# to have cron send the messages. If emit_via includes email, this -# program will send email itself according to the configured options. -# If emit_via includes motd, /etc/motd file will have the messages. if -# emit_via includes command_email, then messages will be send via a shell -# command compatible with sendmail. -# Default is email,stdio. -# If emit_via is None or left blank, no messages will be sent. -emit_via = stdio - - -[email] -# The address to send email messages from. -email_from = root@example.com - -# List of addresses to send messages to. -email_to = root - -# Name of the host to connect to to send email messages. -email_host = localhost - - -[command] -# The shell command to execute. This is a Python format string, as used in -# str.format(). The format function will pass a shell-quoted argument called -# `body`. -# command_format = "cat" - -# The contents of stdin to pass to the command. It is a format string with the -# same arguments as `command_format`. -# stdin_format = "{body}" - - -[command_email] -# The shell command to use to send email. This is a Python format string, -# as used in str.format(). The format function will pass shell-quoted arguments -# called body, subject, email_from, email_to. -# command_format = "mail -s {subject} -r {email_from} {email_to}" - -# The contents of stdin to pass to the command. It is a format string with the -# same arguments as `command_format`. -# stdin_format = "{body}" - -# The address to send email messages from. -email_from = root@example.com - -# List of addresses to send messages to. -email_to = root - - -[base] -# This section overrides dnf.conf - -# Use this to filter DNF core messages -debuglevel = 1 diff --git a/tasks/main.yml b/tasks/main.yml index f8204ce..c46b50d 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -2,7 +2,10 @@ dnf: name=dnf-automatic state=present - name: configure dnf-automatic - copy: src=automatic.conf dest=/etc/dnf/ + lineinfile: + dest=/etc/dnf/automatic.conf + regexp="^apply_updates" + line="apply_updates = yes" - name: enable dnf-automatic timer service: name=dnf-automatic.timer state=started enabled=yes