mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Properly upgrade Debian based systems unattended
Signed-off-by: Pedro Algarvio <palgarvio@vmware.com>
This commit is contained in:
parent
4a4312159c
commit
a9bbfd0e47
1 changed files with 12 additions and 1 deletions
|
@ -52,7 +52,18 @@ def _system_up_to_date(
|
|||
if grains["os_family"] == "Debian":
|
||||
ret = shell.run("apt", "update")
|
||||
assert ret.returncode == 0
|
||||
ret = shell.run("apt", "upgrade", "-y")
|
||||
env = os.environ.copy()
|
||||
env["DEBIAN_FRONTEND"] = "noninteractive"
|
||||
ret = shell.run(
|
||||
"apt",
|
||||
"upgrade",
|
||||
"-y",
|
||||
"-o",
|
||||
"DPkg::Options::=--force-confdef",
|
||||
"-o",
|
||||
"DPkg::Options::=--force-confold",
|
||||
env=env,
|
||||
)
|
||||
assert ret.returncode == 0
|
||||
elif grains["os_family"] == "Redhat":
|
||||
ret = shell.run("yum", "update", "-y")
|
||||
|
|
Loading…
Add table
Reference in a new issue