diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 06986691..fd29ede0 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,22 @@ lowlydba.sqlserver Release Notes .. contents:: Topics +v3.1.0 +====== + +Minor Changes +------------- + +- Add a Pester unit test suite under ``tests/unit/plugins/module_utils/`` covering the ``module_utils`` helpers (``Get-LowlyDbaSqlServerAuthSpec``, ``Get-SqlCredential``, ``ConvertTo-SerializableObject``), and wire it into CI as a standalone job since ``ansible-test units`` only supports Python (https://github.com/lowlydba/lowlydba.sqlserver/issues/382). +- Add check-mode assertions for the ``backup`` and ``restore`` integration test targets, add idempotency assertions for the ``availability_group`` and ``ag_replica`` targets, and exercise a non-default ``deployment_method`` in the ``install_script`` targets (https://github.com/lowlydba/lowlydba.sqlserver/issues/381). +- Standardize module documentation examples and correct invalid parameters, missing required options, and incorrect module references (https://github.com/lowlydba/lowlydba.sqlserver/pull/399). + +Bugfixes +-------- + +- availability_group - Fix ``changed`` being incorrectly reported as ``true`` on an unchanged AG. ``Get-DbaAvailabilityGroup``'s SMO object never populates ``FailureConditionLevel``/``HealthCheckTimeout`` (they read back as unset defaults), and ``sys.availability_groups`` is a cache of the WSFC cluster resource's copy, so it's empty for AGs with ``cluster_type`` set to ``None``. Since neither source can be trusted, both properties are now excluded from the idempotency diff; they're still applied via ``Set-DbaAvailabilityGroup`` whenever another property change triggers an update (https://github.com/lowlydba/lowlydba.sqlserver/issues/381). +- backup, restore - Fix ``changed`` being reported as ``false`` in ``check_mode``, since ``Backup-DbaDatabase``/``Restore-DbaDatabase`` return no output under ``-WhatIf`` (https://github.com/lowlydba/lowlydba.sqlserver/issues/381). + v3.0.0 ====== diff --git a/changelogs/changelog.yaml b/changelogs/changelog.yaml index f82ebde6..02ec7ec9 100644 --- a/changelogs/changelog.yaml +++ b/changelogs/changelog.yaml @@ -738,3 +738,33 @@ releases: - ci-integration-timeouts.yml - release-summary.yml release_date: '2026-09-04' + 3.1.0: + changes: + bugfixes: + - availability_group - Fix ``changed`` being incorrectly reported as ``true`` + on an unchanged AG. ``Get-DbaAvailabilityGroup``'s SMO object never populates + ``FailureConditionLevel``/``HealthCheckTimeout`` (they read back as unset + defaults), and ``sys.availability_groups`` is a cache of the WSFC cluster + resource's copy, so it's empty for AGs with ``cluster_type`` set to ``None``. + Since neither source can be trusted, both properties are now excluded from + the idempotency diff; they're still applied via ``Set-DbaAvailabilityGroup`` + whenever another property change triggers an update (https://github.com/lowlydba/lowlydba.sqlserver/issues/381). + - backup, restore - Fix ``changed`` being reported as ``false`` in ``check_mode``, + since ``Backup-DbaDatabase``/``Restore-DbaDatabase`` return no output under + ``-WhatIf`` (https://github.com/lowlydba/lowlydba.sqlserver/issues/381). + minor_changes: + - Add a Pester unit test suite under ``tests/unit/plugins/module_utils/`` covering + the ``module_utils`` helpers (``Get-LowlyDbaSqlServerAuthSpec``, ``Get-SqlCredential``, + ``ConvertTo-SerializableObject``), and wire it into CI as a standalone job + since ``ansible-test units`` only supports Python (https://github.com/lowlydba/lowlydba.sqlserver/issues/382). + - Add check-mode assertions for the ``backup`` and ``restore`` integration test + targets, add idempotency assertions for the ``availability_group`` and ``ag_replica`` + targets, and exercise a non-default ``deployment_method`` in the ``install_script`` + targets (https://github.com/lowlydba/lowlydba.sqlserver/issues/381). + - Standardize module documentation examples and correct invalid parameters, + missing required options, and incorrect module references (https://github.com/lowlydba/lowlydba.sqlserver/pull/399). + fragments: + - 381-integration-test-gaps.yml + - 382-pester-unit-tests.yml + - 399-documentation-examples.yml + release_date: '2026-09-08' diff --git a/changelogs/fragments/381-integration-test-gaps.yml b/changelogs/fragments/381-integration-test-gaps.yml deleted file mode 100644 index a09cbfe5..00000000 --- a/changelogs/fragments/381-integration-test-gaps.yml +++ /dev/null @@ -1,5 +0,0 @@ -bugfixes: - - backup, restore - Fix ``changed`` being reported as ``false`` in ``check_mode``, since ``Backup-DbaDatabase``/``Restore-DbaDatabase`` return no output under ``-WhatIf`` (https://github.com/lowlydba/lowlydba.sqlserver/issues/381). - - availability_group - Fix ``changed`` being incorrectly reported as ``true`` on an unchanged AG. ``Get-DbaAvailabilityGroup``'s SMO object never populates ``FailureConditionLevel``/``HealthCheckTimeout`` (they read back as unset defaults), and ``sys.availability_groups`` is a cache of the WSFC cluster resource's copy, so it's empty for AGs with ``cluster_type`` set to ``None``. Since neither source can be trusted, both properties are now excluded from the idempotency diff; they're still applied via ``Set-DbaAvailabilityGroup`` whenever another property change triggers an update (https://github.com/lowlydba/lowlydba.sqlserver/issues/381). -minor_changes: - - Add check-mode assertions for the ``backup`` and ``restore`` integration test targets, add idempotency assertions for the ``availability_group`` and ``ag_replica`` targets, and exercise a non-default ``deployment_method`` in the ``install_script`` targets (https://github.com/lowlydba/lowlydba.sqlserver/issues/381). diff --git a/changelogs/fragments/382-pester-unit-tests.yml b/changelogs/fragments/382-pester-unit-tests.yml deleted file mode 100644 index e70ae9cc..00000000 --- a/changelogs/fragments/382-pester-unit-tests.yml +++ /dev/null @@ -1,6 +0,0 @@ -minor_changes: - - Add a Pester unit test suite under ``tests/unit/plugins/module_utils/`` covering the - ``module_utils`` helpers (``Get-LowlyDbaSqlServerAuthSpec``, ``Get-SqlCredential``, - ``ConvertTo-SerializableObject``), and wire it into CI as a standalone job since - ``ansible-test units`` only supports Python - (https://github.com/lowlydba/lowlydba.sqlserver/issues/382). diff --git a/galaxy.yml b/galaxy.yml index 3fa92fad..75d330c2 100644 --- a/galaxy.yml +++ b/galaxy.yml @@ -2,7 +2,7 @@ namespace: lowlydba name: sqlserver -version: 3.0.0 +version: 3.1.0 readme: README.md authors: - John McCall (github.com/lowlydba) diff --git a/plugins/modules/ag_listener.py b/plugins/modules/ag_listener.py index 376888aa..cbb291e5 100644 --- a/plugins/modules/ag_listener.py +++ b/plugins/modules/ag_listener.py @@ -72,21 +72,20 @@ ''' EXAMPLES = r''' -- name: Create Availability Group +- name: Create an availability group lowlydba.sqlserver.availability_group: - sql_instance: sql-01.myco.io - ag_name: AG_MyDatabase + sql_instance: sql01.example.com + ag_name: AG_App -- name: Create AG Listener +- name: Create an availability group listener lowlydba.sqlserver.ag_listener: - sql_instance_primary: sql-01.myco.io - ag_name: AG_MyDatabase - listener_name: aglMyDatabase + sql_instance: sql01.example.com + ag_name: AG_App + listener_name: AG-App ip_address: - 10.0.20.20 - - 10.1.77.77 subnet_ip: - - 255.255.252.0 + - 10.0.20.0 subnet_mask: - 255.255.255.0 ''' diff --git a/plugins/modules/ag_replica.py b/plugins/modules/ag_replica.py index 3119131c..c94f07f3 100644 --- a/plugins/modules/ag_replica.py +++ b/plugins/modules/ag_replica.py @@ -122,16 +122,16 @@ ''' EXAMPLES = r''' -- name: Create Availability Group +- name: Create an availability group lowlydba.sqlserver.availability_group: - sql_instance: sql-01.myco.io - ag_name: AG_MyDatabase + sql_instance: sql01.example.com + ag_name: AG_App -- name: Add a DR replica +- name: Add a disaster recovery replica lowlydba.sqlserver.ag_replica: - ag_name: 'AG_MyDatabase' - sql_instance: sql-01.myco.io - sql_instance_replica: sql-02.myco.io + ag_name: AG_App + sql_instance: sql01.example.com + sql_instance_replica: sql02.example.com failover_mode: 'Manual' availability_mode: 'AsynchronousCommit' seeding_mode: 'Automatic' diff --git a/plugins/modules/agent_job.py b/plugins/modules/agent_job.py index dbd3043f..9eecf572 100644 --- a/plugins/modules/agent_job.py +++ b/plugins/modules/agent_job.py @@ -69,10 +69,10 @@ ''' EXAMPLES = r''' -- name: Create a job +- name: Create a SQL Server Agent job lowlydba.sqlserver.agent_job: - sql_instance: sql-01.myco.io - job: MyJob + sql_instance: sql01.example.com + job: NightlyBackup force: true ''' diff --git a/plugins/modules/agent_job_category.py b/plugins/modules/agent_job_category.py index ce480c4c..1350f0be 100644 --- a/plugins/modules/agent_job_category.py +++ b/plugins/modules/agent_job_category.py @@ -34,10 +34,10 @@ ''' EXAMPLES = r''' -- name: Create a maintenance job category +- name: Create a SQL Server Agent job category lowlydba.sqlserver.agent_job_category: - sql_instance: sql-01.myco.io - category: "Index Maintenance" + sql_instance: sql01.example.com + category: Index Maintenance ''' RETURN = r''' diff --git a/plugins/modules/agent_job_schedule.py b/plugins/modules/agent_job_schedule.py index cb0232ad..c4927f82 100644 --- a/plugins/modules/agent_job_schedule.py +++ b/plugins/modules/agent_job_schedule.py @@ -115,22 +115,24 @@ ''' EXAMPLES = r''' -- name: Create a job schedule +- name: Create a daily SQL Server Agent schedule lowlydba.sqlserver.agent_job_schedule: - sql_instance: sql-01.myco.io + sql_instance: sql01.example.com + job: NightlyBackup schedule: DailySchedule force: true enabled: true - start_date: 2020-05-25 # May 25, 2020 - end_date: 2099-05-25 # May 25, 2099 - start_time: 010500 # 01:05:00 AM - end_time: 140030 # 02:00:30 PM + frequency_type: Daily + start_date: '20260101' + end_date: '20991231' + start_time: '010500' + end_time: '140030' state: present -- name: Create a job with schedule +- name: Assign the schedule to a SQL Server Agent job lowlydba.sqlserver.agent_job: - sql_instance: sql-01.myco.io - job: MyJob + sql_instance: sql01.example.com + job: NightlyBackup force: true schedule: DailySchedule ''' diff --git a/plugins/modules/agent_job_step.py b/plugins/modules/agent_job_step.py index 11d82472..ccb8b527 100644 --- a/plugins/modules/agent_job_step.py +++ b/plugins/modules/agent_job_step.py @@ -102,28 +102,28 @@ ''' EXAMPLES = r''' -- name: Create a job +- name: Create a SQL Server Agent job lowlydba.sqlserver.agent_job: - sql_instance: sql-01.myco.io - job: MyJob + sql_instance: sql01.example.com + job: NightlyBackup force: true -- name: Create a job step +- name: Create a SQL Server Agent job step lowlydba.sqlserver.agent_job_step: - sql_instance: sql-01.myco.io - job: MyJob - step_name: Step1 + sql_instance: sql01.example.com + job: NightlyBackup + step_name: TruncateStagingTable step_id: 1 command: "TRUNCATE TABLE dbo.TestData;" -- name: Create a job step with output file +- name: Create a job step with output redirected to a file lowlydba.sqlserver.agent_job_step: - sql_instance: sql-01.myco.io - job: MyJob - step_name: Step2 + sql_instance: sql01.example.com + job: NightlyBackup + step_name: ListDatabases step_id: 2 command: "SELECT * FROM sys.databases;" - output_file: "C:\\Logs\\MyJob_Step2.log" + output_file: "C:\\Logs\\NightlyBackup_ListDatabases.log" ''' RETURN = r''' diff --git a/plugins/modules/availability_group.py b/plugins/modules/availability_group.py index 3429224c..6b0d700d 100644 --- a/plugins/modules/availability_group.py +++ b/plugins/modules/availability_group.py @@ -160,10 +160,10 @@ ''' EXAMPLES = r''' -- name: Create Availability Group +- name: Create an availability group lowlydba.sqlserver.availability_group: - sql_instance: sql-01.myco.io - ag_name: AG_MyDatabase + sql_instance: sql01.example.com + ag_name: AG_App ''' RETURN = r''' diff --git a/plugins/modules/backup.py b/plugins/modules/backup.py index 962b0cfc..319a9743 100644 --- a/plugins/modules/backup.py +++ b/plugins/modules/backup.py @@ -175,17 +175,17 @@ ''' EXAMPLES = r''' -- name: Create striped full database backup in default dir +- name: Create a striped full database backup lowlydba.sqlserver.backup: - sql_instance: sql-01.myco.io - database: LowlyDB + sql_instance: sql01.example.com + database: AppDb type: full file_count: 8 -- name: Create t-log backup +- name: Create a transaction log backup lowlydba.sqlserver.backup: - sql_instance: sql-01.myco.io - database: LowlyDB + sql_instance: sql01.example.com + database: AppDb type: log ''' diff --git a/plugins/modules/credential.py b/plugins/modules/credential.py index e83b8ed3..76f6bc6b 100644 --- a/plugins/modules/credential.py +++ b/plugins/modules/credential.py @@ -58,28 +58,31 @@ EXAMPLES = r''' - name: Create a credential with a password lowlydba.sqlserver.credential: - sql_instance: sql-01.myco.io - identity: ad\\user - name: MyCredential - password : + sql_instance: sql01.example.com + identity: EXAMPLE\sql-backup + name: BackupCredential + password: "{{ vault_backup_credential_password }}" - name: Replace an existing credential lowlydba.sqlserver.credential: - sql_instance: sql-01.myco.io - identity: MyIdentity + sql_instance: sql01.example.com + identity: EXAMPLE\sql-backup + name: BackupCredential + password: "{{ vault_backup_credential_password }}" force: true - name: Create a credential using a SAS token for a backup URL lowlydba.sqlserver.credential: - sql_instance: sql-01.myco.io + sql_instance: sql01.example.com identity: SHARED ACCESS SIGNATURE - name: https://.blob.core.windows.net/ - password : + name: https://examplestorage.blob.core.windows.net/sql-backups + password: "{{ vault_azure_storage_sas_token }}" - name: Remove a credential lowlydba.sqlserver.credential: - sql_instance: sql-01.myco.io - identity: MyIdentity + sql_instance: sql01.example.com + identity: EXAMPLE\sql-backup + name: BackupCredential state: absent ''' diff --git a/plugins/modules/database.py b/plugins/modules/database.py index d1d8cd91..179c9143 100644 --- a/plugins/modules/database.py +++ b/plugins/modules/database.py @@ -79,15 +79,15 @@ ''' EXAMPLES = r''' -- name: Create database +- name: Create a database lowlydba.sqlserver.database: - sql_instance: sql-01.myco.io - database: LowlyDB + sql_instance: sql01.example.com + database: AppDb -- name: Create database with customizations +- name: Create a database with custom settings lowlydba.sqlserver.database: - sql_instance: sql-01.myco.io - database: LowlyDB + sql_instance: sql01.example.com + database: ReportingDb owner: sa maxdop: 2 recovery_model: Simple diff --git a/plugins/modules/dba_multitool.py b/plugins/modules/dba_multitool.py index 6daeef3d..8b79858f 100644 --- a/plugins/modules/dba_multitool.py +++ b/plugins/modules/dba_multitool.py @@ -51,8 +51,8 @@ EXAMPLES = r''' - name: Install DBA MultiTool lowlydba.sqlserver.dba_multitool: - sql_instance: test-server.my.company.com - database: dba_tools + sql_instance: sql01.example.com + database: DbaTools ''' RETURN = r''' diff --git a/plugins/modules/first_responder_kit.py b/plugins/modules/first_responder_kit.py index fba6fad9..919513fd 100644 --- a/plugins/modules/first_responder_kit.py +++ b/plugins/modules/first_responder_kit.py @@ -70,10 +70,10 @@ ''' EXAMPLES = r''' -- name: Install FRK +- name: Install First Responder Kit lowlydba.sqlserver.first_responder_kit: - sql_instance: test-server.my.company.com - database: dba_tools + sql_instance: sql01.example.com + database: DbaTools ''' RETURN = r''' diff --git a/plugins/modules/hadr.py b/plugins/modules/hadr.py index 0fc91d22..10b03cb9 100644 --- a/plugins/modules/hadr.py +++ b/plugins/modules/hadr.py @@ -49,9 +49,9 @@ ''' EXAMPLES = r''' -- name: Enable hadr with service restart +- name: Enable HADR and restart the SQL Server service lowlydba.sqlserver.hadr: - sql_instance: sql-01.myco.io + sql_instance: sql01.example.com enabled: true force: true ''' diff --git a/plugins/modules/install_script.py b/plugins/modules/install_script.py index d233fb7b..6b95b232 100644 --- a/plugins/modules/install_script.py +++ b/plugins/modules/install_script.py @@ -90,9 +90,9 @@ ''' EXAMPLES = r''' -- name: Migrate a database +- name: Apply database migration scripts lowlydba.sqlserver.install_script: - sql_instance: test-server.my.company.com + sql_instance: sql01.example.com database: AdventureWorks path: migrations ''' diff --git a/plugins/modules/instance_info.py b/plugins/modules/instance_info.py index 2bfdbf15..4ec6fabe 100644 --- a/plugins/modules/instance_info.py +++ b/plugins/modules/instance_info.py @@ -21,9 +21,9 @@ ''' EXAMPLES = r''' -- name: Get basic info for an instance +- name: Get basic instance information lowlydba.sqlserver.instance_info: - sql_instance: sql-01.myco.io + sql_instance: sql01.example.com ''' RETURN = r''' diff --git a/plugins/modules/login.py b/plugins/modules/login.py index 553b969d..ebe1651c 100644 --- a/plugins/modules/login.py +++ b/plugins/modules/login.py @@ -81,16 +81,16 @@ ''' EXAMPLES = r''' -- name: Create a login +- name: Create a SQL login lowlydba.sqlserver.login: - sql_instance: sql-01.myco.io - login: TheIntern - password: ReallyComplexStuff12345! + sql_instance: sql01.example.com + login: app_login + password: "{{ vault_app_login_password }}" -- name: Disable a login +- name: Disable a SQL login lowlydba.sqlserver.login: - sql_instance: sql-01.myco.io - login: TheIntern + sql_instance: sql01.example.com + login: app_login enabled: false ''' diff --git a/plugins/modules/login_role.py b/plugins/modules/login_role.py index 04d44799..5d3b68a4 100644 --- a/plugins/modules/login_role.py +++ b/plugins/modules/login_role.py @@ -33,23 +33,23 @@ ''' EXAMPLES = r''' -- name: Add a user to a fixed server role +- name: Add a login to a fixed server role lowlydba.sqlserver.login_role: - sql_instance: sql-01.myco.io - login: TheIntern + sql_instance: sql01.example.com + login: app_login server_role: sysadmin -- name: Remove a user from a fixed server role +- name: Remove a login from a fixed server role lowlydba.sqlserver.login_role: - sql_instance: sql-01.myco.io - login: TheIntern + sql_instance: sql01.example.com + login: app_login server_role: sysadmin state: absent -- name: Add a user to a custom server role +- name: Add a login to a custom server role lowlydba.sqlserver.login_role: - sql_instance: sql-01.myco.io - login: TheIntern + sql_instance: sql01.example.com + login: app_login server_role: demi-admin ''' diff --git a/plugins/modules/maintenance_solution.py b/plugins/modules/maintenance_solution.py index 1df314ff..16fbac5b 100644 --- a/plugins/modules/maintenance_solution.py +++ b/plugins/modules/maintenance_solution.py @@ -86,10 +86,11 @@ ''' EXAMPLES = r''' -- name: Install/Update Maintenance Solution - lowlydba.sqlserver.multitool: - sql_instance: sql-01.myco.io - database: main +- name: Install or update Ola Hallengren's Maintenance Solution + lowlydba.sqlserver.maintenance_solution: + sql_instance: sql01.example.com + database: DbaTools + install_jobs: true replace_existing: true ''' diff --git a/plugins/modules/memory.py b/plugins/modules/memory.py index 65b6b327..8715bb17 100644 --- a/plugins/modules/memory.py +++ b/plugins/modules/memory.py @@ -28,13 +28,13 @@ ''' EXAMPLES = r''' -- name: Automatically configure SQL max memory +- name: Automatically configure SQL Server max memory lowlydba.sqlserver.memory: - sql_instance: sql-01.myco.io + sql_instance: sql01.example.com -- name: Manually configure SQL max memory +- name: Set SQL Server max memory explicitly lowlydba.sqlserver.memory: - sql_instance: sql-01.myco.io + sql_instance: sql01.example.com max: 10240 ''' diff --git a/plugins/modules/nonquery.py b/plugins/modules/nonquery.py index 7c6d42e3..fd0057a7 100644 --- a/plugins/modules/nonquery.py +++ b/plugins/modules/nonquery.py @@ -40,11 +40,11 @@ ''' EXAMPLES = r''' -- name: Update a table value +- name: Update active users lowlydba.sqlserver.nonquery: - sql_instance: sql-01-myco.io - database: userdb - nonquery: "UPDATE dbo.User set IsActive = 1;" + sql_instance: sql01.example.com + database: AppDb + nonquery: "UPDATE dbo.Users SET IsActive = 1;" ''' RETURN = r''' # ''' diff --git a/plugins/modules/resource_governor.py b/plugins/modules/resource_governor.py index 66b789d2..6f1b48af 100644 --- a/plugins/modules/resource_governor.py +++ b/plugins/modules/resource_governor.py @@ -33,9 +33,9 @@ ''' EXAMPLES = r''' -- name: Enable resource governor +- name: Enable Resource Governor lowlydba.sqlserver.resource_governor: - sql_instance: sql-01.myco.io + sql_instance: sql01.example.com enabled: true ''' diff --git a/plugins/modules/restore.py b/plugins/modules/restore.py index 5899ef18..31cffd60 100644 --- a/plugins/modules/restore.py +++ b/plugins/modules/restore.py @@ -204,21 +204,24 @@ ''' EXAMPLES = r''' -- name: Restore a Database +- name: Restore a database from the latest backup lowlydba.sqlserver.restore: - sql_instance: sql-01.myco.io - database: LowlyDB + sql_instance: sql01.example.com + database: AppDb + path: C:\SQLBackups\AppDb -- name: Restore a Database and allow future T-Log restores +- name: Restore a database and leave it ready for transaction log restores lowlydba.sqlserver.restore: - sql_instance: sql-01.myco.io - database: LowlyDB1 + sql_instance: sql01.example.com + database: AppDb + path: C:\SQLBackups\AppDb no_recovery: true -- name: Verify backup files, no restore +- name: Verify backup files without restoring lowlydba.sqlserver.restore: - sql_instance: sql-01.myco.io - database: LowlyDB2 + sql_instance: sql01.example.com + database: AppDb + path: C:\SQLBackups\AppDb verify_only: true ''' diff --git a/plugins/modules/rg_resource_pool.py b/plugins/modules/rg_resource_pool.py index 08b7aef2..ecee80ff 100644 --- a/plugins/modules/rg_resource_pool.py +++ b/plugins/modules/rg_resource_pool.py @@ -70,15 +70,15 @@ ''' EXAMPLES = r''' -- name: Enable resource governor +- name: Enable Resource Governor lowlydba.sqlserver.resource_governor: - sql_instance: sql-01.myco.io + sql_instance: sql01.example.com enabled: true -- name: Create rg resource pool +- name: Create a Resource Governor pool lowlydba.sqlserver.rg_resource_pool: - sql_instance: sql-01.myco.io - resource_pool: "rpLittle" + sql_instance: sql01.example.com + resource_pool: ReportingPool max_cpu_perc: 5 ''' diff --git a/plugins/modules/rg_workload_group.py b/plugins/modules/rg_workload_group.py index 21cf8261..d31c01ee 100644 --- a/plugins/modules/rg_workload_group.py +++ b/plugins/modules/rg_workload_group.py @@ -71,22 +71,22 @@ ''' EXAMPLES = r''' -- name: Enable resource governor +- name: Enable Resource Governor lowlydba.sqlserver.resource_governor: - sql_instance: sql-01.myco.io + sql_instance: sql01.example.com enabled: true -- name: Create rg resource pool +- name: Create a Resource Governor pool lowlydba.sqlserver.rg_resource_pool: - sql_instance: sql-01.myco.io - resource_pool: "rpLittle" + sql_instance: sql01.example.com + resource_pool: ReportingPool max_cpu_perc: 5 -- name: Create rg workload group +- name: Create a Resource Governor workload group lowlydba.sqlserver.rg_workload_group: - sql_instance: sql-01.myco.io - workload_group: rgMyGroup - resource_pool: rpLittle + sql_instance: sql01.example.com + workload_group: ReportingWorkload + resource_pool: ReportingPool resource_pool_type: Internal max_dop: 2 state: present diff --git a/plugins/modules/sa.py b/plugins/modules/sa.py index 3406fa29..9c00f63c 100644 --- a/plugins/modules/sa.py +++ b/plugins/modules/sa.py @@ -55,14 +55,14 @@ ''' EXAMPLES = r''' -- name: Disable sa login +- name: Disable the sa login lowlydba.sqlserver.sa: - sql_instance: sql-01.myco.io + sql_instance: sql01.example.com enabled: false -- name: Rename sa login +- name: Rename the sa login lowlydba.sqlserver.sa: - sql_instance: sql-01.myco.io + sql_instance: sql01.example.com new_name: 'notthesayourelookingfor' ''' diff --git a/plugins/modules/sp_configure.py b/plugins/modules/sp_configure.py index 91e060e8..c4755bd9 100644 --- a/plugins/modules/sp_configure.py +++ b/plugins/modules/sp_configure.py @@ -33,9 +33,9 @@ ''' EXAMPLES = r''' -- name: Enable remote DAC connection +- name: Enable remote DAC connections lowlydba.sqlserver.sp_configure: - sql_instance: sql-01.myco.io + sql_instance: sql01.example.com name: RemoteDacConnectionsEnabled value: 1 ''' diff --git a/plugins/modules/sp_whoisactive.py b/plugins/modules/sp_whoisactive.py index 8aed1036..ac73dada 100644 --- a/plugins/modules/sp_whoisactive.py +++ b/plugins/modules/sp_whoisactive.py @@ -39,10 +39,10 @@ ''' EXAMPLES = r''' -- name: Install/Update sp_whoisactive +- name: Install or update sp_WhoIsActive lowlydba.sqlserver.sp_whoisactive: - sql_instance: sql-01.myco.io - database: lowlydb + sql_instance: sql01.example.com + database: DbaTools ''' RETURN = r''' diff --git a/plugins/modules/spn.py b/plugins/modules/spn.py index d08d825b..c671bf48 100644 --- a/plugins/modules/spn.py +++ b/plugins/modules/spn.py @@ -42,28 +42,15 @@ ''' EXAMPLES = r''' -- name: Add server SPN +- name: Add a server SPN lowlydba.sqlserver.spn: - computer: sql-01.myco.io - service_account: myco\sql-svc + computer: sql01.example.com + service_account: EXAMPLE\sql-svc -- name: Create an AG Listener - lowlydba.sqlserver.ag_listener: - sql_instance_primary: sql-01.myco.io - ag_name: AG_MyDatabase - listener_name: aglMyDatabase - ip_address: - - 10.0.20.20 - - 10.1.77.77 - subnet_ip: - - 255.255.252.0 - subnet_mask: - - 255.255.255.0 - -- name: Add SPN for new AG listener on port 1433 +- name: Add an SPN for an availability group listener lowlydba.sqlserver.spn: - computer: aglMyDatabase.myco.io:1433 - service_account: myco\sql-svc + computer: AG-App.example.com:1433 + service_account: EXAMPLE\sql-svc ''' RETURN = r''' diff --git a/plugins/modules/tcp_port.py b/plugins/modules/tcp_port.py index f97013f8..c53041e5 100644 --- a/plugins/modules/tcp_port.py +++ b/plugins/modules/tcp_port.py @@ -49,14 +49,14 @@ ''' EXAMPLES = r''' -- name: Set the default port +- name: Set the default SQL Server port lowlydba.sqlserver.tcp_port: - sql_instance: sql-01.myco.io + sql_instance: sql01.example.com port: 1433 -- name: Set a non-standard default port +- name: Set a non-standard SQL Server port lowlydba.sqlserver.tcp_port: - sql_instance: sql-01.myco.io + sql_instance: sql01.example.com port: 1933 ''' diff --git a/plugins/modules/traceflag.py b/plugins/modules/traceflag.py index c8139e51..bbac1cff 100644 --- a/plugins/modules/traceflag.py +++ b/plugins/modules/traceflag.py @@ -34,15 +34,15 @@ ''' EXAMPLES = r''' -- name: Eliminate successful backup information from SQL Error Log +- name: Suppress successful backup messages in the SQL Server error log lowlydba.sqlserver.traceflag: - sql_instance: sql-01.myco.io + sql_instance: sql01.example.com trace_flag: 3226 enabled: true -- name: Disable trace flag +- name: Disable the backup message trace flag lowlydba.sqlserver.traceflag: - sql_instance: sql-01.myco.io + sql_instance: sql01.example.com trace_flag: 3226 enabled: false ''' diff --git a/plugins/modules/user.py b/plugins/modules/user.py index b9c36d06..899ac250 100644 --- a/plugins/modules/user.py +++ b/plugins/modules/user.py @@ -49,27 +49,27 @@ ''' EXAMPLES = r''' -- name: Create a user +- name: Create a database user lowlydba.sqlserver.user: - sql_instance: sql-01.myco.io - login: TheIntern - username: TheIntern - database: InternProject1 + sql_instance: sql01.example.com + login: app_login + username: app_user + database: AppDb -- name: Change user's schema - lowlydba.sqlserver.login: - sql_instance: sql-01.myco.io - login: TheIntern - username: TheIntern - database: InternProject1 +- name: Set a database user's default schema + lowlydba.sqlserver.user: + sql_instance: sql01.example.com + login: app_login + username: app_user + database: AppDb default_schema: dev - name: Remove a user - lowlydba.sqlserver.login: - sql_instance: sql-01.myco.io - login: TheIntern - username: TheIntern - database: InternProject1 + lowlydba.sqlserver.user: + sql_instance: sql01.example.com + login: app_login + username: app_user + database: AppDb state: absent ''' diff --git a/plugins/modules/user_role.py b/plugins/modules/user_role.py index 47129280..665d562e 100644 --- a/plugins/modules/user_role.py +++ b/plugins/modules/user_role.py @@ -75,26 +75,26 @@ ''' EXAMPLES = r''' -- name: Add a user to a fixed db role (legacy) +- name: Add a user to a fixed database role (legacy) lowlydba.sqlserver.user_role: - sql_instance: sql-01.myco.io - username: TheIntern - database: InternProject1 + sql_instance: sql01.example.com + username: app_user + database: AppDb role: db_owner -- name: Remove a user from a fixed db role (legacy) +- name: Remove a user from a fixed database role (legacy) lowlydba.sqlserver.user_role: - sql_instance: sql-01.myco.io - username: TheIntern - database: InternProject1 + sql_instance: sql01.example.com + username: app_user + database: AppDb role: db_owner state: absent - name: Add user to multiple roles lowlydba.sqlserver.user_role: - sql_instance: sql-01.myco.io - username: TheIntern - database: InternProject1 + sql_instance: sql01.example.com + username: app_user + database: AppDb roles: add: - db_owner @@ -102,9 +102,9 @@ - name: Remove user from multiple roles lowlydba.sqlserver.user_role: - sql_instance: sql-01.myco.io - username: TheIntern - database: InternProject1 + sql_instance: sql01.example.com + username: app_user + database: AppDb roles: remove: - db_owner @@ -112,9 +112,9 @@ - name: Set user's roles (replace all current roles) lowlydba.sqlserver.user_role: - sql_instance: sql-01.myco.io - username: TheIntern - database: InternProject1 + sql_instance: sql01.example.com + username: app_user + database: AppDb roles: set: - db_datareader @@ -122,9 +122,9 @@ - name: Combine add and remove operations lowlydba.sqlserver.user_role: - sql_instance: sql-01.myco.io - username: TheIntern - database: InternProject1 + sql_instance: sql01.example.com + username: app_user + database: AppDb roles: add: - db_securityadmin