I don't think you should strive to be either "indispensable" or an "easily replaceable cog". Both of these directions are byproducts of different kinds of behavior, but neither should be the goal. What you should actually be trying to do is learn as much about your business domain and the technical stacks in which you work, and apply that knowledge to do the best job you can, while constantly improving both yourself and the product you're working on. If you're the only person in your organization doing this, then you might reach a point where you are "indispensable" to the organization for a time. This is ok, but only for a time. At that point your goal should shift into transferring your knowledge to others (if you haven't been doing that already), documenting what you know into places that others can easily reference, or training the next generation on "how to learn" and to do what you have done. Once you do these things, you will no longer be "indispensable".
On the other hand, if everyone in your organization already behaves this way, constantly learning, constantly striving to do better, you may find yourself a "replaceable cog". That's fine too, everyone is replaceable at this organization, information is well-known and well-documented, and you probably have an excellent management team. In this organization, the trick is to find a way to stand out by taking on a project no one wants, turning around a terrible or cumbersome business process, or taking a risk on something your peers are dubious of, but if successful could bring in new revenue, etc.
If your goal is simply to be able to take vacations and not be called after-hours, it sounds like you are already a "replaceable cog".