Files
sql-server-samples/samples/features/high availability/Linux/Ansible Playbook
dblugeon 8eb502e952 Fix crash of mssql_conf during setup with the MSSQL 2019 cu15
Hello everybody,
In the CU15 (15.0.4198.2), the mssql-conf tool was rewrited. With this sqlserver's update and the old version of mssql_conf, we get an error "usermod command not found" during the checkinstance.sh's execution. This fix adds a merge operation of setup_env dictionary with the MSSQL_SA_PASSWORD and MSSQL_PID variables
2022-03-16 14:50:55 +01:00
..

This is a sample Ansible playbook that shows how to install SQL Server, create a Pacemaker cluster, and create an AG managed by the cluster on a set of Linux nodes.

Roles

  • pacemaker - This role creates a Pacemaker cluster between the hosts.
  • mssql-server - This role installs SQL Server on the host, runs setup to set the SA password, and starts the service.
  • mssql-server-ha - This role enables support for HA and creates a DB Mirroring endpoint.
  • mssql-server-ag-external - This role installs the Pacemaker resource agents, creates an AG, an optional listener, and Pacemaker resources for both.

Try

  1. Put the names of the Linux nodes in the inventory file

  2. Configure the deployment in play.yml

  3. Create a vault file named vault.yml using the template at the end of this README.

    ansible-vault create vault.yml
    
  4. Execute the playbook

    ansible-playbook ./play.yml -i ./inventory --ask-vault-pass -e 'ansible_user=username'
    

Vault file template

---

ansible_ssh_pass: 'some password'

ansible_sudo_pass: 'some password'

# The password for the sa user. Only used if mssql-server needs to be installed.
sa_password: 'some password'

# The password for the master key
master_key_password: 'some password'

# The SQL password for the DBM endpoint user
dbm_password: 'some password'

# The password for the DBM cert private key
dbm_cert_password: 'some password'

# The password of the user that admins the pacemaker cluster (hacluster)
pacemaker_cluster_password: 'some password'

# The SQL password for the pacemaker user
pacemaker_password: 'some password'