Skip to content

Commit 7e2716e

Browse files
author
Kimmo Forss
committed
Refactor task names in MSSQL installation and configuration files to include versioning for clarity and consistency. Update handler references to match new task names. Enhance readability by ensuring all task names follow the format "4.4.x MSSQL - [Task Description]".
1 parent d506aee commit 7e2716e

7 files changed

Lines changed: 120 additions & 120 deletions

File tree

deploy/ansible/roles-db/windows/4.4.0-mssql-install/handlers/main.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
---
55

6-
- name: "WIN-SQL: Restart SQL Server VM"
6+
- name: "4.4.0 MSSQL - Restart SQL Server VM"
77
ansible.windows.win_reboot:
88
reboot_timeout: 600
99
post_reboot_delay: 120

deploy/ansible/roles-db/windows/4.4.0-mssql-install/tasks/4.4.0.0-mssql-prerequisites.yaml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
---
1313
# Install the DSC modules
14-
- name: "WIN-SQL: Ensure DSC modules are installed"
14+
- name: "4.4.0 MSSQL Prerequisites - Ensure DSC modules are installed"
1515
community.windows.win_psmodule:
1616
name: "{{ item }}"
1717
state: present
@@ -25,7 +25,7 @@
2525
- StorageDsc
2626

2727

28-
- name: "WIN: Calculating the domain value from {{ domain_name }}"
28+
- name: "4.4.0 MSSQL Prerequisites - Calculating the domain value from {{ domain_name }}"
2929
ansible.builtin.set_fact:
3030
domain: "{{ domain_name | split('.') | first }}"
3131
cacheable: true
@@ -57,7 +57,7 @@
5757
# #Identity: '"contoso\TestUser1", "contoso\TestUser2"'
5858

5959
# Should add , {{ domain\sidadm }}" as well
60-
- name: "WIN-SQL: Assign Local Security Policies"
60+
- name: "4.4.0 MSSQL Prerequisites - Assign Local Security Policies"
6161
ansible.windows.win_dsc:
6262
resource_name: UserRightsAssignment
6363
Policy: "{{ item }}"
@@ -70,67 +70,67 @@
7070
- Log_on_as_a_service
7171
- Perform_volume_maintenance_tasks
7272
- Replace_a_process_level_token
73-
notify: "WIN-SQL: Restart SQL Server VM"
73+
notify: "4.4.0 MSSQL - Restart SQL Server VM"
7474

7575
# Disable UAC for admin accounts (https://launchpad.support.sap.com/#/notes/2729848)
7676
# Need to investigate this further. The two options which fit our needs are:
7777
# NeverNotifyAndDisableAll - Disable UAC for all users
7878
# NeverNotify - Disable UAC for all users except for the admin accounts
79-
# - name: "WIN-SQL: Disable UAC for admin accounts"
79+
# - name: "4.4.0 MSSQL Prerequisites - Disable UAC for admin accounts"
8080
# win_dsc:
8181
# resource_name: UserAccountControl
8282
# IsSingleInstance: "Yes"
8383
# NotificationLevel: "NeverNotify"
8484

8585
# Disable Guest account
86-
# - name: "WIN-SQL: Disable Guest account"
86+
# - name: "4.4.0 MSSQL Prerequisites - Disable Guest account"
8787
# win_dsc:
8888
# resource_name: User
8989
# Ensure: "Absent"
9090
# UserName: "Guest"
91-
- name: "WIN-SQL: Disable Guest account"
91+
- name: "4.4.0 MSSQL Prerequisites - Disable Guest account"
9292
ansible.windows.win_user:
9393
name: Guest
9494
account_disabled: true
9595
# state: absent
9696

9797
# Reference: https://docs.microsoft.com/en-us/sql/sql-server/install/hardware-and-software-requirements-for-installing-sql-server-ver15?view=sql-server-ver15
98-
- name: "WIN-SQL: Ensure .NET Framework 4.5 Core is present"
98+
- name: "4.4.0 MSSQL Prerequisites - Ensure .NET Framework 4.5 Core is present"
9999
ansible.windows.win_feature:
100100
name: NET-Framework-45-Core
101101
state: present
102102
include_sub_features: true
103103

104104
# If we want to support older versions then we can add the following:
105-
# - name: "WIN-SQL: Additional .NET Framework components"
105+
# - name: "4.4.0 MSSQL Prerequisites - Additional .NET Framework components"
106106
# - block:
107-
# - name: "WIN-SQL: Ensure .NET Framework Core is present"
107+
# - name: "4.4.0 MSSQL Prerequisites - Ensure .NET Framework Core is present"
108108
# win_feature:
109109
# name: NET-Framework-Core
110110
# state: present
111111
# include_sub_features: True
112112
#
113-
# - name: "WIN-SQL: Ensure .NET Framework features are present"
113+
# - name: "4.4.0 MSSQL Prerequisites - Ensure .NET Framework features are present"
114114
# win_feature:
115115
# name: NET-Framework-Features
116116
# state: present
117117
# mssql_version_name<- this needs to get set in the ansible_input_api file
118118
# when: mssql_version_name <= '2014'
119119

