I have also tried "( '0 to upgrade, 0 to newly install' not in ruby_installed_version.stdout) or ( '0 upgraded, 0 newly installed' not in ruby_installed_version.stdout)"
maybe I missed something.... or there is a better way to test for this... :/ On Monday, 21 March 2016 16:52:38 UTC+11, [email protected] wrote: > > Hi All > > I was running an apt_update task and only wanted the server to reboot when > it it saw neither of the two lines. Now, what is happening it only sees the > first "test" I put in the when: section and ignores the second string to > test. The reason for the two tests is I noticed that Debian and Ubuntu have > different lines for when they have nothing to update. > > I know Ive done something stupid.... > > - name: Run Apt update safe > command: sudo apt_upgrade_safe > register: apt_update > > > - name: Reboot Server > #command: sudo reboot > command: echo "test" > when: "'0 to upgrade, 0 to newly install' or '0 upgraded, 0 newly > installed' not in apt_update.stdout" > register: reboot > -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/7d8da484-1c08-47a1-8b3c-8cb9eff0dd34%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
