onceover 3.21.0 → 3.22.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (139) hide show
  1. checksums.yaml +4 -4
  2. data/.devcontainer/devcontainer.json +4 -6
  3. data/.github/workflows/release.yaml +24 -0
  4. data/Gemfile +3 -0
  5. data/README.md +45 -1
  6. data/Rakefile +1 -0
  7. data/cucumber.yml +1 -0
  8. data/features/step_definitions/run.rb +4 -0
  9. data/features/zzz_run.feature +1 -8
  10. data/lib/onceover/beaker/spec_helper.rb +8 -8
  11. data/lib/onceover/controlrepo.rb +3 -3
  12. data/lib/onceover/deploy.rb +1 -1
  13. data/lib/onceover/rspec/formatters.rb +2 -4
  14. data/lib/onceover/runner.rb +1 -1
  15. data/lib/onceover/test.rb +1 -1
  16. data/onceover.gemspec +6 -13
  17. data/spec/fixtures/controlrepos/puppet_controlrepo/.atom-build.json +9 -0
  18. data/spec/fixtures/controlrepos/puppet_controlrepo/.gitignore +5 -0
  19. data/spec/fixtures/controlrepos/puppet_controlrepo/.ruby-version +1 -0
  20. data/spec/fixtures/controlrepos/puppet_controlrepo/.travis.yml +13 -0
  21. data/spec/fixtures/controlrepos/puppet_controlrepo/Gemfile +22 -0
  22. data/spec/fixtures/controlrepos/puppet_controlrepo/Jenkinsfile +50 -0
  23. data/spec/fixtures/controlrepos/puppet_controlrepo/Puppetfile +102 -0
  24. data/spec/fixtures/controlrepos/puppet_controlrepo/README.md +4 -0
  25. data/spec/fixtures/controlrepos/puppet_controlrepo/Rakefile +6 -0
  26. data/spec/fixtures/controlrepos/puppet_controlrepo/data/common.yaml +558 -0
  27. data/spec/fixtures/controlrepos/puppet_controlrepo/data/datacenter/melbourne.yaml +12 -0
  28. data/spec/fixtures/controlrepos/puppet_controlrepo/data/datacenter/singapore.yaml +12 -0
  29. data/spec/fixtures/controlrepos/puppet_controlrepo/data/environments/development.yaml +3 -0
  30. data/spec/fixtures/controlrepos/puppet_controlrepo/data/environments/production.yaml +3 -0
  31. data/spec/fixtures/controlrepos/puppet_controlrepo/data/size/vol.large.yaml +27 -0
  32. data/spec/fixtures/controlrepos/puppet_controlrepo/environment.conf +3 -0
  33. data/spec/fixtures/controlrepos/puppet_controlrepo/hiera.yaml +25 -0
  34. data/spec/fixtures/controlrepos/puppet_controlrepo/manifests/site.pp +11 -0
  35. data/spec/fixtures/controlrepos/puppet_controlrepo/scripts/code_manager_config_version.rb +19 -0
  36. data/spec/fixtures/controlrepos/puppet_controlrepo/scripts/config_version.rb +25 -0
  37. data/spec/fixtures/controlrepos/puppet_controlrepo/scripts/config_version.sh +12 -0
  38. data/spec/fixtures/controlrepos/puppet_controlrepo/scripts/count_changed_classes.rb +26 -0
  39. data/spec/fixtures/controlrepos/puppet_controlrepo/scripts/get_changed_classes.rb +26 -0
  40. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/console/functions/user/token.pp +10 -0
  41. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/console/manifests/init.pp +14 -0
  42. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/console/manifests/user.pp +35 -0
  43. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/deployments/lib/puppet/functions/deployments/generate.rb +15 -0
  44. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/deployments/plans/signed_deployment.pp +126 -0
  45. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/facts.d/test.sh +2 -0
  46. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/files/artifactory/config_descriptor.xml +265 -0
  47. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/files/autosign.sh +23 -0
  48. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/files/hudson.tasks.Shell.xml +4 -0
  49. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/files/motd +4 -0
  50. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/files/polar_clock/index.html +198 -0
  51. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/apt.pp +9 -0
  52. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/aws_nodes.pp +54 -0
  53. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/base/aws.pp +9 -0
  54. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/base/rhel.pp +50 -0
  55. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/base/windows/hardening.pp +57 -0
  56. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/base/windows.pp +52 -0
  57. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/base.pp +79 -0
  58. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/cd4pe/artifactory.pp +64 -0
  59. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/cd4pe/connection.pp +95 -0
  60. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/cd4pe/haproxy.pp +65 -0
  61. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/cd4pe/replicated.pp +53 -0
  62. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/compile/balancer.pp +28 -0
  63. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/compile/master.pp +19 -0
  64. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/dns/host_record.pp +16 -0
  65. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/dns/server.pp +66 -0
  66. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/docker.pp +5 -0
  67. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/eyeunify/base.pp +43 -0
  68. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/eyeunify/core/database_connection.pp +42 -0
  69. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/eyeunify/core.pp +72 -0
  70. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/eyeunify/ctrl.pp +57 -0
  71. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/eyeunify/database.pp +32 -0
  72. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/eyeunify/exec.pp +11 -0
  73. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/file_sync/client.pp +165 -0
  74. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/file_sync/master_patch.pp +37 -0
  75. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/grafana/dashboard.pp +17 -0
  76. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/haproxy.pp +43 -0
  77. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/init.pp +3 -0
  78. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/jenkins/plugins.pp +87 -0
  79. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/jenkins.pp +65 -0
  80. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/jira/aio.pp +39 -0
  81. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/jira/app.pp +27 -0
  82. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/jira/db.pp +25 -0
  83. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/metrics/collectd/compile.pp +82 -0
  84. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/metrics/collectd.pp +28 -0
  85. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/metrics/dashboard.pp +28 -0
  86. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/mysql_server.pp +7 -0
  87. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/nginx.pp +24 -0
  88. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/polar_clock.pp +55 -0
  89. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/puppetmaster/api_auth.pp +82 -0
  90. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/puppetmaster/autosign.pp +33 -0
  91. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/puppetmaster/aws.pp +58 -0
  92. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/puppetmaster/tuning.pp +139 -0
  93. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/puppetmaster.pp +139 -0
  94. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/rvm.pp +13 -0
  95. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/sumologic.pp +11 -0
  96. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/sunburst/windows.pp +104 -0
  97. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/vagrant.pp +25 -0
  98. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/manifests/windows/webserver.pp +27 -0
  99. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/templates/cd4pe/connection_script.sh.epp +110 -0
  100. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/templates/controlrepo_deploy_jenkins_job.xml.epp +51 -0
  101. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/templates/dashboard.json.epp +403 -0
  102. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/templates/jenkins_secret_text.json.epp +1 -0
  103. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/templates/onceover_jenkins_job.xml.epp +51 -0
  104. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/profile/templates/userdata.epp +17 -0
  105. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/cd4pe.pp +29 -0
  106. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/clock.pp +16 -0
  107. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/compile/balancer.pp +5 -0
  108. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/compile/master.pp +5 -0
  109. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/eyeunify/aio.pp +10 -0
  110. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/eyeunify/controller.pp +10 -0
  111. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/eyeunify/database.pp +7 -0
  112. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/eyeunify/exec.pp +6 -0
  113. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/init.pp +3 -0
  114. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/lb.pp +14 -0
  115. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/metrics.pp +5 -0
  116. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/mysql.pp +13 -0
  117. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/windows/base.pp +5 -0
  118. data/spec/fixtures/controlrepos/puppet_controlrepo/site-modules/role/manifests/windows/webserver.pp +6 -0
  119. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/.gitignore +5 -0
  120. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/acceptance/nodesets/onceover-nodes.yml +94 -0
  121. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/classes/test_spec.rb +8 -0
  122. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/factsets/CentOS-7.0-64-master-2017.3.2.json +531 -0
  123. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/factsets/CentOS-7.0-64-master.json +429 -0
  124. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/factsets/CentOS-7.0-64.json +353 -0
  125. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/factsets/Windows_Server-2008r2-64.json +184 -0
  126. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/factsets/Windows_Server-2012r2-64.json +165 -0
  127. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/hiera.yaml +18 -0
  128. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/matchers/file_matchers.rb +16 -0
  129. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/onceover.yaml +54 -0
  130. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/pre_conditions/site.pp +150 -0
  131. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/r10k.yaml +2 -0
  132. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/shared_examples/helper.rb +91 -0
  133. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/unit/00_parse_spec.rb +76 -0
  134. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/unit/01_linting_spec_example.rb +69 -0
  135. data/spec/fixtures/controlrepos/puppet_controlrepo/spec/unit/03_puppetfile_spec_example.rb +35 -0
  136. data/templates/spec_helper.rb.erb +0 -2
  137. data/templates/test_spec.rb.erb +3 -0
  138. metadata +137 -79
  139. data/.gitmodules +0 -4