120-
# - name: "WIN-SQL: Validate if a reboot is required"
120+
# - name: "4.4.0 MSSQL Prerequisites - Validate if a reboot is required"
121121
# debug:
122122
# msg: "Pending reboot detected"
123123
# changed_when: true
124124
# when: ansible_reboot_pending
125-
# notify: "WIN-SQL: Restart SQL Server VM"
125+
# notify: "4.4.0 MSSQL Prerequisites - Restart SQL Server VM"
126126

127-
- name: "WIN-SQL:progress"
127+
- name: "4.4.0 MSSQL Prerequisites - progress"
128128
ansible.builtin.debug:
129129
msg: "Starting Windows Update. Please wait"
130130

131131

132132
# set a check that the customer can select if it can be done or not. [make it an option]
133-
- name: "WIN-SQL: Ensure Installing the latest windows patches"
133+
- name: "4.4.0 MSSQL Prerequisites - Ensure Installing the latest windows patches"
134134
ansible.windows.win_updates:
135135
category_names:
136136
- SecurityUpdates
@@ -139,16 +139,16 @@
139139
reject_list: "{{ win_updates_reject_list }}"
140140
accept_list: "{{ win_updates_accept_list }}"
141141
register: win_updates
142-
notify: "WIN-SQL: Restart SQL Server VM"
142+
notify: "4.4.0 MSSQL - Restart SQL Server VM"
143143

144-
- name: "WIN-SQL: Reboot if required"
144+
- name: "4.4.0 MSSQL Prerequisites - Reboot if required"
145145
ansible.windows.win_reboot:
146146
reboot_timeout: 600
147147
post_reboot_delay: 120
148148
test_command: 'exit (Get-Service -Name Netlogon).Status -ne "Running"'
149149
when: win_updates.reboot_required
150150

151-
- name: "Force all notified handlers to run now"
151+
- name: "4.4.0 MSSQL Prerequisites - Force all notified handlers to run now"
152152
ansible.builtin.meta: flush_handlers
153153

154154
# - name: "WIN-SQL: Add inbound Firewall rule for SAP ports"

deploy/ansible/roles-db/windows/4.4.0-mssql-install/tasks/4.4.0.1-mssql-main.yaml

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,55 +14,55 @@
1414
# Data file in a different disk
1515

1616

17-
- name: "WIN-SQL: Create run flag directory"
17+
- name: "4.4.0.1 MSSQL - Create run flag directory"
1818
ansible.windows.win_file:
1919
path: '{{ sap_deployment_automation }}\{{ sap_sid | upper }}'
2020
state: directory
2121

22-
- name: "WIN-SQL: check if SQL Server service is started"
22+
- name: "4.4.0.1 MSSQL - Check if SQL Server service is started"
2323
ansible.windows.win_service_info:
2424
name: MSSQLServer
2525
register: sql_service
2626

27-
- name: "WIN-SQL: SQL4SAP Install || Flag File"
27+
- name: "4.4.0.1 MSSQL - SQL4SAP Install || Flag File"
2828
ansible.windows.win_file:
2929
path: '{{ sap_deployment_automation }}\{{ sap_sid | upper }}\sap_deployment_sqldb.txt'
3030
state: touch
3131
when: sql_service.exists
3232

33-
# - name: "WIN-SQL: Install reset"
33+
# - name: "4.4.0.1 MSSQL - Install reset"
3434
# ansible.windows.win_file:
3535
# path: '{{ target_media_location }}\sap_deployment_automation\{{ sap_sid | upper }}\sap_deployment_sqldb.txt'
3636
# state: absent
3737
# when: reinstall
3838

39-
- name: "WIN-SQL: check if installed"
39+
- name: "4.4.0.1 MSSQL - Check if installed"
4040
ansible.windows.win_stat:
4141
path: '{{ sap_deployment_automation }}\{{ sap_sid | upper }}\sap_deployment_sqldb.txt'
4242
register: sql_installed
4343

4444
# +------------------------------------4--------------------------------------*/
45-
- name: "WIN-SQL: check if SQL4SAP is installed"
45+
- name: "4.4.0.1 MSSQL - Check if SQL4SAP is installed"
4646
block:
47-
- name: "WIN-SQL: Install status"
47+
- name: "4.4.0.1 MSSQL - Install status"
4848
ansible.builtin.debug:
49-
msg: "WIN-SQL: is already installed"
49+
msg: "4.4.0.1 MSSQL - is already installed"
5050

