Uploaded image for project: 'Modules'
  1. Modules
  2. MODULES-3256

sqlserver::login create|delete/login.sql.erb not working with AD logins

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • sqlserver
    • Hide

      Re-running login creations with WINDOWS_LOGIN type should work and no longer generate SQL that causes errors like: "The server principal 'mydomain\foo' already exists."

      Acceptance test to validate fix.

      Show
      Re-running login creations with WINDOWS_LOGIN type should work and no longer generate SQL that causes errors like: "The server principal 'mydomain\foo' already exists." Acceptance test to validate fix.
    • 3
    • Windows 2016-08-24
    • Reviewed

    Description

      When using WINDOWS_LOGIN, the login.sql.erb templates are incorrectly checking the sys.sql_logins table instead of sys.server_principals.

      Example manifest snippet (NOTE: the '//' in the first line is actually a pair of back-slashes but Jira doesn't like that for somereason):

        sqlserver::login{ "mydomain//foo":
          instance => 'MSSQLSERVER',
          login_type => 'WINDOWS_LOGIN',
          ensure     => 'present',
          svrroles   => { 'sysadmin' => 1, 'serveradmin' => 0, 'processadmin' => 0, 'setupadmin' => 0, 'bulkadmin' => 0, 'diskadmin' => 0, 'dbcreator' => 0, },
          require    => Sqlserver::Database['bar'],
        }
      

      Unfortunately, the error is chomped by Puppet agent runs, but if you copy the generated SQL from such a config into MSSQL Studio you will find the following error on all but the first run:
      The server principal 'mydomain\foo' already exists.

      Attachments

        Issue Links

          Activity

            People

              erick Erick Banks
              esmalling Eric Smalling
              Votes:
              1 Vote for this issue
              Watchers:
              8 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Zendesk Support