Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add compatibility for dbops v0.9 #231

Merged
merged 2 commits into from
Feb 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ lowlydba.sqlserver Release Notes
.. contents:: Topics


v2.3.1
======

Release Summary
---------------

Update the install script feature to accommodate the latest minor DbOps release (v0.9.x)

Minor Changes
-------------

- Add new input strings to be compatible with dbops v0.9.x (https://github.com/lowlydba/lowlydba.sqlserver/pull/231)

v2.3.0
======

Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# lowlydba.sqlserver Collection for Ansible
# lowlydba.sqlserver Collection for Ansible<!-- omit in toc -->

![GPL v3](https://img.shields.io/github/license/lowlydba/lowlydba.sqlserver)
[![CI](https://github.com/lowlydba/lowlydba.sqlserver/actions/workflows/ansible-test.yml/badge.svg)](https://github.com/lowlydba/lowlydba.sqlserver/actions/workflows/ansible-test.yml)
Expand All @@ -11,11 +11,17 @@
- [Contributing to this collection](#contributing-to-this-collection)
- [Collection maintenance](#collection-maintenance)
- [Tested with](#tested-with)
- [Ansible](#ansible)
- [SQL Server](#sql-server)
- [External requirements](#external-requirements)
- [Using this collection](#using-this-collection)
- [Installing the Collection from Ansible Galaxy](#installing-the-collection-from-ansible-galaxy)
- [Release notes](#release-notes)
- [Releasing](#releasing)
- [Release notes](#release-notes)
- [Next Release](#next-release)
- [Schedule](#schedule)
- [Versioning](#versioning)
- [Deprecation](#deprecation)

## Modules

Expand Down Expand Up @@ -73,7 +79,7 @@ To learn how to maintain / become a maintainer of this collection, refer to the

- PowerShell modules
- [dbatools][dbatools] >= 2.0.0
- [dbops][dbops] >= 0.8.0
- [dbops][dbops] >= 0.9.0

## Using this collection

Expand Down
10 changes: 10 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -473,3 +473,13 @@ releases:
- 2-2-4-release-summary.yml
- 227-skip-pwd-reset.yml
release_date: '2024-02-10'
2.3.1:
changes:
minor_changes:
- Add new input strings to be compatible with dbops v0.9.x (https://github.com/lowlydba/lowlydba.sqlserver/pull/231)
release_summary: Update the install script feature to accommodate the latest
minor DbOps release (v0.9.x)
fragments:
- 2-3-1-release-summary.yml
- 231-dbops-v09.yml
release_date: '2024-02-24'
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace: lowlydba
name: sqlserver
version: 2.3.0
version: 2.3.1
readme: README.md
authors:
- John McCall (github.com/lowlydba)
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/install_script.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@
#AnsibleRequires -CSharpUtil Ansible.Basic
#AnsibleRequires -PowerShell ansible_collections.lowlydba.sqlserver.plugins.module_utils._SqlServerUtils
#Requires -Modules @{ ModuleName="dbatools"; ModuleVersion="2.0.0" }
#Requires -Modules @{ ModuleName="dbops"; ModuleVersion="0.8.0" }
#Requires -Modules @{ ModuleName="dbops"; ModuleVersion="0.9.0" }

$spec = @{
supports_check_mode = $true
options = @{
database = @{type = 'str'; required = $true }
path = @{type = 'str'; required = $true }
deployment_method = @{type = 'str'; required = $false; default = 'NoTransaction'
choices = @('NoTransaction', 'SingleTransaction', 'TransactionPerScript')
choices = @('NoTransaction', 'SingleTransaction', 'TransactionPerScript', 'AlwaysRollback')
}
schema_version_table = @{type = 'str'; required = $false }
no_log_version = @{type = 'bool'; required = $false; default = $false }
Expand Down
3 changes: 2 additions & 1 deletion plugins/modules/install_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@
- C(SingleTransaction) - wrap all the deployment scripts into a single transaction and rollback whole deployment on error.
- C(TransactionPerScript) - wrap each script into a separate transaction; rollback single script deployment in case of error.
- C(NoTransaction) - deploy as is.
- C(AlwaysRollback) - roll back the transaction.
type: str
required: false
default: 'NoTransaction'
choices: ['NoTransaction', 'SingleTransaction', 'TransactionPerScript']
choices: ['NoTransaction', 'SingleTransaction', 'TransactionPerScript', 'AlwaysRollback']
no_log_version:
description:
- If set, the deployment will not be tracked in the database. That will also mean that all the scripts
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/targets/setup_sqlserver/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ dbatools_install_cmd: >
Set-DbatoolsInsecureConnection -Scope FileUserLocal
}

dbops_min_version: 0.8.0
dbops_min_version: 0.9.0
dbops_install_cmd: >
if (-not(Get-Module -FullyQualifiedName @{ModuleName='dbops';ModuleVersion='{{ dbops_min_version }}'} -ListAvailable)) {
Install-Module dbops -MinimumVersion {{ dbops_min_version }} -Force -SkipPublisherCheck -AllowClobber
Expand Down
Loading