51-
- name: "WIN-SQL:: - return value"
51+
- name: "4.4.0.1 MSSQL - return value"
5252
ansible.builtin.set_fact:
5353
sql4sap_already_installed: true
5454

5555
when:
5656
- sql_installed.stat.exists
5757

5858

59-
- name: "WIN-SQL: Install from Microsoft bits"
59+
- name: "4.4.0.1 MSSQL - Install from Microsoft bits"
6060
block:
61-
- name: "WIN-SQL: Progress"
61+
- name: "4.4.0.1 MSSQL - Progress"
6262
ansible.builtin.debug:
6363
msg: "Start SQL4SAP Installation"
6464

65-
- name: "WIN-SQL: Install SQL4SAP on {{ ansible_hostname }}"
65+
- name: "4.4.0.1 MSSQL - Install SQL4SAP on {{ ansible_hostname }}"
6666
ansible.windows.win_shell: |
6767
{{ download_directory_windows }}\{{ mssserver_version }}\SQL4SAP.bat -d
6868
args:
@@ -75,7 +75,7 @@
7575
register: sql_install_output
7676
failed_when: sql_install_output.rc != 0
7777

78-
- name: "WIN-SQL: Installation results"
78+
- name: "4.4.0.1 MSSQL - Installation results"
7979
ansible.builtin.debug:
8080
msg: "SQL4SAP Installation succeeded"
8181
changed_when: true
@@ -84,37 +84,37 @@
8484
- sql_install_output.rc == 0
8585
- sql_install_output.stdout | length > 0
8686
- sql_install_output.stdout is search("Execution successful")
87-
notify: "WIN-SQL: Restart SQL Server VM"
87+
notify: "4.4.0 MSSQL - Restart SQL Server VM"
8888

8989
- name: "Force all notified handlers to run now"
9090
ansible.builtin.meta: flush_handlers
9191

92-
- name: "WIN-SQL: Installation results"
92+
- name: "4.4.0.1 MSSQL - Installation results"
9393
ansible.builtin.debug:
94-
msg: "WIN-SQL: A reboot is pending. We will restart the machine, so please start SQL4SAP installation again."
94+
msg: "4.4.0.1 MSSQL - A reboot is pending. We will restart the machine, so please start SQL4SAP installation again."
9595
changed_when: true
9696
when:
9797
- sql_install_output.rc is defined
9898
- sql_install_output.rc == 0
9999
- sql_install_output.stdout | length > 0
100100
- sql_install_output.stdout is search("A reboot is pending.")
101-
notify: "WIN-SQL: Restart SQL Server VM"
101+
notify: "4.4.0 MSSQL - Restart SQL Server VM"
102102

103103
- name: "Force all notified handlers to run now"
104104
ansible.builtin.meta: flush_handlers
105105

106-
- name: "WIN-SQL: Installation results"
106+
- name: "4.4.0.1 MSSQL - Installation results"
107107
ansible.builtin.debug:
108108
msg:
109-
- "SQL4SAP Installation failed, another installation might be already exist"
110-
- "SQL4SAP output: {{ sql_install_output }}"
109+
- "4.4.0.1 MSSQL - Installation failed, another installation might be already exist"
110+
- "4.4.0.1 MSSQL - output: {{ sql_install_output }}"
111111
when:
112112
- sql_install_output.rc is defined
113113
- sql_install_output.rc == 0
114114
- sql_install_output.stdout | length > 0
115115
- sql_install_output.stdout is search("Error during execution")
116116

117-
- name: "WIN-SQL: SQL4SAP Install || Flag File"
117+
- name: "4.4.0.1 MSSQL - SQL4SAP Install || Flag File"
118118
ansible.windows.win_file:
119119
path: '{{ sap_deployment_automation }}\{{ sap_sid | upper }}\sap_deployment_sqldb.txt'
120120
state: touch
@@ -126,10 +126,10 @@
126126
- not sql_installed.stat.exists
127127
- use_sql_for_SAP
128128

129-
- name: "WIN-SQL: Install from Microsoft "
129+
- name: "4.4.0.1 MSSQL - Install from Microsoft "
130130
block:
131131

132-
- name: "WIN-SQL: Install SQL4SAP on {{ ansible_hostname }}"
132+
- name: "4.4.0.1 MSSQL - Install SQL4SAP on {{ ansible_hostname }}"
133133
ansible.windows.win_shell: |
134134
{{ download_directory_windows }}\{{ mssserver_version }}\SQL4SAP.bat -d
135135
args:
@@ -142,46 +142,46 @@
142142
register: sql_install_output
143143
failed_when: sql_install_output.rc != 0
144144

