Showing with 2,016 additions and 1,444 deletions.
  1. +6 −0 .devcontainer/Dockerfile
  2. +23 −0 .devcontainer/devcontainer.json
  3. +4 −1 .fixtures.yml
  4. +81 −0 .github/workflows/auto_release.yml
  5. +81 −0 .github/workflows/release.yml
  6. +18 −0 .gitpod.Dockerfile
  7. +9 −0 .gitpod.yml
  8. +2 −0 .pdkignore
  9. +404 −18 .rubocop.yml
  10. +22 −35 .rubocop_todo.yml
  11. +11 −22 .sync.yml
  12. +8 −8 .travis.yml
  13. +1 −1 .vscode/extensions.json
  14. +23 −7 CHANGELOG.md
  15. +1 −1 CONTRIBUTING.md
  16. +8 −15 Gemfile
  17. +4 −4 HISTORY.md
  18. +1 −1 LICENSE
  19. +1 −1 README.md
  20. +435 −288 REFERENCE.md
  21. +9 −7 Rakefile
  22. +4 −10 appveyor.yml
  23. +1 −0 data/common.yaml
  24. +21 −0 hiera.yaml
  25. +2 −0 lib/facter/sqlserver_features.rb
  26. +2 −0 lib/facter/sqlserver_instances.rb
  27. +2 −0 lib/puppet/parser/functions/sqlserver_is_domain_or_local_user.rb
  28. +2 −0 lib/puppet/parser/functions/sqlserver_upcase.rb
  29. +2 −0 lib/puppet/parser/functions/sqlserver_validate_hash_uniq_values.rb
  30. +5 −3 lib/puppet/parser/functions/sqlserver_validate_instance_name.rb
  31. +3 −1 lib/puppet/parser/functions/sqlserver_validate_range.rb
  32. +3 −1 lib/puppet/parser/functions/sqlserver_validate_size.rb
  33. +4 −2 lib/puppet/property/sqlserver_login.rb
  34. +3 −0 lib/puppet/property/sqlserver_tsql.rb
  35. +7 −3 lib/puppet/provider/sqlserver.rb
  36. +3 −1 lib/puppet/provider/sqlserver_features/mssql.rb
  37. +5 −3 lib/puppet/provider/sqlserver_instance/mssql.rb
  38. +3 −2 lib/puppet/provider/sqlserver_tsql/mssql.rb
  39. +2 −0 lib/puppet/type/sqlserver_features.rb
  40. +6 −4 lib/puppet/type/sqlserver_instance.rb
  41. +8 −6 lib/puppet/type/sqlserver_tsql.rb
  42. +13 −11 lib/puppet_x/sqlserver/features.rb
  43. +5 −3 lib/puppet_x/sqlserver/server_helper.rb
  44. +90 −86 lib/puppet_x/sqlserver/sql_connection.rb
  45. +7 −7 metadata.json
  46. +31 −0 provision.yaml
  47. +0 −10 spec/acceptance/nodesets/centos-7-x64.yml
  48. +0 −10 spec/acceptance/nodesets/debian-8-x64.yml
  49. +0 −18 spec/acceptance/nodesets/default.yml
  50. +0 −12 spec/acceptance/nodesets/docker/centos-7.yml
  51. +0 −11 spec/acceptance/nodesets/docker/debian-8.yml
  52. +0 −12 spec/acceptance/nodesets/docker/ubuntu-14.04.yml
  53. +0 −24 spec/acceptance/nodesets/win_2012_sql2012.yml
  54. +0 −27 spec/acceptance/nodesets/win_2012_sql2012_future.yml
  55. +0 −24 spec/acceptance/nodesets/win_2012_sql2014.yml
  56. +0 −27 spec/acceptance/nodesets/win_2012_sql2014_future.yml
  57. +0 −24 spec/acceptance/nodesets/win_2012r2_sql2012.yml
  58. +0 −27 spec/acceptance/nodesets/win_2012r2_sql2012_future.yml
  59. +0 −24 spec/acceptance/nodesets/win_2012r2_sql2014.yml
  60. +0 −27 spec/acceptance/nodesets/win_2012r2_sql2014_future.yml
  61. +18 −28 spec/acceptance/sqlserver_config_spec.rb
  62. +36 −83 spec/acceptance/sqlserver_database_spec.rb
  63. +23 −48 spec/acceptance/sqlserver_instance_spec.rb
  64. +62 −78 spec/acceptance/sqlserver_login_spec.rb
  65. +24 −39 spec/acceptance/sqlserver_role_spec.rb
  66. +54 −37 spec/acceptance/sqlserver_tsql_spec.rb
  67. +23 −37 spec/acceptance/sqlserver_user_spec.rb
  68. +77 −122 spec/acceptance/z_last_sqlserver_features_spec.rb
  69. +2 −0 spec/defines/config_spec.rb
  70. +4 −2 spec/defines/database_spec.rb
  71. +4 −1 spec/defines/login/permissions_spec.rb
  72. +2 −0 spec/defines/login_spec.rb
  73. +2 −0 spec/defines/manifest_shared_examples.rb
  74. +15 −14 spec/defines/role/permissions_spec.rb
  75. +10 −8 spec/defines/role_spec.rb
  76. +2 −0 spec/defines/sp_configure_spec.rb
  77. +4 −1 spec/defines/user/permissions_spec.rb
  78. +3 −1 spec/defines/user_spec.rb
  79. +2 −0 spec/functions/functions_shared_examples.rb
  80. +2 −0 spec/functions/sqlserver_is_domain_user_spec.rb
  81. +2 −0 spec/functions/sqlserver_upcase_spec.rb
  82. +2 −0 spec/functions/sqlserver_validate_hash_uniq_values_spec.rb
  83. +2 −0 spec/functions/sqlserver_validate_instance_name_spec.rb
  84. +2 −0 spec/functions/sqlserver_validate_size_spec.rb
  85. +3 −0 spec/spec_helper.rb
  86. +4 −110 spec/spec_helper_acceptance.rb
  87. +219 −0 spec/spec_helper_acceptance_local.rb
  88. +3 −2 spec/sql_testing_helpers.rb
  89. +4 −2 spec/unit/puppet/property/tsql_spec.rb
  90. +2 −0 spec/unit/puppet/provider/sqlserver_features_spec.rb
  91. +2 −0 spec/unit/puppet/provider/sqlserver_instance_spec.rb
  92. +2 −0 spec/unit/puppet/provider/sqlserver_tsql_spec.rb
  93. +2 −0 spec/unit/puppet/sqlserver_install_context.rb
  94. +2 −0 spec/unit/puppet/sqlserver_spec_helper.rb
  95. +3 −1 spec/unit/puppet/type/sqlserver_features_spec.rb
  96. +3 −1 spec/unit/puppet/type/sqlserver_instance_spec.rb
  97. +2 −0 spec/unit/puppet_x/server_helper_spec.rb
  98. +2 −0 spec/unit/puppet_x/sql_connection_spec.rb