@@ -0,0 +1,27 @@
1
+ #
2
+ class profile::windows::webserver {
3
+ # Install the IIS role
4
+ dsc_windowsfeature { 'IIS':
5
+ dsc_ensure => 'present',
6
+ dsc_name => 'Web-Server',
7
+ }
8
+
9
+ dsc_windowsfeature { 'IIS Console':
10
+ dsc_ensure => 'present',
11
+ dsc_name => 'Web-Mgmt-Console',
12
+ }
13
+
14
+ # Install the ASP .NET 4.5 role
15
+ dsc_windowsfeature { 'AspNet45':
16
+ dsc_ensure => 'present',
17
+ dsc_name => 'Web-Asp-Net45',
18
+ }
19
+
20
+ # Stop an existing website (set up in Sample_xWebsite_Default)
21
+ dsc_xwebsite { 'Stop DefaultSite':
22
+ dsc_ensure => 'present',
23
+ dsc_name => 'Default Web Site',
24
+ dsc_state => 'Stopped',
25
+ require => Dsc_windowsfeature['IIS','AspNet45'],
26
+ }
27
+ }
@@ -0,0 +1,110 @@
1
+ #!/bin/bash
2
+
3
+ # This script attempts to handle all the CD4PE setup steps described here:
4
+ # https://confluence.puppetlabs.com/pages/viewpage.action?pageId=169839939
5
+ #
6
+ #
7
+ # A few assumptions are made:
8
+ #
9
+ # 1) Setup was performed via install_docker.sh and docker_compose.yaml
10
+ # 2) Script is run locally from the node hosting all the containers
11
+ # 2) A valid license.json file exists at the same location as this script
12
+ # 3) Manual setup of the admin user and generic-local repo in Artifactory have been completed
13
+
14
+ ARTIFACTORY_USER=<%= $artifactory_user %>
15
+ ARTIFACTORY_PASSWORD=<%= $artifactory_password %>
16
+ ARTIFACTORY_ENDPOINT=<%= $artifactory_endpoint %>
17
+
18
+ CD4PE_ENDPOINT=<%= $cd4pe_endpoint %>
19
+ CD4PE_ROOT_LOGIN=<%= $cd4pe_root_login %>
20
+ CD4PE_ROOT_PW=<%= $cd4pe_root_pw %>
21
+ CD4PE_DUMP=<%= $cd4pe_dump %>
22
+ CD4PE_BACKEND=<%= $cd4pe_backend %>
23
+
24
+ #This is how the cd4pe container resolves artifactory
25
+ DOCKER_ARTIFACTORY=<%= $artifactory_endpoint %>
26
+
27
+
28
+ # Tools for this script to work
29
+ if ! [ -x "$(command -v jq)" ]; then
30
+ yum install -y wget
31
+ wget -O jq https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64
32
+ chmod +x ./jq
33
+ cp jq /usr/bin
34
+ fi
35
+
36
+ ## Create the generic-local repo
37
+ ## Unfortunately creating a repo requires Artifactory Pro.. otherwise this would work
38
+ # payload='{"key":"generic-local", "rclass":"local", "packageType":"generic"}'
39
+ #
40
+ #curl -X PUT "http://${ARTIFACTORY_ENDPOINT}/artifactory/api/repositories/generic-local" -H "content-type:application/json" -d "${payload}"
41
+ #
42
+
43
+ ## Create the API token in Artifactory
44
+ echo 'Creating Artifactory API token'
45
+ data=$(curl -s "http://${ARTIFACTORY_ENDPOINT}/artifactory/api/security/apiKey" -u ${ARTIFACTORY_USER}:${ARTIFACTORY_PASSWORD})
46
+
47
+ if [ $data == '{}' ]
48
+ then
49
+ data=$(curl -s -X POST "http://${ARTIFACTORY_ENDPOINT}/artifactory/api/security/apiKey" -u ${ARTIFACTORY_USER}:${ARTIFACTORY_PASSWORD})
50
+ fi
51
+
52
+ ARTIFACTORY_API_KEY=$(echo ${data} | jq -r .apiKey)
53
+ echo "Artifactory Key: ${ARTIFACTORY_API_KEY}"
54
+
55
+ #Step 1:Create the root account for CD4PE
56
+ echo 'Creating root account'
57
+ payload=$(cat << EOF
58
+ {
59
+ "op": "CreateRootAccount",
60
+ "content": {"email":"${CD4PE_ROOT_LOGIN}", "passwd":"${CD4PE_ROOT_PW}"}
61
+ }
62
+ EOF
63
+ )
64
+ echo curl -X POST "http://${CD4PE_ENDPOINT}/root-account" -H 'Content-Type: application/json' -d "${payload}"
65
+ curl -X POST "http://${CD4PE_ENDPOINT}/root-account" -H 'Content-Type: application/json' -d "${payload}"
66
+ echo ' '
67
+
68
+ #Quick dirty way to get a cookie - this could def be improved
69
+ cookie=$(curl -X POST http://localhost:8080/login -H 'Content-Type: application/json' -d '{"op":"PfiLogin","content":{"email":"<%= $cd4pe_root_login %>","passwd":"<%= $cd4pe_root_pw %>"}}' -v > out.txt 2>&1 ; cat out.txt | awk -F= '/Set-Cookie:/ { print $2; exit }')
70
+ echo "Cookie: ${cookie}"
71
+
72
+
73
+ #Step 2: Endpoint setup
74
+ echo 'Setting up endpoints'
75
+ payload=$(cat << EOF
76
+ { "op":"SaveEndpointSettings",
77
+ "content": {"setting": {
78
+ "webUIEndpoint":"http://${CD4PE_ENDPOINT}",
79
+ "backendServiceEndpoint":"http://${CD4PE_BACKEND}",
80
+ "agentServiceEndpoint":"dump://${CD4PE_DUMP}"}
81
+ }
82
+ }
83
+ EOF
84
+ )
85
+ curl -X POST "http://${CD4PE_ENDPOINT}/root/endpoint-settings" -H 'Content-Type: application/json' -H "Cookie:com.puppet.pipelines.pfi.sid=${cookie}" -d "${payload}"
86
+ echo ' '
87
+
88
+ #Step 3: Artifactory Storage Setup
89
+ echo 'Setting up Artifactory storage'
90
+ payload=$(cat << EOF
91
+ { "op":"SaveStorageSettings",
92
+ "content": {"setting" : {
93
+ "osType":"ARTIFACTORY",
94
+ "osEndpoint":"http://${DOCKER_ARTIFACTORY}/artifactory",
95
+ "osCredKey":"",
96
+ "osCredSecret":"${ARTIFACTORY_API_KEY}",
97
+ "osBucket":"generic-local",
98
+ "osDiskRoot":"",
99
+ "osPathPrefix":""
100
+ }}
101
+ }
102
+ EOF
103
+ )
104
+ curl -X POST "http://${CD4PE_ENDPOINT}/root/storage-settings" -H 'Content-Type: application/json' -H "Cookie:com.puppet.pipelines.pfi.sid=${cookie}" -d "${payload}"
105
+ echo ' '
106
+
107
+ #Step 4: Upload the license
108
+ echo 'Uploading License'
109
+ jq --slurpfile content license.json -n '{op:"SavePfiLicense",content:$content[0]}' | curl -X POST "http://${CD4PE_ENDPOINT}/root/license" -H 'Content-Type: application/json' -H "Cookie:com.puppet.pipelines.pfi.sid=${cookie}" -d @- | jq
110
+ echo ' '
@@ -0,0 +1,51 @@
1
+ <?xml version='1.0' encoding='UTF-8'?>
2
+ <org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject plugin="workflow-multibranch@2.9.2">
3
+ <actions/>
4
+ <description></description>
5
+ <properties/>
6
+ <folderViews class="com.cloudbees.hudson.plugins.folder.views.DefaultFolderViewHolder" plugin="cloudbees-folder@5.15">
7
+ <views>
8
+ <hudson.model.AllView>
9
+ <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../../../.."/>
10
+ <name>All</name>
11
+ <filterExecutors>false</filterExecutors>
12
+ <filterQueue>false</filterQueue>
13
+ <properties class="hudson.model.View$PropertyList"/>
14
+ </hudson.model.AllView>
15
+ </views>
16
+ <tabBar class="hudson.views.DefaultViewsTabBar"/>
17
+ </folderViews>
18
+ <healthMetrics>
19
+ <com.cloudbees.hudson.plugins.folder.health.WorstChildHealthMetric plugin="cloudbees-folder@5.15">
20
+ <nonRecursive>false</nonRecursive>
21
+ </com.cloudbees.hudson.plugins.folder.health.WorstChildHealthMetric>
22
+ </healthMetrics>
23
+ <icon class="com.cloudbees.hudson.plugins.folder.icons.StockFolderIcon" plugin="cloudbees-folder@5.15"/>
24
+ <orphanedItemStrategy class="com.cloudbees.hudson.plugins.folder.computed.DefaultOrphanedItemStrategy" plugin="cloudbees-folder@5.15">
25
+ <pruneDeadBranches>true</pruneDeadBranches>
26
+ <daysToKeep>0</daysToKeep>
27
+ <numToKeep>0</numToKeep>
28
+ </orphanedItemStrategy>
29
+ <triggers/>
30
+ <sources class="jenkins.branch.MultiBranchProject$BranchSourceList" plugin="branch-api@1.11.1">
31
+ <data>
32
+ <jenkins.branch.BranchSource>
33
+ <source class="jenkins.plugins.git.GitSCMSource" plugin="git@3.0.1">
34
+ <id>5bb922bd-a78e-4e16-8a31-37cda0a8acd0</id>
35
+ <remote>https://github.com/dylanratcliffe/puppet_controlrepo</remote>
36
+ <credentialsId></credentialsId>
37
+ <includes>**</includes>
38
+ <excludes></excludes>
39
+ <ignoreOnPushNotifications>false</ignoreOnPushNotifications>
40
+ </source>
41
+ <strategy class="jenkins.branch.DefaultBranchPropertyStrategy">
42
+ <properties class="empty-list"/>
43
+ </strategy>
44
+ </jenkins.branch.BranchSource>
45
+ </data>
46
+ <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
47
+ </sources>
48
+ <factory class="org.jenkinsci.plugins.workflow.multibranch.WorkflowBranchProjectFactory">
49
+ <owner class="org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject" reference="../.."/>
50
+ </factory>
51
+ </org.jenkinsci.plugins.workflow.multibranch.WorkflowMultiBranchProject>
@@ -0,0 +1,403 @@
1
+ {
2
+ "id": null,
3
+ "title": "Puppet Metrics",
4
+ "originalTitle": "master",
5
+ "tags": [],
6
+ "style": "dark",
7
+ "timezone": "browser",
8
+ "editable": true,
9
+ "hideControls": false,
10
+ "sharedCrosshair": false,
11
+ "rows": [
12
+ {
13
+ "title": "Puppet Master Requests",
14
+ "height": "300px",
15
+ "editable": true,
16
+ "collapse": false,
17
+ "collapsable": true,
18
+ "panels": [
19
+ {
20
+ "span": 4,
21
+ "editable": true,
22
+ "type": "graph",
23
+ "loadingEditor": false,
24
+ "datasource": null,
25
+ "renderer": "flot",
26
+ "x-axis": true,
27
+ "y-axis": true,
28
+ "scale": 1,
29
+ "y_formats": [
30
+ "short",
31
+ "short"
32
+ ],
33
+ "grid": {
34
+ "max": null,
35
+ "min": null,
36
+ "threshold1": null,
37
+ "threshold2": null,
38
+ "threshold1Color": "rgba(216, 200, 27, 0.27)",
39
+ "threshold2Color": "rgba(234, 112, 112, 0.22)",
40
+ "leftMax": null,
41
+ "rightMax": null,
42
+ "leftMin": null,
43
+ "rightMin": null
44
+ },
45
+ "annotate": {
46
+ "enable": false
47
+ },
48
+ "resolution": 100,
49
+ "lines": true,
50
+ "fill": 0,
51
+ "linewidth": 1,
52
+ "points": false,
53
+ "pointradius": 5,
54
+ "bars": false,
55
+ "stack": false,
56
+ "legend": {
57
+ "show": true,
58
+ "values": false,
59
+ "min": false,
60
+ "max": false,
61
+ "current": false,
62
+ "total": false,
63
+ "avg": false
64
+ },
65
+ "percentage": false,
66
+ "zerofill": true,
67
+ "nullPointMode": "connected",
68
+ "steppedLine": false,
69
+ "tooltip": {
70
+ "value_type": "cumulative",
71
+ "query_as_alias": true,
72
+ "shared": false
73
+ },
74
+ "targets": [
75
+ {
76
+ "target": "alias(puppetlabs.<%= $server_id %>.http.active-requests.count, 'Current Active Requests')"
77
+ },
78
+ {
79
+ "target": "alias(puppetlabs.<%= $server_id %>.http.active-histo.mean, 'Average Active Requests')"
80
+ },
81
+ {
82
+ "target": "alias(puppetlabs.<%= $server_id %>.jruby.num-jrubies, 'Num jRubies')"
83
+ },
84
+ {
85
+ "target": "alias(puppetlabs.<%= $server_id %>.jruby.num-free-jrubies, 'Num Free jRubies')"
86
+ }
87
+ ],
88
+ "aliasColors": {},
89
+ "title": "Active Requests",
90
+ "id": 1,
91
+ "seriesOverrides": [],
92
+ "links": []
93
+ },
94
+ {
95
+ "title": "PuppetDB",
96
+ "error": false,
97
+ "span": 4,
98
+ "editable": true,
99
+ "type": "graph",
100
+ "id": 2,
101
+ "datasource": null,
102
+ "renderer": "flot",
103
+ "x-axis": true,
104
+ "y-axis": true,
105
+ "y_formats": [
106
+ "short",
107
+ "short"
108
+ ],
109
+ "grid": {
110
+ "leftMax": null,
111
+ "rightMax": null,
112
+ "leftMin": null,
113
+ "rightMin": null,
114
+ "threshold1": null,
115
+ "threshold2": null,
116
+ "threshold1Color": "rgba(216, 200, 27, 0.27)",
117
+ "threshold2Color": "rgba(234, 112, 112, 0.22)"
118
+ },
119
+ "lines": true,
120
+ "fill": 1,
121
+ "linewidth": 1,
122
+ "points": false,
123
+ "pointradius": 1,
124
+ "bars": false,
125
+ "stack": false,
126
+ "percentage": false,
127
+ "legend": {
128
+ "show": true,
129
+ "values": false,
130
+ "min": false,
131
+ "max": false,
132
+ "current": false,
133
+ "total": false,
134
+ "avg": false
135
+ },
136
+ "nullPointMode": "connected",
137
+ "steppedLine": false,
138
+ "tooltip": {
139
+ "value_type": "cumulative",
140
+ "shared": false
141
+ },
142
+ "targets": [
143
+ {
144
+ "target": "alias(diffSeries(puppetlabs.<%= $server_id %>.puppetdb.count, timeShift(puppetlabs.<%= $server_id %>.puppetdb.count, '1m')), 'Requests/min')"
145
+ }
146
+ ],
147
+ "aliasColors": {},
148
+ "seriesOverrides": [],
149
+ "links": [],
150
+ "maxDataPoints": "",
151
+ "cacheTimeout": "60"
152
+ }
153
+ ],
154
+ "notice": false
155
+ },
156
+ {
157
+ "title": "Catalog Compilation",
158
+ "height": "300px",
159
+ "editable": true,
160
+ "collapse": false,
161
+ "collapsable": true,
162
+ "panels": [
163
+ {
164
+ "title": "CPU",
165
+ "error": false,
166
+ "span": 4,
167
+ "editable": true,
168
+ "type": "graph",
169
+ "id": 3,
170
+ "datasource": null,
171
+ "renderer": "flot",
172
+ "x-axis": true,
173
+ "y-axis": true,
174
+ "y_formats": [
175
+ "short",
176
+ "short"
177
+ ],
178
+ "grid": {
179
+ "leftMax": 100,
180
+ "rightMax": null,
181
+ "leftMin": 0,
182
+ "rightMin": null,
183
+ "threshold1": null,
184
+ "threshold2": null,
185
+ "threshold1Color": "rgba(216, 200, 27, 0.27)",
186
+ "threshold2Color": "rgba(234, 112, 112, 0.22)"
187
+ },
188
+ "lines": true,
189
+ "fill": 0,
190
+ "linewidth": 1,
191
+ "points": false,
192
+ "pointradius": 5,
193
+ "bars": false,
194
+ "stack": false,
195
+ "percentage": false,
196
+ "legend": {
197
+ "show": true,
198
+ "values": false,
199
+ "min": false,
200
+ "max": false,
201
+ "current": false,
202
+ "total": false,
203
+ "avg": false
204
+ },
205
+ "nullPointMode": "connected",
206
+ "steppedLine": false,
207
+ "tooltip": {
208
+ "value_type": "cumulative",
209
+ "shared": false
210
+ },
211
+ "targets": [
212
+ {
213
+ "target": "aliasByNode(scale(offset(<%= $collectd_id %>.cpu-[0-9].cpu-idle, -100), -1), 1)"
214
+ }
215
+ ],
216
+ "aliasColors": {},
217
+ "seriesOverrides": [],
218
+ "links": [],
219
+ "leftYAxisLabel": "CPU %"
220
+ },
221
+ {
222
+ "title": "Memory",
223
+ "error": false,
224
+ "span": 4,
225
+ "editable": true,
226
+ "type": "graph",
227
+ "id": 4,
228
+ "datasource": null,
229
+ "renderer": "flot",
230
+ "x-axis": true,
231
+ "y-axis": true,
232
+ "y_formats": [
233
+ "bytes",
234
+ "short"
235
+ ],
236
+ "grid": {
237
+ "leftMax": null,
238
+ "rightMax": null,
239
+ "leftMin": 0,
240
+ "rightMin": null,
241
+ "threshold1": null,
242
+ "threshold2": null,
243
+ "threshold1Color": "rgba(216, 200, 27, 0.27)",
244
+ "threshold2Color": "rgba(234, 112, 112, 0.22)"
245
+ },
246
+ "lines": true,
247
+ "fill": 1,
248
+ "linewidth": 2,
249
+ "points": false,
250
+ "pointradius": 5,
251
+ "bars": false,
252
+ "stack": true,
253
+ "percentage": false,
254
+ "legend": {
255
+ "show": true,
256
+ "values": false,
257
+ "min": false,
258
+ "max": false,
259
+ "current": false,
260
+ "total": false,
261
+ "avg": false
262
+ },
263
+ "nullPointMode": "connected",
264
+ "steppedLine": false,
265
+ "tooltip": {
266
+ "value_type": "cumulative",
267
+ "shared": false
268
+ },
269
+ "targets": [
270
+ {
271
+ "target": "alias(<%= $collectd_id %>.memory.memory-used, 'Memory Used')"
272
+ },
273
+ {
274
+ "target": "alias(<%= $collectd_id %>.memory.memory-cached, 'Memory Cached')"
275
+ },
276
+ {
277
+ "target": "alias(<%= $collectd_id %>.memory.memory-buffered, 'Memory Buffered')"
278
+ },
279
+ {
280
+ "target": "alias(<%= $collectd_id %>.memory.memory-free, 'Memory Free')"
281
+ }
282
+ ],
283
+ "aliasColors": {},
284
+ "seriesOverrides": [],
285
+ "links": [],
286
+ "leftYAxisLabel": ""
287
+ },
288
+ {
289
+ "title": "Disk",
290
+ "error": false,
291
+ "span": 4,
292
+ "editable": true,
293
+ "type": "graph",
294
+ "id": 5,
295
+ "datasource": null,
296
+ "renderer": "flot",
297
+ "x-axis": true,
298
+ "y-axis": true,
299
+ "y_formats": [
300
+ "percent",
301
+ "short"
302
+ ],
303
+ "grid": {
304
+ "leftMax": 100,
305
+ "rightMax": null,
306
+ "leftMin": 0,
307
+ "rightMin": null,
308
+ "threshold1": null,
309
+ "threshold2": null,
310
+ "threshold1Color": "rgba(216, 200, 27, 0.27)",
311
+ "threshold2Color": "rgba(234, 112, 112, 0.22)"
312
+ },
313
+ "lines": true,
314
+ "fill": 2,
315
+ "linewidth": 2,
316
+ "points": false,
317
+ "pointradius": 5,
318
+ "bars": false,
319
+ "stack": false,
320
+ "percentage": false,
321
+ "legend": {
322
+ "show": true,
323
+ "values": false,
324
+ "min": false,
325
+ "max": false,
326
+ "current": false,
327
+ "total": false,
328
+ "avg": false
329
+ },
330
+ "nullPointMode": "connected",
331
+ "steppedLine": false,
332
+ "tooltip": {
333
+ "value_type": "cumulative",
334
+ "shared": false
335
+ },
336
+ "targets": [
337
+ {
338
+ "target": "alias(asPercent(<%= $collectd_id %>.df-root.df_complex-used, sumSeries(<%= $collectd_id %>.df-root.df_complex-free, <%= $collectd_id %>.df-root.df_complex-used)),\"Root Used\")"
339
+ },
340
+ {
341
+ "target": "alias(scale(<%= $collectd_id %>.disk-sda.disk_io_time.io_time, 0.1), 'Active Time')"
342
+ },
343
+ {
344
+ "target": "<%= $collectd_id %>.disk-sda.select metric"
345
+ }
346
+ ],
347
+ "aliasColors": {},
348
+ "seriesOverrides": [],
349
+ "links": [],
350
+ "leftYAxisLabel": ""
351
+ }
352
+ ],
353
+ "notice": false
354
+ }
355
+ ],
356
+ "nav": [
357
+ {
358
+ "type": "timepicker",
359
+ "collapse": false,
360
+ "notice": false,
361
+ "enable": true,
362
+ "status": "Stable",
363
+ "time_options": [
364
+ "5m",
365
+ "15m",
366
+ "1h",
367
+ "6h",
368
+ "12h",
369
+ "24h",
370
+ "2d",
371
+ "7d",
372
+ "30d"
373
+ ],
374
+ "refresh_intervals": [
375
+ "5s",
376
+ "10s",
377
+ "30s",
378
+ "1m",
379
+ "5m",
380
+ "15m",
381
+ "30m",
382
+ "1h",
383
+ "2h",
384
+ "1d"
385
+ ],
386
+ "now": true
387
+ }
388
+ ],
389
+ "time": {
390
+ "from": "now-1h",
391
+ "to": "now"
392
+ },
393
+ "templating": {
394
+ "list": [],
395
+ "enable": false
396
+ },
397
+ "annotations": {
398
+ "enable": false
399
+ },
400
+ "refresh": "5s",
401
+ "version": 6,
402
+ "hideAllLegends": false
403
+ }
@@ -0,0 +1 @@
1
+ {"id":"<%= $id %>","domain":null,"scope":"GLOBAL","impl":"StringCredentialsImpl","description":"<%= $description %>","secret":"<%= $secret %>"}
@@ -0,0 +1,51 @@
1
+ <?xml version="1.0" encoding="UTF-8"?><flow-definition plugin="workflow-job@2.9">
2
+ <actions/>
3
+ <description>Runs onceover tests</description>
4
+ <keepDependencies>false</keepDependencies>
5
+ <properties>
6
+ <com.coravy.hudson.plugins.github.GithubProjectProperty plugin="github@1.25.0">
7
+ <projectUrl>https://github.com/dylanratcliffe/puppet_controlrepo/</projectUrl>
8
+ <displayName>Controlrepo</displayName>
9
+ </com.coravy.hudson.plugins.github.GithubProjectProperty>
10
+ <com.sonyericsson.rebuild.RebuildSettings plugin="rebuild@1.25">
11
+ <autoRebuild>false</autoRebuild>
12
+ <rebuildDisabled>false</rebuildDisabled>
13
+ </com.sonyericsson.rebuild.RebuildSettings>
14
+ <org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty>
15
+ <triggers>
16
+ <hudson.triggers.SCMTrigger>
17
+ <spec>H/5 * * * *</spec>
18
+ <ignorePostCommitHooks>false</ignorePostCommitHooks>
19
+ </hudson.triggers.SCMTrigger>
20
+ </triggers>
21
+ </org.jenkinsci.plugins.workflow.job.properties.PipelineTriggersJobProperty>
22
+ </properties>
23
+ <definition class="org.jenkinsci.plugins.workflow.cps.CpsFlowDefinition" plugin="workflow-cps@2.23">
24
+ <script>node {
25
+ def mvnHome
26
+ stage(&apos;Git Checkout&apos;) { // for display purposes
27
+ // Get some code from a GitHub repository
28
+ checkout([
29
+ $class: &apos;GitSCM&apos;,
30
+ branches: [[name: &apos;**&apos;]],
31
+ doGenerateSubmoduleConfigurations: false,
32
+ userRemoteConfigs: [[url: &apos;https://github.com/dylanratcliffe/puppet_controlrepo.git&apos;]]])
33
+ }
34
+ stage(&apos;Install Gems&apos;) {
35
+ // Run the onceover tests
36
+ sh &apos;&apos;&apos;source /usr/local/rvm/scripts/rvm
37
+ bundle install --path=.gems --binstubs&apos;&apos;&apos;
38
+ }
39
+ stage(&apos;Run Tests&apos;) {
40
+ // Run the onceover tests
41
+ sh &apos;&apos;&apos;source /usr/local/rvm/scripts/rvm
42
+ ./bin/onceover run spec&apos;&apos;&apos;
43
+ }
44
+ stage(&apos;Parse Results&apos;) {
45
+ junit &apos;.onceover/spec.xml&apos;
46
+ }
47
+ }</script>
48
+ <sandbox>true</sandbox>
49
+ </definition>
50
+ <triggers/>
51
+ </flow-definition>
@@ -0,0 +1,17 @@
1
+ #! /bin/bash
2
+ echo "<%= $master_ip %> <%= $master_fqdn %>" >> /etc/hosts
3
+
4
+ mkdir -p /etc/puppetlabs/puppet
5
+ cat > /etc/puppetlabs/puppet/csr_attributes.yaml <<'EOF'
6
+ ---
7
+ custom_attributes:
8
+ challengePassword: <%= $signing_key %>
9
+ EOF
10
+
11
+ mkdir -p /etc/puppetlabs/facter/facts.d
12
+ cat > /etc/puppetlabs/facter/facts.d/facts.yaml <<'EOF'
13
+ ---
14
+ role: '<%= $role %>'
15
+ EOF
16
+
17
+ curl -k https://<%= $master_fqdn %>:8140/packages/current/install.bash | bash