User Profile
slash83
Copper Contributor
Joined Oct 17, 2023
User Widgets
Recent Discussions
ansible.windows.win_dsc resource SqlPermission Not found
Hi I am trying to do SQL (SQL Server 2022) Automation along with Always_ON and failover Cluster setup using Ansible on Azure VM (Windows 2019 Server) . Since SQL VM do not have internet connectivity , I tried to install below module manually by downloading respective nupkg files. PowershellGet SqlServerDsc When we are trying to configure SQL Server Permission using below Ansible task, we receive following error messages ("msg": "Resource 'SqlPermission' not found.") - name: configure SQL server permissions ansible.windows.win_dsc: resource_name: SqlPermission ServerName: 'LocalHost' InstanceName: '{{ sql_server_instance_name }}' Name: '{{ item }}' PermissionToInclude: - State: Grant Permission: - 'AlterAnyAvailabilityGroup' - 'ViewServerState' - 'AlterAnyEndPoint' - 'ConnectSql' Credential_username: '{{ mssql_username }}' Credential_password: '{{ mssql_password }}' loop: "{{ [sql_server_svc_account, sql_server_agt_svc_account] | unique }}" Error Received failed: [<hostname>.<domain_name>] (item=<domain_name>\<Serviceaccount>) => { "ansible_loop_var": "item", "changed": false, "item": "<domain_name>\\<service_account>", "msg": "Resource 'SqlPermission' not found." } [<hostname>.<domain_name>] TASK: set_alwayson_perm : configure SQL server permissions (debug)> User interrupted execution. When we execute command Get-DscResource – Name SqlPermission, It errors out. I believe I am missing on some steps or configuration while doing DSC Module SQLServerDsc Please support.Powershell SQLLogin CIMException (Object not found)
Hi I am trying to add user to SQL Server using below Ansible task - name: add users to SQL Server ansible.windows.win_dsc: resource_name: SqlLogin Ensure: Present Name: "{{ item }}" LoginType: 'WindowsUser' ServerName: 'LocalHost' InstanceName: '{{ sql_server_instance_name }}' PsDscRunAsCredential_username: '{{ mssql_username }}' PsDscRunAsCredential_password: '{{ mssql_password }}' loop: "{{ [sql_server_svc_account, sql_server_agt_svc_account, cluster_svc_account] | unique }}" It fails with below error resource = Get-CimClass -ClassName $ClassName -Namespace root\Micros ... + CategoryInfo : ObjectNotFound: (root\Microsoft\...on:DSC_SqlLogin:String) [Get-CimClass], CimException + FullyQualifiedErrorId : HRESULT 0x80041002,Microsoft.Management.Infrastructure.CimCmdlets.GetCimClassCommand Please help to understand root cause and solution
Recent Blog Articles
No content to show