Conversation
|
WIP. needs the latest dbatools. |
Docs Build 📝Thank you for contribution!✨ The docs for this PR have been published here: You can compare to the docs for the The docsite for this PR is also available for download as an artifact from this run: File changes: Click to see the diff comparison.NOTE: only file modifications are shown here. New and deleted files are excluded. diff --git a/home/runner/work/lowlydba.sqlserver/lowlydba.sqlserver/docsbuild/base/collections/lowlydba/sqlserver/availability_group_module.html b/home/runner/work/lowlydba.sqlserver/lowlydba.sqlserver/docsbuild/head/collections/lowlydba/sqlserver/availability_group_module.html
index 0fe25ed..59fd612 100644
--- a/home/runner/work/lowlydba.sqlserver/lowlydba.sqlserver/docsbuild/base/collections/lowlydba/sqlserver/availability_group_module.html
+++ b/home/runner/work/lowlydba.sqlserver/lowlydba.sqlserver/docsbuild/head/collections/lowlydba/sqlserver/availability_group_module.html
@@ -256,6 +256,18 @@ see <a class="reference internal" href="#ansible-collections-lowlydba-sqlserver-
</div></td>
</tr>
<tr class="row-odd"><td><div class="ansible-option-cell">
+<div class="ansibleOptionAnchor" id="parameter-contained_availability_group"></div><p class="ansible-option-title" id="ansible-collections-lowlydba-sqlserver-availability-group-module-parameter-contained-availability-group"><strong>contained_availability_group</strong></p>
+<a class="ansibleOptionLink" href="#parameter-contained_availability_group" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
+</div></td>
+<td><div class="ansible-option-cell"><p>Indicates whether the availability group is Contained. Requires DBATools >= 2.1.15</p>
+<p class="ansible-option-line"><strong class="ansible-option-choices">Choices:</strong></p>
+<ul class="simple">
+<li><p><code class="ansible-option-choices-entry docutils literal notranslate"><span class="pre">false</span></code></p></li>
+<li><p><code class="ansible-option-choices-entry docutils literal notranslate"><span class="pre">true</span></code></p></li>
+</ul>
+</div></td>
+</tr>
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-database"></div>
<div class="ansibleOptionAnchor" id="parameter-database_name"></div><p class="ansible-option-title" id="ansible-collections-lowlydba-sqlserver-availability-group-module-parameter-database-name"><span id="ansible-collections-lowlydba-sqlserver-availability-group-module-parameter-database"></span><strong>database</strong></p>
<a class="ansibleOptionLink" href="#parameter-database" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-aliases">aliases: database_name</span></p>
@@ -264,7 +276,7 @@ see <a class="reference internal" href="#ansible-collections-lowlydba-sqlserver-
<td><div class="ansible-option-cell"><p>Name of the database to create the Availability Group for.</p>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-database_health_trigger"></div><p class="ansible-option-title" id="ansible-collections-lowlydba-sqlserver-availability-group-module-parameter-database-health-trigger"><strong>database_health_trigger</strong></p>
<a class="ansibleOptionLink" href="#parameter-database_health_trigger" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
</div></td>
@@ -276,7 +288,7 @@ see <a class="reference internal" href="#ansible-collections-lowlydba-sqlserver-
</ul>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-dtc_support_enabled"></div><p class="ansible-option-title" id="ansible-collections-lowlydba-sqlserver-availability-group-module-parameter-dtc-support-enabled"><strong>dtc_support_enabled</strong></p>
<a class="ansibleOptionLink" href="#parameter-dtc_support_enabled" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
</div></td>
@@ -288,7 +300,7 @@ see <a class="reference internal" href="#ansible-collections-lowlydba-sqlserver-
</ul>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-failover_mode"></div><p class="ansible-option-title" id="ansible-collections-lowlydba-sqlserver-availability-group-module-parameter-failover-mode"><strong>failover_mode</strong></p>
<a class="ansibleOptionLink" href="#parameter-failover_mode" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -300,7 +312,7 @@ see <a class="reference internal" href="#ansible-collections-lowlydba-sqlserver-
</ul>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-failure_condition_level"></div><p class="ansible-option-title" id="ansible-collections-lowlydba-sqlserver-availability-group-module-parameter-failure-condition-level"><strong>failure_condition_level</strong></p>
<a class="ansibleOptionLink" href="#parameter-failure_condition_level" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -315,7 +327,7 @@ see <a class="reference internal" href="#ansible-collections-lowlydba-sqlserver-
</ul>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-force"></div><p class="ansible-option-title" id="ansible-collections-lowlydba-sqlserver-availability-group-module-parameter-force"><strong>force</strong></p>
<a class="ansibleOptionLink" href="#parameter-force" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
</div></td>
@@ -327,7 +339,7 @@ see <a class="reference internal" href="#ansible-collections-lowlydba-sqlserver-
</ul>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-healthcheck_timeout"></div><p class="ansible-option-title" id="ansible-collections-lowlydba-sqlserver-availability-group-module-parameter-healthcheck-timeout"><strong>healthcheck_timeout</strong></p>
<a class="ansibleOptionLink" href="#parameter-healthcheck_timeout" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">integer</span></p>
</div></td>
@@ -335,7 +347,7 @@ see <a class="reference internal" href="#ansible-collections-lowlydba-sqlserver-
<p>Changes that are made to the timeout settings are effective immediately and do not require a restart of the SQL Server resource.</p>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-is_distributed_ag"></div><p class="ansible-option-title" id="ansible-collections-lowlydba-sqlserver-availability-group-module-parameter-is-distributed-ag"><strong>is_distributed_ag</strong></p>
<a class="ansibleOptionLink" href="#parameter-is_distributed_ag" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
</div></td>
@@ -347,7 +359,7 @@ see <a class="reference internal" href="#ansible-collections-lowlydba-sqlserver-
</ul>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-seeding_mode"></div><p class="ansible-option-title" id="ansible-collections-lowlydba-sqlserver-availability-group-module-parameter-seeding-mode"><strong>seeding_mode</strong></p>
<a class="ansibleOptionLink" href="#parameter-seeding_mode" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -359,56 +371,56 @@ see <a class="reference internal" href="#ansible-collections-lowlydba-sqlserver-
</ul>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-shared_path"></div><p class="ansible-option-title" id="ansible-collections-lowlydba-sqlserver-availability-group-module-parameter-shared-path"><strong>shared_path</strong></p>
<a class="ansibleOptionLink" href="#parameter-shared_path" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
<td><div class="ansible-option-cell"><p>The network share where the backups will be backed up and restored from.</p>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-sql_instance"></div><p class="ansible-option-title" id="ansible-collections-lowlydba-sqlserver-availability-group-module-parameter-sql-instance"><strong>sql_instance</strong></p>
<a class="ansibleOptionLink" href="#parameter-sql_instance" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span> / <span class="ansible-option-required">required</span></p>
</div></td>
<td><div class="ansible-option-cell"><p>The SQL Server instance to modify.</p>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-sql_instance_secondary"></div><p class="ansible-option-title" id="ansible-collections-lowlydba-sqlserver-availability-group-module-parameter-sql-instance-secondary"><strong>sql_instance_secondary</strong></p>
<a class="ansibleOptionLink" href="#parameter-sql_instance_secondary" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
<td><div class="ansible-option-cell"><p>The secondary SQL Server instance for the new Availability Group.</p>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-sql_password"></div><p class="ansible-option-title" id="ansible-collections-lowlydba-sqlserver-availability-group-module-parameter-sql-password"><strong>sql_password</strong></p>
<a class="ansibleOptionLink" href="#parameter-sql_password" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
<td><div class="ansible-option-cell"><p>Password for SQL Authentication.</p>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-sql_password_secondary"></div><p class="ansible-option-title" id="ansible-collections-lowlydba-sqlserver-availability-group-module-parameter-sql-password-secondary"><strong>sql_password_secondary</strong></p>
<a class="ansibleOptionLink" href="#parameter-sql_password_secondary" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
<td><div class="ansible-option-cell"><p>Password for SQL Authentication for the secondary replica.</p>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-sql_username"></div><p class="ansible-option-title" id="ansible-collections-lowlydba-sqlserver-availability-group-module-parameter-sql-username"><strong>sql_username</strong></p>
<a class="ansibleOptionLink" href="#parameter-sql_username" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
<td><div class="ansible-option-cell"><p>Username for SQL Authentication.</p>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-sql_username_secondary"></div><p class="ansible-option-title" id="ansible-collections-lowlydba-sqlserver-availability-group-module-parameter-sql-username-secondary"><strong>sql_username_secondary</strong></p>
<a class="ansibleOptionLink" href="#parameter-sql_username_secondary" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
<td><div class="ansible-option-cell"><p>Username for SQL Authentication for the secondary replica.</p>
</div></td>
</tr>
-<tr class="row-odd"><td><div class="ansible-option-cell">
+<tr class="row-even"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-state"></div><p class="ansible-option-title" id="ansible-collections-lowlydba-sqlserver-availability-group-module-parameter-state"><strong>state</strong></p>
<a class="ansibleOptionLink" href="#parameter-state" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">string</span></p>
</div></td>
@@ -420,7 +432,7 @@ see <a class="reference internal" href="#ansible-collections-lowlydba-sqlserver-
</ul>
</div></td>
</tr>
-<tr class="row-even"><td><div class="ansible-option-cell">
+<tr class="row-odd"><td><div class="ansible-option-cell">
<div class="ansibleOptionAnchor" id="parameter-use_last_backup"></div><p class="ansible-option-title" id="ansible-collections-lowlydba-sqlserver-availability-group-module-parameter-use-last-backup"><strong>use_last_backup</strong></p>
<a class="ansibleOptionLink" href="#parameter-use_last_backup" title="Permalink to this option"></a><p class="ansible-option-type-line"><span class="ansible-option-type">boolean</span></p>
</div></td>
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #249 +/- ##
==========================================
- Coverage 88.83% 85.37% -3.47%
==========================================
Files 70 107 +37
Lines 2598 2954 +356
Branches 39 78 +39
==========================================
+ Hits 2308 2522 +214
- Misses 275 402 +127
- Partials 15 30 +15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Alright @lowlydba I think I'm ready for you to have a look at the PR |
| use_last_backup: false | ||
| healthcheck_timeout: 15000 | ||
| basic_availability_group: false | ||
| contained_availability_group: false |
There was a problem hiding this comment.
Can you also add a test where this is true?
There was a problem hiding this comment.
New test in tests/inegration? I added some tasks in the win_availability_group that run when: contained_availability_group And test functionality.
lowlydba
left a comment
There was a problem hiding this comment.
Thanks! This looks great overall. The suggested edit should clear up the failing sanity check, and if you can add a test that covers actually using a contained AG, it will be good to go!
|
I just updated the repo permissions so you should be able to trigger the CI tests with your own commits now as well. |
Co-authored-by: John McCall <john@lowlydba.com>
|
Hi! Just in case you missed it, what kind of tests did you mean? |
Right below the comment thread here, you'll see a series of workflows that run integration and unit tests for the collection. Right now the "CI / Sanity" test is failing for some minor issues - all of the workflows will need to pass to make this mergeable. |
|
I still don't really understand how to add tests that cover contained AGs, I edited tests/integration/ and added an option to change contained_availability_group, but where can I create a test where it is set to true? |
Because what I would really like to do is to run the win_availability_group test with |
Yeah, the issue is right now its always set to false, so it won't get tested. You'd want to add a new test like: - name: Create contained availability group
lowlydba.sqlserver.availability_group:
ag_name: "contained_AG"
contained_availability_group: true
register: result
- assert:
that:
- result.data.ComputerName != None
- result.data.InstanceName != None
- result.data.SqlInstance != None
- result.data.AvailabilityGroup == "contained_AG"
- result.data.ClusterType == "{{ cluster_type }}"
- result.data.DtcSupportEnabled is false
- result.data.AvailabilityReplicas != None
- result is changedThe |
|
Seems like adding a test form contained AGs didn't help the codecov test? Would really like your input on that @lowlydba. Thank you! |
|
Also, I noticed I don't handle the case where an availability group that is not contained exists but the module specifies it should be contained. It is currently not possible to have an availability group be converted to a contained availability group, should I just error out in this case? and if force is specified only then drop it and recreate? |
|
@lowlydba I am completely baffled as to why this does not work. The error seems to be |
|
What active directory environment do the tests run it? Could it be a DC replication lag issue? |
You can check the GitHub test workflow for info, but there isn't anything beyond a local AD since we're using a single test runner. I still don't have a ton of time to dedicate to this project right now, so I apologize that I can't be of more help at this time. |
|
Hi @lowlydba was wondering if you take a look at this I'm unable to replicate this issue locally |
I don't have anything setup locally right now for AG testing, so I am not sure honestly. I've also never personally used contained AG before (and don't use any of this collection at my current job). I can take a look when I find some free time, but no promises. |
|
@DorBreger In an effort to continue to be able to support this collection for users, I've introduced GitHub Sponsors for this project (see announcement). This feature request would be a "small feature" in that context - if you have any further questions please reply in that discussion thread and we can discuss. Thanks! |
|
Looking at the output of grp1 it seems like ANY connection to ANY listener created in the context of those tests will fail with an error message of "the network path was not found". Must be the creation of the AGs with |
|
This is the best this PR will get I'm afraid. Can't really say anything about the codecov and the sp_whoisactive tests failing. Feel free to merge this |
|
@lowlydba would love to get your response when you have the time :) |
|
The codecov is for sure blocking, but the results do look weird for this PR. I am re-running the tests to see what a fresh run's coverage comes back as. |
|
@DorBreger I think the codecov is off since its still comparing to the very very old commit (844484b) which I am guessing its getting from your repo fork? Can you try updating the fork and/or rebasing your branch to make sure it has the right head commit to compare to?
|
…r into containedAGs
|
@lowlydba just did, sorry for the delay. I have been busy |
|
Thanks for trying that! It still looks off, it seems like it may have silently broken at some point on the default branch. I'm going to keep looking into this. |
|
Seems like all checks are successful @lowlydba |
Description
How Has This Been Tested?
Types of changes
Checklist:
version_addedproperty.