6 changes: 6 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM puppet/pdk:latest

# [Optional] Uncomment this section to install additional packages.
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
# && apt-get -y install --no-install-recommends <your-package-list-here>

23 changes: 23 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
// https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/puppet
{
"name": "Puppet Development Kit (Community)",
"dockerFile": "Dockerfile",

// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash"
},

// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"puppet.puppet-vscode",
"rebornix.Ruby"
]

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "pdk --version",
}
5 changes: 4 additions & 1 deletion .fixtures.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
fixtures:
repositories:
"stdlib": "https://github.com/puppetlabs/puppetlabs-stdlib.git"
facts: 'https://github.com/puppetlabs/puppetlabs-facts.git'
puppet_agent: 'https://github.com/puppetlabs/puppetlabs-puppet_agent.git'
provision: 'https://github.com/puppetlabs/provision.git'
stdlib: 'https://github.com/puppetlabs/puppetlabs-stdlib.git'
symlinks:
sqlserver: "#{source_dir}"
81 changes: 81 additions & 0 deletions .github/workflows/auto_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: "Auto release"

on:
schedule:
- cron: '0 3 * * 6'
workflow_dispatch:

env:
HONEYCOMB_WRITEKEY: 7f3c63a70eecc61d635917de46bea4e6
HONEYCOMB_DATASET: litmus tests
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
auto_release:
name: "Automatic release prep"
runs-on: ubuntu-20.04

steps:
- name: "Honeycomb: Start recording"
uses: puppetlabs/kvrhdn-gha-buildevents@pdk-templates-v1
with:
apikey: ${{ env.HONEYCOMB_WRITEKEY }}
dataset: ${{ env.HONEYCOMB_DATASET }}
job-status: ${{ job.status }}

- name: "Honeycomb: start first step"
run: |
echo STEP_ID="auto-release" >> $GITHUB_ENV
echo STEP_START=$(date +%s) >> $GITHUB_ENV
- name: "Checkout Source"
if: ${{ github.repository_owner == 'puppetlabs' }}
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false

- name: "PDK Release prep"
uses: docker://puppet/pdk:nightly
with:
args: 'release prep --force'
env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: "Get Version"
if: ${{ github.repository_owner == 'puppetlabs' }}
id: gv
run: |
echo "::set-output name=ver::$(jq --raw-output .version metadata.json)"
- name: "Commit changes"
if: ${{ github.repository_owner == 'puppetlabs' }}
run: |
git config --local user.email "${{ github.repository_owner }}@users.noreply.github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "Release prep v${{ steps.gv.outputs.ver }}"
- name: Create Pull Request
id: cpr
uses: puppetlabs/peter-evans-create-pull-request@v3
if: ${{ github.repository_owner == 'puppetlabs' }}
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "Release prep v${{ steps.gv.outputs.ver }}"
branch: "release-prep"
delete-branch: true
title: "Release prep v${{ steps.gv.outputs.ver }}"
body: "Automated release-prep through [pdk-templates](https://github.com/puppetlabs/pdk-templates/blob/main/moduleroot/.github/workflows/auto_release.yml.erb) from commit ${{ github.sha }}"
labels: "maintenance"

