CREATE AVAILABILITY GROUP {{ mssql_ha_ag_name }}
  WITH (CLUSTER_TYPE = NONE)
  FOR REPLICA ON
    N'{{ ansible_hostname }}' WITH (
      ENDPOINT_URL = N'tcp://{{ ansible_fqdn }}:{{ mssql_ha_listener_port }}',
      AVAILABILITY_MODE = SYNCHRONOUS_COMMIT,
      FAILOVER_MODE = MANUAL,
      SEEDING_MODE = AUTOMATIC,
      SECONDARY_ROLE (ALLOW_CONNECTIONS = ALL)
    );
