Skip to content

Commit

Permalink
feat: add compatibility for dbops v0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
lowlydba committed Feb 24, 2024
1 parent 740f4b2 commit 98fbe57
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
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
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
1 change: 1 addition & 0 deletions plugins/modules/install_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
- 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'
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

0 comments on commit 98fbe57

Please sign in to comment.