- name: PR outputs
if: ${{ github.repository_owner == 'puppetlabs' }}
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
- name: "Honeycomb: Record finish step"
if: ${{ always() }}
run: |
buildevents step $TRACE_ID $STEP_ID $STEP_START 'Finished auto release workflow'
81 changes: 81 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@

name: "release"

on:
push:
branches:
- 'release'

jobs:
LitmusAcceptance2012Sql:
runs-on: self-hosted
strategy:
matrix:
ruby_version: [2.5.x]
puppet_gem_version: [~> 6.0]
platform: [release_checks_sql_2012]
agent_family: ['puppet5', 'puppet6']

steps:
- uses: actions/checkout@v1
- name: Litmus Parallel
uses: puppetlabs/action-litmus_parallel@main
with:
platform: ${{ matrix.platform }}
agent_family: ${{ matrix.agent_family }}
additional_command: ${{ matrix.additional_command }}
LitmusAcceptance2014Sql:
runs-on: self-hosted
strategy:
matrix:
ruby_version: [2.5.x]
puppet_gem_version: [~> 6.0]
platform: [release_checks_sql_2014]
agent_family: ['puppet5', 'puppet6']

steps:
- uses: actions/checkout@v1
- name: Litmus Parallel
uses: puppetlabs/action-litmus_parallel@main
with:
platform: ${{ matrix.platform }}
agent_family: ${{ matrix.agent_family }}
additional_command: ${{ matrix.additional_command }}
LitmusAcceptance2016Sql:
runs-on: self-hosted
strategy:
matrix:
ruby_version: [2.5.x]
puppet_gem_version: [~> 6.0]
platform: [release_checks_sql_2016_parity]
agent_family: ['puppet5', 'puppet6']
additional_command: ['bundle exec rake litmus:add_feature[sqlversion_2016]']

steps:
- uses: actions/checkout@v1
- name: Litmus Parallel
uses: puppetlabs/action-litmus_parallel@main
with:
platform: ${{ matrix.platform }}
agent_family: ${{ matrix.agent_family }}
additional_command: ${{ matrix.additional_command }}

Spec:
runs-on: self-hosted
strategy:
matrix:
check: [parallel_spec, 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop']
ruby_version: [2.5.x]
puppet_gem_version: [~> 5.0, ~> 6.0]
exclude:
- puppet_gem_version: ~> 5.0
check: 'syntax lint metadata_lint check:symlinks check:git_ignore check:dot_underscore check:test_file rubocop'
- ruby_version: 2.5.x
puppet_gem_version: ~> 5.0
steps:
- uses: actions/checkout@v1
- name: Spec Tests
uses: puppetlabs/action-litmus_spec@main
with:
puppet_gem_version: ${{ matrix.puppet_gem_version }}
check: ${{ matrix.check }}
18 changes: 18 additions & 0 deletions .gitpod.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM gitpod/workspace-full
RUN sudo wget https://apt.puppet.com/puppet-tools-release-bionic.deb && \
wget https://apt.puppetlabs.com/puppet6-release-bionic.deb && \
sudo dpkg -i puppet6-release-bionic.deb && \
sudo dpkg -i puppet-tools-release-bionic.deb && \
sudo apt-get update && \
sudo apt-get install -y pdk zsh puppet-agent && \
sudo apt-get clean && \
sudo rm -rf /var/lib/apt/lists/*
RUN sudo usermod -s $(which zsh) gitpod && \
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" && \
echo "plugins=(git gitignore github gem pip bundler python ruby docker docker-compose)" >> /home/gitpod/.zshrc && \
echo 'PATH="$PATH:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/opt/puppetlabs/bin:/opt/puppetlabs/puppet/bin"' >> /home/gitpod/.zshrc && \
sudo /opt/puppetlabs/puppet/bin/gem install puppet-debugger hub -N && \
mkdir -p /home/gitpod/.config/puppet && \
/opt/puppetlabs/puppet/bin/ruby -r yaml -e "puts ({'disabled' => true}).to_yaml" > /home/gitpod/.config/puppet/analytics.yml
RUN rm -f puppet6-release-bionic.deb puppet-tools-release-bionic.deb
ENTRYPOINT /usr/bin/zsh
9 changes: 9 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
image:
file: .gitpod.Dockerfile

tasks:
- init: pdk bundle install

vscode:
extensions:
- puppet.puppet-vscode@1.0.0:oSzfTkDf6Cmc1jOjgW33VA==
2 changes: 2 additions & 0 deletions .pdkignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
/.gitignore
/.gitlab-ci.yml
/.pdkignore
/.puppet-lint.rc
/Rakefile
/rakelib/
/.rspec
Expand All @@ -40,3 +41,4 @@
/.yardopts
/spec/
/.vscode/
/.sync.yml
Loading