If the same instance should be both distributor and publisher that does not currently work with the current implementation with SqlServerReplication. Although I have limited knowledge of replication so not sure if there is a limitation here that I'm not aware of but the section here suggest it is possible.
I suggest that the resource SqlServerReplication is refactored into two new resource and removing the resource SqlServerReplication. The two new resource could be named SqlServerDistributor and SqlServerPublisher.
Additional information:
Although this might be an issue if one instance can only be either publisher or distributor.
The Distributor is a server that contains the distribution database, which stores metadata and history data for all types of replication and transactions for transactional replication. To set up replication, you must configure a Distributor. Each Publisher can be assigned to only a single Distributor instance, but multiple publishers can share a Distributor.
...
By default, the Distributor is the same server as the Publisher (a local Distributor), but it can also be a separate server from the Publisher (a remote Distributor).
https://docs.microsoft.com/en-us/sql/relational-databases/replication/configure-distribution?view=sql-server-ver15
If the same instance should be both distributor and publisher that does not currently work with the current implementation with SqlServerReplication. Although I have limited knowledge of replication so not sure if there is a limitation here that I'm not aware of but the section here suggest it is possible.
I suggest that the resource SqlServerReplication is refactored into two new resource and removing the resource SqlServerReplication. The two new resource could be named
SqlServerDistributor
andSqlServerPublisher
.Additional information:
Although this might be an issue if one instance can only be either publisher or distributor.The resources should also support this https://docs.microsoft.com/en-us/sql/relational-databases/replication/configure-distribution-availability-group?view=sql-server-ver15
Docs over how to use RMO: https://docs.microsoft.com/en-us/sql/relational-databases/replication/configure-publishing-and-distribution?view=sql-server-ver15#RMOProcedure