I’m a newbie with Ansible and I’m sure this is probably some feature of it but I can’t figure out what it is.
I have a playbook to
copy a package from the controller to a host
unpack/install the file
The first time I ran the playbook, everything worked. Then, just to see what happens, I deleted the package and install file and ran the play again. The package got copied to the host again. But the package doesn’t get installed even though the relevant task completes with no errors.
The only thing I noticed is the task returns a state of “ok” versus “changed”.
The second task, on the first play run, puts the software in the /opt directory. I deleted it and ran the play again but nothing gets created in the /opt directory the second time.
I think he means your wording is a little unclear, “I deleted the package” could mean you deleted the RPM but didn’t do a yum erase <package>. If you do yum info | grep <some part of the package name>, is it completely gone from yum?
ahh yeah that is my problem. I didn’t do yum erase. I just straight up removed the entire directory the package was in. I’m also a Linux newbie:) Thanks!
Another side note. Don’t assume that some RPM package just puts the software in /opt. Some parts of the software usually end up in other directories. If you remove software directory in /opt, you will have leftovers in other places and your package manager (yum) will not be aware of it. That’s what package manager are used for - to track all the package files so they can be removed cleanly if you choose so. In other words, use package manager both for installation and removal of software package, and other package management tasks of course.