145-
- name: "WIN-SQL: Installation results"
145+
- name: "4.4.0.1 MSSQL - Installation results"
146146
ansible.builtin.debug:
147-
msg: "SQL4SAP Installation succeeded"
147+
msg: "4.4.0.1 MSSQL - Installation succeeded"
148148
changed_when: true
149149
when:
150150
- sql_install_output.rc is defined
151151
- sql_install_output.rc == 0
152152
- sql_install_output.stdout | length > 0
153153
- sql_install_output.stdout is search("Execution successful")
154-
notify: "WIN-SQL: Restart SQL Server VM"
154+
notify: "4.4.0 MSSQL - Restart SQL Server VM"
155155

156156
- name: "Force all notified handlers to run now"
157157
ansible.builtin.meta: flush_handlers
158158

159-
- name: "WIN-SQL: Installation results"
159+
- name: "4.4.0.1 MSSQL - Installation results"
160160
ansible.builtin.debug:
161-
msg: "WIN-SQL: A reboot is pending. We will restart the machine, so please start SQL4SAP installation again."
161+
msg: "4.4.0.1 MSSQL - A reboot is pending. We will restart the machine, so please start SQL4SAP installation again."
162162
changed_when: true
163163
when:
164164
- sql_install_output.rc is defined
165165
- sql_install_output.rc == 0
166166
- sql_install_output.stdout | length > 0
167167
- sql_install_output.stdout is search("A reboot is pending.")
168-
notify: "WIN-SQL: Restart SQL Server VM"
168+
notify: "4.4.0 MSSQL - Restart SQL Server VM"
169169

170-
- name: "Force all notified handlers to run now"
170+
- name: "4.4.0.1 MSSQL - Force all notified handlers to run now"
171171
ansible.builtin.meta: flush_handlers
172172

173-
- name: "WIN-SQL: Installation results"
173+
- name: "4.4.0.1 MSSQL - Installation results"
174174
ansible.builtin.debug:
175175
msg:
176-
- "SQL4SAP Installation failed, another installation might be already exist"
177-
- "SQL4SAP output: {{ sql_install_output }}"
176+
- "4.4.0.1 MSSQL - Installation failed, another installation might be already exist"
177+
- "4.4.0.1 MSSQL - Output: {{ sql_install_output }}"
178178
when:
179179
- sql_install_output.rc is defined
180180
- sql_install_output.rc == 0
181181
- sql_install_output.stdout | length > 0
182182
- sql_install_output.stdout is search("Error during execution")
183183

184-
- name: "WIN-SQL: SQL4SAP Install || Flag File"
184+
- name: "4.4.0.1 MSSQL - SQL4SAP Install || Flag File"
185185
ansible.windows.win_file:
186186
path: '{{ sap_deployment_automation }}\{{ sap_sid | upper }}\sap_deployment_sqldb.txt'
187187
state: touch

deploy/ansible/roles-db/windows/4.4.0-mssql-install/tasks/4.4.1-mssql-create-DB.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,23 @@
1111
# win_psmodule:
1212
# name: SqlServer
1313
# state: present
14-
- name: "WIN-SQL: Ensure Run Flag Directory is Existing"
14+
- name: "4.4.1 MSSQL Create DB - Ensure Run Flag Directory is Existing"
1515
ansible.windows.win_file:
1616
path: '{{ sap_deployment_automation }}\{{ sap_sid | upper }}'
1717
state: directory
1818

19-
- name: "WIN-SQL: Check if DB is already existing"
19+
- name: "4.4.1 MSSQL Create DB - Check if DB is already existing"
2020
ansible.windows.win_stat:
2121
path: '{{ sap_deployment_automation }}\{{ sid_to_be_deployed.sid | upper }}\sap_deployment_sqldb_create.txt'
2222
register: db_creation
2323

24-
- name: "WIN-SQL: DB status"
24+
- name: "4.4.1 MSSQL Create DB - DB status"
2525
ansible.builtin.debug:
26-
msg: "WIN-SQL: DB is already existing"
26+
msg: "4.4.1 MSSQL Create DB - DB is already existing"
2727
when:
2828
- db_creation.stat.exists
2929

30-
- name: "WIN-SQL: Create a new DB on {{ ansible_hostname }}"
30+
- name: "4.4.1 MSSQL Create DB - Create a new DB on {{ ansible_hostname }}"
3131
ansible.windows.win_shell: |
3232
$sql = @'
3333
CREATE DATABASE [{{ db_sid }}]
@@ -57,7 +57,7 @@
5757

5858
# - name: "WIN-SQL: DB Creation || Flag File"
5959
# block:
60-
- name: "WIN-SQL: DB Creation || Flag File"
60+
- name: "4.4.1 MSSQL Create DB - DB Creation || Flag File"
6161
ansible.windows.win_file:
6262
path: '{{ sap_deployment_automation }}\{{ sap_sid | upper }}\sap_deployment_sqldb_create.txt'
6363
state: touch

0 commit comments

Comments
 (0)