On Tue, Sep 26, 2023 at 7:39 PM Richard Megginson <[email protected]> wrote:
> > > On Tue, Sep 26, 2023 at 6:17 PM 'Matt Zagrabelny' via Ansible Project < > [email protected]> wrote: > >> Here are the two tasks: >> >> - >> name: get editor realpath >> shell: realpath /usr/bin/editor >> > > Use `command` here instead of `shell` > Sure thing. > > >> register: editor_realpath >> changed_when: False >> tags: >> - vim >> >> - >> name: set editor to vim >> command: update-alternatives --set editor /usr/bin/vim.nox >> when: editor_realpath.stdout != '/usr/bin/vim.nox' >> tags: >> - vim >> >> I guess I'd like the "set editor to vim" task to be "OK" if it is already >> set to vim, but it is showing up as "skipped". >> > > Not sure how to do that > Fair enough. You've been very helpful, Richard. Thanks again for all the help! -m -- 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 view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAOLfK3XnqTVCyiapcoSKfKLe7QUF6rcOmMkBAV7xJFF70Mw3Lg%40mail.gmail.com.
