An embarrassingly long time, plus a lot of work and new parts...
Bought a military 6.5 still in the can. Didn't know the history of it, but I needed an engine for my civilian 1 ton pickup and it looked to be in perfect condition. Got it swapped in and it ran great except for:
Being an unknown military engine, I start trying to diagnose whatever must have been wrong with it before they put it in the can and poor ol' me ended up with it.
I crawled all over it with a mechanics stethoscope trying to find this ticking that can be heard louder inside than outside, but couldn't pinpoint it to any specific thing.
Thinking the worst, that maybe it's a rod knocking, I pulled the front differential on the truck so I could drop the pan. Checked the clearances on all the rod and main bearings and they were all perfect. Installed a high pressure oil pump while I had the pan off.
Ticking is still there.
My next thought is a bad lifter, and the reasoning behind installing the high pressure oil pump, thinking higher oil pressure might help. It didn't. So I replace all the lifters. I was told it couldn't be done with the engine in the truck. It can, but it's not exactly easy.
The injector lines have to come off to get the valve covers off, and the intake has to come off to get the injector lines off. (Among other parts that have to come off, including the turbo.)
After all that I finally get enough parts back on to start the engine, wondering if new lifters did the trick.
Success! No more ticking inside the cab!
I can hear a faint ticking outside along with the rest of the diesel clatter, but it's hardly noticeable and I decide it's part of the normal sounds these engines make.
So I finish putting the engine back together, along with all the wires and hoses I had to remove to gain access to the lifters.
I get everything all buttoned back up and slam the hood, and when I start the engine up, THE TICKING IN THE CAB IS BACK!!! WHAT THE HECK!!!!
All this work and it's still ticking! But it wasn't earlier... So what changed between then and now? I open the hood and stare at it and ponder for awhile. (See my signature line.)
The sound is really only heard from inside the truck, it's loudest from the heater core area, and it started again after I put the stuff around the engine back together... I wonder if... Yup.
When I had first swapped the engine, and again when I put the engine bay back together, I had ziptied one of the heater hoses to a convenient thing to keep it away from the exhaust manifold and turbo.
That convenient thing was an injector line.