Cast fqdn as string for gsub

(#18452) Fix to prevent

```
undefined method `gsub' for nil:NilClass (NoMethodError)
````

when running `librarian-puppet install` with puppet