Skip to content

Latest commit

 

History

History
102 lines (72 loc) · 1.57 KB

sqlserver_role_install.md

File metadata and controls

102 lines (72 loc) · 1.57 KB

Install the cnstechnicalgroup.sqlserver-server role

1. Create a directory cnstechnicalgroup_install and cd into it

mkdir ~/cnstechnicalgroup_install
cd ~/cnstechnicalgroup_install

2. Create the ansible.cfg file

vi ansible.cfg 

and paste this information

[defaults]
roles_path = ~/cnstechnicalgroup

3. Create the requirements.yml file and paste this information

---
- src: cnstechnicalgroup.sqlserver-server
  name: cnstechnicalgroup.sqlserver-server

4. Install the cnstechnicalgroup.sqlserver-server role to ~/cnstechnicalgroup

ansible-galaxy install -r requirements.yml

5. cd into sqlserver-server

cd ~/cnstechnicalgroup/sqlserver-server

6. Create the inventory file

vi inventory
db1 ansible_ssh_host=some_ip_address ansible_ssh_user=vagrant ansible_ssh_private_key_file=~/.ssh/id_rsa

7. Create the ansible.cfg file

vi ansible.cfg 
[defaults]
roles_path = ~/cnstechnicalgroup
hostfile = inventory

8. Create the playbook

vi dbserver.yml
---
- hosts: db1
  sudo: yes
  roles: 
    - cnstechnicalgroup.sqlserver-server
  gather_facts: yes
  environment:
    SA_PASSWORD: "{{sa_password}}"
    MSSQL_PID: "evaluation" # evaluation, developer, express, web, standard, enterprise, or your 25 digit product key

9. Create a vars directory and add the main.yml file

mkdir vars
cd vars
vi main.yml
---
sa_password: "a_Str0ng_Passw0rd1"

10. Run playbook

ansible-playbook dbserver.yml