From fb707f3b527207e41f45956ba779aa4a629d287f Mon Sep 17 00:00:00 2001 From: Felix Fontein Date: Wed, 30 Jun 2021 20:59:08 +0200 Subject: [PATCH] Fix logic. --- plugins/modules/packaging/os/snap.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/modules/packaging/os/snap.py b/plugins/modules/packaging/os/snap.py index 530611fba5..4cf968555e 100644 --- a/plugins/modules/packaging/os/snap.py +++ b/plugins/modules/packaging/os/snap.py @@ -196,7 +196,7 @@ class Snap(CmdStateModuleHelper): self.validate_input_snaps() # if snap doesnt exist, it will explode when trying to install self.vars.meta('classic').set(output=True) self.vars.meta('channel').set(output=True) - actionable_snaps = [s for s in self.vars.name if self.is_snap_installed(s)] + actionable_snaps = [s for s in self.vars.name if not self.is_snap_installed(s)] if not actionable_snaps: return self.changed = True @@ -227,7 +227,7 @@ class Snap(CmdStateModuleHelper): def state_absent(self): self.validate_input_snaps() # if snap doesnt exist, it will be absent by definition - actionable_snaps = [s for s in self.vars.name if not self.is_snap_installed(s)] + actionable_snaps = [s for s in self.vars.name if self.is_snap_installed(s)] if not actionable_snaps: return self.changed = True