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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: sqlserver
    • Labels:
    • Template:
    • Acceptance Criteria:
      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.
    • Epic Link:
    • Story Points:
      3
    • Sprint:
      Windows 2016-08-24
    • CS Priority:
      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

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

                Dates

                Created:
                Updated:
                Resolved:

                  Zendesk Support