diff --git a/_vendor/github.com/chef/samples/LICENSE b/_vendor/github.com/chef/samples/LICENSE new file mode 100644 index 0000000000..261eeb9e9f --- /dev/null +++ b/_vendor/github.com/chef/samples/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/_vendor/github.com/chef/samples/README.md b/_vendor/github.com/chef/samples/README.md new file mode 100644 index 0000000000..a3fbff376d --- /dev/null +++ b/_vendor/github.com/chef/samples/README.md @@ -0,0 +1,2 @@ +# samples +Open repo for sample content related to active Chef products such as cookbooks, policies, and job definitions, versioned with corresponding product version diff --git a/_vendor/github.com/chef/samples/cohorts/create-cohort.json b/_vendor/github.com/chef/samples/cohorts/create-cohort.json new file mode 100644 index 0000000000..fba36a7f8d --- /dev/null +++ b/_vendor/github.com/chef/samples/cohorts/create-cohort.json @@ -0,0 +1,6 @@ +{ + "name": "", + "description": "", + "settingId": "", + "skillAssemblyId": "" +} diff --git a/_vendor/github.com/chef/samples/cohorts/node-override-setting.json b/_vendor/github.com/chef/samples/cohorts/node-override-setting.json new file mode 100644 index 0000000000..7e6c8b89f5 --- /dev/null +++ b/_vendor/github.com/chef/samples/cohorts/node-override-setting.json @@ -0,0 +1,103 @@ +{ + "name":"sample-node-setting", + "skills":[ + { + "skillName":"chef-gohai", + "settings":[ + { + "name":"log_level", + "value":"debug" + }, + { + "name":"log_file_path", + "value":"/hab/svc/chef-gohai/logs/logs.log" + }, + { + "name":"log_to_file", + "value": true + }, + { + "name":"log_to_stdout", + "value": false + } + ] + }, + { + "skillName":"courier-runner", + "settings":[ + { + "name":"credentials_api_key", + "value":"" + }, + { + "name":"credentials_api_secret", + "value":"" + }, + { + "name":"shell_interpreter", + "value":"chef-platform/shell-interpreter" + }, + { + "name":"restart_interpreter", + "value":"chef-platform/restart-interpreter" + }, + { + "name":"inspec_interpreter", + "value":"chef-platform/inspec-interpreter" + }, + { + "name":"chef_client_interpreter", + "value":"chef-platform/chef-client-interpreter" + }, + { + "name":"log_dir", + "value":"/hab/svc/courier-runner/logs" + }, + { + "name":"log_format", + "value":"json" + }, + { + "name":"log_level", + "value":"debug" + }, + { + "name":"log_output", + "value":"file" + }, + { + "name":"queue_provider", + "value":"0" + }, + { + "name":"reporter_authentication_type", + "value":"basic" + }, + { + "name":"reporter_dir", + "value":"/hab/svc/courier-runner/data" + }, + { + "name":"reporter_host_url", + "value":"" + }, + { + "name":"reporter_interval_in_sec", + "value":"3" + }, + { + "name":"reporter_name", + "value":"server" + }, + { + "name":"reporter_retry_interval_in_sec", + "value":"4" + }, + { + "name":"reporter_total_retry_duration_in_min", + "value":"2" + } + ] + } + ] +} diff --git a/_vendor/github.com/chef/samples/cohorts/skill-assembly.json b/_vendor/github.com/chef/samples/cohorts/skill-assembly.json new file mode 100644 index 0000000000..3579f5592d --- /dev/null +++ b/_vendor/github.com/chef/samples/cohorts/skill-assembly.json @@ -0,0 +1,53 @@ +{ + "name": "my-skill-assembly", + "skills": [ + { + "action": "add", + "skill": { + "name": "courier-runner", + "channel": "stable", + "value": ["1.4.6"] + } + }, + { + "action": "add", + "skill": { + "channel": "stable", + "name": "chef-gohai", + "value": ["1.2.1"] + } + }, + { + "action": "add", + "skill": { + "name": "shell-interpreter", + "channel": "stable", + "value": ["1.0.5"] + } + }, + { + "action": "add", + "skill": { + "name": "inspec-interpreter", + "channel": "stable", + "value": ["1.0.6"] + } + }, + { + "action": "add", + "skill": { + "name": "restart-interpreter", + "channel": "stable", + "value": ["1.0.4"] + } + }, + { + "action": "add", + "skill": { + "name": "chef-client-interpreter", + "channel": "stable", + "value": ["1.0.6"] + } + } + ] +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/00_empty-job-template.json b/_vendor/github.com/chef/samples/courier-job-examples/00_empty-job-template.json new file mode 100644 index 0000000000..027fd8a80c --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/00_empty-job-template.json @@ -0,0 +1,89 @@ +{ + "name":"", + "description": "", + "scheduleRule": "immediate|RRule", + "exceptionRules": [], + "target": { + "executionType": "sequential"|"parallel", + "groups":[ + { + "timeoutSeconds": , + "batchSize": { + "type": "number"|"percent", + "value": + }, + "distributionMethod": "rolling"|"batching", + "successCriteria": [ + { + "numRuns": { + "type": "number"|"percent", + "value": + }, + "status": "success"|"failure" + } + ], + "nodeListType": "filter"|"savedFilter"|"savedList"|"nodes", + "listId": "", + "filterId": , + "nodeIdentifiers":[""], + "filter": {} + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": + [ + { + "name": "", + "description": "", + "command": {}, + "inputs": {}, + "interpreter": { + "skill": { + "minVersion": "", + "maxVersion": "" + }, + "name": "" + }, + "expectedInputs": { + "": { + "default": "", + "required": , + "sensitive": + } + }, + "outputFieldRules": { + "sourceType": "artifact"|"exitCode"|"file"|"output", + "source": "", + "extractMethod": "regex"|"jsonPath"|"content", + "expression": "", + "required": , + "sensitive": + }, + "retryCount": , + "failureBehavior": { + "action": "retryThenFail"|"retryThenIgnore", + "retryBackoffStrategy": { + "name": "none"|"linear"|"exponential"|"polynomial", + "delaySeconds": , + "arguments": [] + } + }, + "limits": { + "cores": , + "cpu": , + "timeoutSeconds": , + }, + "conditions": [ + { + "inputName": "", + "negate": , + "operator": "eq"|"gt"|"gte"|"lt"|"lte"|"matches"|"startsWith"|"endsWith"|"contains", + "value": "" + } + ] + } + ] + } +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/00_empty-job-template.yaml b/_vendor/github.com/chef/samples/courier-job-examples/00_empty-job-template.yaml new file mode 100644 index 0000000000..e28fccbaf3 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/00_empty-job-template.yaml @@ -0,0 +1,64 @@ +--- +name: +description: +scheduleRule: immediate|RRule +exceptionRules: [] +target: + executionType: sequential|parallel + groups: + - timeoutSeconds: + batchSize: + type: number|percent + value: + distributionMethod: rolling|batching + successCriteria: + - numRuns: + type: number|percent + value: + status: success|failure + nodeListType: filter|savedFilter|savedList|nodes + listId: + filterId: + nodeIdentifiers: + - + filter: {} +actions: + accessMode: agent + steps: + - name: + description: + command: {} + inputs: {} + interpreter: + skill: + minVersion: '' + maxVersion: '' + name: '' + expectedInputs: + : + default: + required: + sensitive: + outputFieldRules: + sourceType: artifact|exitCode|file|output + source: + extractMethod: regex|jsonPath|content + expression: + required: + sensitive: + retryCount: + failureBehavior: + action: retryThenFail|retryThenIgnore + retryBackoffStrategy: + name: none|linear|exponential|polynomial + delaySeconds: + arguments: [] + limits: + cores: + cpu: + timeoutSeconds: + conditions: + - inputName: + negate: + operator: eq|gt|gte|lt|lte|matches|startsWith|endsWith|contains + value: diff --git a/_vendor/github.com/chef/samples/courier-job-examples/01_job-with-minimum-details.json b/_vendor/github.com/chef/samples/courier-job-examples/01_job-with-minimum-details.json new file mode 100644 index 0000000000..4efe6e7824 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/01_job-with-minimum-details.json @@ -0,0 +1,52 @@ +{ + "name": "", + "description": "", + "exceptionRules":[], + "scheduleRule":"", + "target": { + "executionType": "", + "groups":[ + { + "timeoutSeconds": , + "batchSize": { + "type":"", + "value": + }, + "distributionMethod":"", + "successCriteria": [{"status":"", "numRuns":{"type":"", "value":}}], + "nodeListType": "", + "listId": "", + "filterId": , + "nodeIdentifiers":[""], + "filter": {} + } + ] + }, + "actions": { + "accessMode":"agent", + "steps": + [ + { + "name": "", + "interpreter": { + "name": "", + "skill": { + "minVersion": "", + "maxVersion": "" + } + }, + "command": {}, + "inputs":{}, + "expectedInputs":{}, + "outputFieldRules":{}, + "retryCount": , + "limits":{}, + "conditions":[], + "failureBehavior":{ + "action":"retryThenFail", + "retryBackoffStrategy":{"name":"none", "delaySeconds":} + } + } + ] + } +} \ No newline at end of file diff --git a/_vendor/github.com/chef/samples/courier-job-examples/01_job-with-minimum-details.yaml b/_vendor/github.com/chef/samples/courier-job-examples/01_job-with-minimum-details.yaml new file mode 100644 index 0000000000..55e185d57b --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/01_job-with-minimum-details.yaml @@ -0,0 +1,45 @@ +--- +name: "" +description: "" +exceptionRules: [] +scheduleRule: "" +target: + executionType: "" + groups: + - timeoutSeconds: + batchSize: + type: "" + value: + distributionMethod: "" + successCriteria: + - status: "" + numRuns: + type: "" + value: + nodeListType: "" + listId: "" + filterId: + nodeIdentifiers: + - "" + filter: {} +actions: + accessMode: agent + steps: + - name: "" + interpreter: + name: "" + skill: + minVersion: "" + maxVersion: "" + command: {} + inputs: {} + expectedInputs: {} + outputFieldRules: {} + retryCount: + limits: {} + conditions: [] + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + name: none + delaySeconds: diff --git a/_vendor/github.com/chef/samples/courier-job-examples/create-job-simple.json b/_vendor/github.com/chef/samples/courier-job-examples/create-job-simple.json new file mode 100644 index 0000000000..947cfe34d3 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/create-job-simple.json @@ -0,0 +1,76 @@ +{ + "name": "a simple job to perform one action", + "description": "Perform a simple shell command on specific nodes to understand the fundamentals of Courier jobs", + "scheduleRule": "immediate", + "exceptionRules": [], + "target": { + "executionType": "sequential", + "groups": [ + { + "timeoutSeconds": 240, + "batchSize": { + "type": "number", + "value": 1 + }, + "distributionMethod": "batching", + "successCriteria": [ + { + "numRuns": { "type": "percent", "value": 100 }, + "status": "success" + } + ], + "nodeListType": "nodes", + "nodeIdentifiers": ["--NODE1--"] + }, + { + "timeoutSeconds": 120, + "batchSize": { + "type": "number", + "value": 1 + }, + "distributionMethod": "batching", + "successCriteria": [ + { + "numRuns": { "type": "percent", "value": 100 }, + "status": "success" + } + ], + "nodeListType": "nodes", + "nodeIdentifiers": ["--NODE2--", "--NODE3--"] + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": [ + { + "name": "step to sleep", + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { + "linux": ["sleep 10"], + "windows": ["timeout 10"] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": {}, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [] + } + ] + } +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/create-job-simple.yaml b/_vendor/github.com/chef/samples/courier-job-examples/create-job-simple.yaml new file mode 100644 index 0000000000..35e3972a84 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/create-job-simple.yaml @@ -0,0 +1,66 @@ +--- +name: a simple job to perform one action +description: + Perform a simple shell command on specific nodes to understand the fundamentals + of Courier jobs +scheduleRule: immediate +exceptionRules: [] +target: + executionType: sequential + groups: + - timeoutSeconds: 240 + batchSize: + type: number + value: 1 + distributionMethod: batching + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: nodes + nodeIdentifiers: + - "--NODE1--" + - timeoutSeconds: 120 + batchSize: + type: number + value: 1 + distributionMethod: batching + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: nodes + nodeIdentifiers: + - "--NODE2--" + - "--NODE3--" +actions: + accessMode: agent + steps: + - name: step to sleep + interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + command: + linux: + - sleep 10 + windows: + - timeout 10 + inputs: {} + expectedInputs: {} + outputFieldRules: {} + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] diff --git a/_vendor/github.com/chef/samples/courier-job-examples/infra_client_local.json b/_vendor/github.com/chef/samples/courier-job-examples/infra_client_local.json new file mode 100644 index 0000000000..bd42221a42 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/infra_client_local.json @@ -0,0 +1,64 @@ +{ + "name": "infra client local run", + "description": "Perform simple Chef Infra Client run from local using courier jobs", + "scheduleRule": "immediate", + "exceptionRules": [], + "target": { + "executionType": "sequential", + "groups": [ + { + "timeoutSeconds": 240, + "batchSize": { + "type": "number", + "value": 1 + }, + "distributionMethod": "batching", + "successCriteria": [ + { + "numRuns": { "type": "percent", "value": 100 }, + "status": "success" + } + ], + "nodeListType": "nodes", + "nodeIdentifiers": ["--NODE1--"] + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": [ + { + "name": "step to pem keys", + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "20.9.99" + }, + "name": "chef-platform/chef-client-interpreter" + }, + "command": { + "exec": "run", + "args": { + "mode": "local", + "path": "/home/ec2-user/chef-repo/cookbooks", + "runlist": "nginx::default" + } + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": {}, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [] + } + ] + } +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/infra_client_local.yaml b/_vendor/github.com/chef/samples/courier-job-examples/infra_client_local.yaml new file mode 100644 index 0000000000..f54ed4b8c5 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/infra_client_local.yaml @@ -0,0 +1,51 @@ +--- +name: infra client local run +description: Perform simple Chef Infra Client run from local using courier jobs +scheduleRule: immediate +exceptionRules: [] +target: + executionType: sequential + groups: + - timeoutSeconds: 240 + batchSize: + type: number + value: 1 + distributionMethod: batching + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: nodes + nodeIdentifiers: + - "--NODE1--" +actions: + accessMode: agent + steps: + - name: step to pem keys + interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 20.9.99 + name: chef-platform/chef-client-interpreter + command: + exec: run + args: + mode: local + path: "/home/ec2-user/chef-repo/cookbooks" + runlist: nginx::default + inputs: {} + expectedInputs: {} + outputFieldRules: {} + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] diff --git a/_vendor/github.com/chef/samples/courier-job-examples/infra_client_pem_key_rotation.json b/_vendor/github.com/chef/samples/courier-job-examples/infra_client_pem_key_rotation.json new file mode 100644 index 0000000000..a032993bc0 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/infra_client_pem_key_rotation.json @@ -0,0 +1,62 @@ +{ + "name": "a simple job to showcase invoking Chef Infra Client", + "description": "Perform simple Chef Infra Client actions using courier jobs", + "scheduleRule": "immediate", + "exceptionRules": [], + "target": { + "executionType": "sequential", + "groups": [ + { + "timeoutSeconds": 240, + "batchSize": { + "type": "number", + "value": 1 + }, + "distributionMethod": "batching", + "successCriteria": [ + { + "numRuns": { "type": "percent", "value": 100 }, + "status": "success" + } + ], + "nodeListType": "nodes", + "nodeIdentifiers": ["--NODE--"] + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": [ + { + "name": "step to pem keys", + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "19.9.99" + }, + "name": "chef-platform/chef-client-interpreter" + }, + "command": { + "exec": "rotate credentials", + "args": { + "config": "/home/ubuntu/.chef/credentials" + } + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": {}, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [] + } + ] + } +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/infra_client_pem_key_rotation.yaml b/_vendor/github.com/chef/samples/courier-job-examples/infra_client_pem_key_rotation.yaml new file mode 100644 index 0000000000..a79bc1e9d6 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/infra_client_pem_key_rotation.yaml @@ -0,0 +1,49 @@ +--- +name: a simple job to showcase invoking Chef Infra Client +description: Perform simple Chef Infra Client actions using courier jobs +scheduleRule: immediate +exceptionRules: [] +target: + executionType: sequential + groups: + - timeoutSeconds: 240 + batchSize: + type: number + value: 1 + distributionMethod: batching + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: nodes + nodeIdentifiers: + - "--NODE1--" +actions: + accessMode: agent + steps: + - name: step to pem keys + interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 20.9.99 + name: chef-platform/chef-client-interpreter + command: + exec: rotate credentials + args: + config: "/etc/chef/client.pem" + inputs: {} + expectedInputs: {} + outputFieldRules: {} + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] diff --git a/_vendor/github.com/chef/samples/courier-job-examples/infra_client_run.json b/_vendor/github.com/chef/samples/courier-job-examples/infra_client_run.json new file mode 100644 index 0000000000..96a6cb37da --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/infra_client_run.json @@ -0,0 +1,59 @@ +{ + "name": "infra client remote run", + "description": "Perform simple Chef Infra Client run using courier jobs", + "scheduleRule": "immediate", + "exceptionRules": [], + "target": { + "executionType": "sequential", + "groups": [ + { + "timeoutSeconds": 240, + "batchSize": { + "type": "number", + "value": 1 + }, + "distributionMethod": "batching", + "successCriteria": [ + { + "numRuns": { "type": "percent", "value": 100 }, + "status": "success" + } + ], + "nodeListType": "nodes", + "nodeIdentifiers": ["--NODE1--"] + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": [ + { + "name": "step to pem keys", + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "20.9.99" + }, + "name": "chef-platform/chef-client-interpreter" + }, + "command": { + "exec": "run" + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": {}, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [] + } + ] + } +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/infra_client_run.yaml b/_vendor/github.com/chef/samples/courier-job-examples/infra_client_run.yaml new file mode 100644 index 0000000000..d2ff525f16 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/infra_client_run.yaml @@ -0,0 +1,47 @@ +--- +name: infra client remote run +description: Perform simple Chef Infra Client run using courier jobs +scheduleRule: immediate +exceptionRules: [] +target: + executionType: sequential + groups: + - timeoutSeconds: 240 + batchSize: + type: number + value: 1 + distributionMethod: batching + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: nodes + nodeIdentifiers: + - "--NODE1--" +actions: + accessMode: agent + steps: + - name: step to pem keys + interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 20.9.99 + name: chef-platform/chef-client-interpreter + command: + exec: run + inputs: {} + expectedInputs: {} + outputFieldRules: {} + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] diff --git a/_vendor/github.com/chef/samples/courier-job-examples/inspec_exec.json b/_vendor/github.com/chef/samples/courier-job-examples/inspec_exec.json new file mode 100644 index 0000000000..c84d7c25f0 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/inspec_exec.json @@ -0,0 +1,113 @@ +{ + "name": "Inspec scan", + "description": "Example to showcase running an Inspec exec on Linux", + "scheduleRule": "immediate", + "exceptionRules": [], + "target": { + "executionType": "sequential", + "groups": [ + { + "timeoutSeconds": 120, + "batchSize": { + "type": "number", + "value": 1 + }, + "distributionMethod": "batching", + "successCriteria": [ + { + "numRuns": { + "type": "percent", + "value": 100 + }, + "status": "success" + } + ], + "nodeListType": "nodes", + "nodeIdentifiers": ["--NODE1--"] + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": [ + { + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "20.0.6" + }, + "name": "chef-platform/inspec-interpreter" + }, + + "command": { + "exec": "scan", + "args": { + "path": "https://github.com/akshayparvatikar29/cert-compliance" + } + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": { + "INSPEC_VALUE": { + "source": "stdout", + "sourceType": "output", + "extractMethod": "regEx", + "expression": "0 successful", + "required": true, + "sensitive": false + } + }, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "none", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [], + "name": "capture inspec value into variable" + }, + { + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "20.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "inputs": {}, + "expectedInputs": { + "INSPEC_VALUE": { + "type": "string", + "sensitive": false, + "required": true, + "default": "" + } + }, + "outputFieldRules": {}, + "conditions": [ + { + "inputName": "INSPEC_VALUE", + "operator": "eq", + "value": "0 successful" + } + ], + "command": { "linux": ["sleep 10"] }, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [] + } + }, + "limits": {}, + "name": "executing command with inspec variable" + } + ] + } +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/inspec_exec.yaml b/_vendor/github.com/chef/samples/courier-job-examples/inspec_exec.yaml new file mode 100644 index 0000000000..979a849958 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/inspec_exec.yaml @@ -0,0 +1,85 @@ +--- +name: Inspec scan +description: Example to showcase running an Inspec exec on Linux +scheduleRule: immediate +exceptionRules: [] +target: + executionType: sequential + groups: + - timeoutSeconds: 120 + batchSize: + type: number + value: 1 + distributionMethod: batching + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: nodes + nodeIdentifiers: + - "--NODE1--" +actions: + accessMode: agent + steps: + - name: capture inspec value into variable + interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 16.0.0 + name: chef-platform/inspec-interpreter + command: + exec: scan + args: + path: https://github.com/akshayparvatikar29/cert-compliance + inputs: {} + expectedInputs: {} + outputFieldRules: + INSPEC_VALUE: + source: stdout + sourceType: output + extractMethod: regEx + expression: 0 successful + required: true + sensitive: false + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: none + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] + - interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + inputs: {} + expectedInputs: + INSPEC_VALUE: + type: string + sensitive: false + required: true + default: "" + outputFieldRules: {} + conditions: + - inputName: INSPEC_VALUE + operator: eq + value: 0 successful + command: + linux: + - sleep 10 + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: [] + limits: {} + name: executing command with inspec variable diff --git a/_vendor/github.com/chef/samples/courier-job-examples/inspec_with_token.json b/_vendor/github.com/chef/samples/courier-job-examples/inspec_with_token.json new file mode 100644 index 0000000000..4696ad303b --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/inspec_with_token.json @@ -0,0 +1,76 @@ +{ + "name":"Inspec exec with automate token", + "description":"Example to showcase running an Inspec exec by connecting with Chef Automate using a token", + "scheduleRule": "immediate", + "exceptionRules": [], + "target": { + "executionType": "sequential", + "groups": [ + { + "timeoutSeconds": 120, + "batchSize": { + "type": "number", + "value": 1 + }, + "distributionMethod": "batching", + "successCriteria": [ + { + "numRuns": { + "type": "percent", + "value": 100 + }, + "status": "success" + } + ], + "nodeListType": "nodes", + "nodeIdentifiers": [ + "--NODE1--" + ] + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": [ + { + + "name": "inspec", + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "20.0.0" + }, + "name": "chef-platform/inspec-interpreter" + }, + "command":{ + "exec":"scan", + "args":{ + "username": "", + "path": "admin/ssh-baseline", + "token": "xxxxxxxxxxxx", + "sourceURL": "", + "source": "automate" + } + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": {}, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "none", + "delaySeconds": 1, + "arguments": [ + 1, + 3, + 5 + ] + } + }, + "limits": {}, + "conditions": [] + } + ] + } + } \ No newline at end of file diff --git a/_vendor/github.com/chef/samples/courier-job-examples/inspec_with_token.yaml b/_vendor/github.com/chef/samples/courier-job-examples/inspec_with_token.yaml new file mode 100644 index 0000000000..cbbf3671cf --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/inspec_with_token.yaml @@ -0,0 +1,54 @@ +--- +name: Inspec exec with automate token +description: Example to showcase running an Inspec exec by connecting with Chef Automate + using a token +scheduleRule: immediate +exceptionRules: [] +target: + executionType: sequential + groups: + - timeoutSeconds: 120 + batchSize: + type: number + value: 1 + distributionMethod: batching + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: nodes + nodeIdentifiers: + - "--NODE1--" +actions: + accessMode: agent + steps: + - name: inspec + interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 20.0.0 + name: chef-platform/inspec-interpreter + command: + exec: scan + args: + username: "" + path: admin/ssh-baseline + token: xxxxxxxxxxxx + sourceURL: "" + source: automate + inputs: {} + expectedInputs: {} + outputFieldRules: {} + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: none + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] diff --git a/_vendor/github.com/chef/samples/courier-job-examples/job_direct_query_linux.json b/_vendor/github.com/chef/samples/courier-job-examples/job_direct_query_linux.json new file mode 100644 index 0000000000..1725643660 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/job_direct_query_linux.json @@ -0,0 +1,66 @@ +{ + "name": "job direct query", + "description": "Demonstrating a simple job to be performed against nodes resolved for an adhoc search query for Linux in batches of 5 nodes", + "scheduleRule": "immediate", + "exceptionRules": [], + "target": { + "executionType": "sequential", + "groups": [ + { + "timeoutSeconds": 60, + "batchSize": { + "type": "number", + "value": 5 + }, + "distributionMethod": "batching", + "successCriteria": [ + { + "numRuns": { "type": "percent", "value": 100 }, + "status": "success" + } + ], + "nodeListType": "filter", + "filter": { + "constraints": { + "attributes": [ + { "name": "kernel_name", "operator": "=", "value": ["Linux"] } + ] + } + } + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": [ + { + "name": "step to sleep", + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { + "linux": ["sleep 10"], + "windows": ["timeout 10"] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": {}, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [] + } + ] + } +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/job_direct_query_linux.yaml b/_vendor/github.com/chef/samples/courier-job-examples/job_direct_query_linux.yaml new file mode 100644 index 0000000000..7c3138b9cb --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/job_direct_query_linux.yaml @@ -0,0 +1,57 @@ +--- +name: job direct query +description: + Demonstrating a simple job to be performed against nodes resolved for + an adhoc search query for Linux in batches of 5 nodes +scheduleRule: immediate +exceptionRules: [] +target: + executionType: sequential + groups: + - timeoutSeconds: 60 + batchSize: + type: number + value: 5 + distributionMethod: batching + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: filter + filter: + constraints: + attributes: + - name: kernel_name + operator: "=" + value: + - Linux +actions: + accessMode: agent + steps: + - name: step to sleep + interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + command: + linux: + - sleep 10 + windows: + - timeout 10 + inputs: {} + expectedInputs: {} + outputFieldRules: {} + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] diff --git a/_vendor/github.com/chef/samples/courier-job-examples/job_reboot.json b/_vendor/github.com/chef/samples/courier-job-examples/job_reboot.json new file mode 100644 index 0000000000..1889cd2931 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/job_reboot.json @@ -0,0 +1,125 @@ +{ + "name": "Sample reboot", + "description": "To demonstrate a reboot action as a part of a simple courier job on a node", + "scheduleRule": "immediate", + "exceptionRules": [], + "target": { + "executionType": "sequential", + "groups": [ + { + "timeoutSeconds": 240, + "batchSize": { + "type": "number", + "value": 1 + }, + "distributionMethod": "batching", + "successCriteria": [ + { + "numRuns": { "type": "percent", "value": 100 }, + "status": "success" + } + ], + "nodeListType": "nodes", + "nodeIdentifiers": ["--NODE1--"] + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": [ + { + "name": "step to perform file write before a reboot", + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { + "linux": [ + "echo 'before restart..' > /home/ec2-user/before-restart.txt" + ], + "windows": [ + "echo 'before restart..' > C:\\Users\\Administrator\\before-restart.txt" + ] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": {}, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "none", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [] + }, + { + "name": "step to perform reboot", + "interpreter": { + "skill": { + "minVersion": "0.0.0", + "maxVersion": "2.0.0" + }, + "name": "chef-platform/restart-interpreter" + }, + "command": { + "exec": "machine_reboot" + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": {}, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [] + }, + { + "name": "step to perform file write after reboot", + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { + "linux": [ + "echo 'after restart..' > /home/ec2-user/after-restart.txt" + ], + "windows": [ + "echo 'after restart..' > C:\\Users\\Administrator\\after-restart.txt" + ] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": { + "required": false + }, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [] + } + ] + } +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/job_reboot.yaml b/_vendor/github.com/chef/samples/courier-job-examples/job_reboot.yaml new file mode 100644 index 0000000000..6e4dc2e48f --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/job_reboot.yaml @@ -0,0 +1,98 @@ +--- +name: Sample reboot +description: To demonstrate a reboot action as a part of a simple courier job on a + node +scheduleRule: immediate +exceptionRules: [] +target: + executionType: sequential + groups: + - timeoutSeconds: 240 + batchSize: + type: number + value: 1 + distributionMethod: batching + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: nodes + nodeIdentifiers: + - "--NODE1--" +actions: + accessMode: agent + steps: + - name: step to perform file write before a reboot + interpreter: + skill: + minVersion: 1.0.0 + name: chef-platform/shell-interpreter + command: + linux: + - echo 'before restart..' > /home/ec2-user/before-restart.txt + windows: + - echo 'before restart..' > C:\Users\Administrator\before-restart.txt + inputs: {} + expectedInputs: {} + outputFieldRules: {} + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: none + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] + - name: step to perform reboot + interpreter: + skill: + minVersion: 0.0.0 + maxVersion: 2.0.0 + name: chef-platform/restart-interpreter + command: + exec: machine_reboot + inputs: {} + expectedInputs: {} + outputFieldRules: {} + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] + - name: step to perform file write after reboot + interpreter: + skill: + minVersion: 1.0.0 + name: chef-platform/shell-interpreter + command: + linux: + - echo 'after restart..' > /home/ec2-user/after-restart.txt + windows: + - echo 'after restart..' > C:\Users\Administrator\after-restart.txt + inputs: {} + expectedInputs: {} + outputFieldRules: {} + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] diff --git a/_vendor/github.com/chef/samples/courier-job-examples/job_saved_filter_linux.json b/_vendor/github.com/chef/samples/courier-job-examples/job_saved_filter_linux.json new file mode 100644 index 0000000000..1254eea7d3 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/job_saved_filter_linux.json @@ -0,0 +1,60 @@ +{ + "name": "job saved filter", + "description": "demonstrating running a job using a saved filter", + "scheduleRule": "immediate", + "exceptionRules": [], + "target": { + "executionType": "sequential", + "groups": [ + { + "timeoutSeconds": 300, + "batchSize": { + "type": "number", + "value": 5 + }, + "distributionMethod": "batching", + "successCriteria": [ + { + "numRuns": { "type": "percent", "value": 100 }, + "status": "success" + } + ], + "nodeListType": "savedFilter", + "filterId": "--FILTER ID--" + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": [ + { + "name": "step to sleep", + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { + "linux": ["sleep 10"], + "windows": ["timeout 10"] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": {}, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [] + } + ] + } +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/job_saved_filter_linux.yaml b/_vendor/github.com/chef/samples/courier-job-examples/job_saved_filter_linux.yaml new file mode 100644 index 0000000000..14547bbd5d --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/job_saved_filter_linux.yaml @@ -0,0 +1,49 @@ +--- +name: job saved filter +description: demonstrating running a job using a saved filter +scheduleRule: immediate +exceptionRules: [] +target: + executionType: sequential + groups: + - timeoutSeconds: 300 + batchSize: + type: number + value: 5 + distributionMethod: batching + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: savedFilter + filterId: "--FILTER ID--" +actions: + accessMode: agent + steps: + - name: step to sleep + interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + command: + linux: + - sleep 10 + windows: + - timeout 10 + inputs: {} + expectedInputs: {} + outputFieldRules: {} + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] diff --git a/_vendor/github.com/chef/samples/courier-job-examples/job_saved_list_linux.json b/_vendor/github.com/chef/samples/courier-job-examples/job_saved_list_linux.json new file mode 100644 index 0000000000..b2e10113d5 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/job_saved_list_linux.json @@ -0,0 +1,60 @@ +{ + "name": "job saved list", + "description": "demonstrating running a job using a saved node list", + "scheduleRule": "immediate", + "exceptionRules": [], + "target": { + "executionType": "sequential", + "groups": [ + { + "timeoutSeconds": 60, + "batchSize": { + "type": "number", + "value": 5 + }, + "distributionMethod": "batching", + "successCriteria": [ + { + "numRuns": { "type": "percent", "value": 100 }, + "status": "success" + } + ], + "nodeListType": "savedList", + "listId": "--LIST ID--" + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": [ + { + "name": "step to sleep", + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { + "linux": ["sleep 10"], + "windows": ["timeout 10"] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": {}, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [] + } + ] + } +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/job_saved_list_linux.yaml b/_vendor/github.com/chef/samples/courier-job-examples/job_saved_list_linux.yaml new file mode 100644 index 0000000000..39c836f247 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/job_saved_list_linux.yaml @@ -0,0 +1,49 @@ +--- +name: job saved list +description: demonstrating running a job using a saved node list +scheduleRule: immediate +exceptionRules: [] +target: + executionType: sequential + groups: + - timeoutSeconds: 60 + batchSize: + type: number + value: 5 + distributionMethod: batching + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: savedList + listId: "--LIST ID--" +actions: + accessMode: agent + steps: + - name: step to sleep + interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + command: + linux: + - sleep 10 + windows: + - timeout 10 + inputs: {} + expectedInputs: {} + outputFieldRules: {} + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] diff --git a/_vendor/github.com/chef/samples/courier-job-examples/job_windows_conditional_actions.json b/_vendor/github.com/chef/samples/courier-job-examples/job_windows_conditional_actions.json new file mode 100644 index 0000000000..09f863e7c2 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/job_windows_conditional_actions.json @@ -0,0 +1,186 @@ +{ + "name": "Windows conditional actions", + "description": "A job to simulate how courier can execute steps conditionally based on a response", + "scheduleRule": "immediate", + "exceptionRules": [], + "target": { + "executionType": "sequential", + "groups": [ + { + "timeoutSeconds": 160, + "batchSize": { + "type": "number", + "value": 1 + }, + "distributionMethod": "rolling", + "successCriteria": [ + { + "numRuns": { "type": "percent", "value": 100 }, + "status": "success" + } + ], + "nodeListType": "nodes", + "nodeIdentifiers": ["--NODE1--"] + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": [ + { + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { + "windows": ["echo 'Adding value2 sample'"] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": { + "CAN_PERFORM_TASK": { + "source": "stdout", + "sourceType": "output", + "extractMethod": "regEx", + "expression": "value2", + "required": true, + "sensitive": false + } + }, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [] + } + }, + "limits": {}, + "conditions": [], + "name": "step to simulate a value being received" + }, + { + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "inputs": {}, + "outputFieldRules": {}, + "expectedInputs": { + "CAN_PERFORM_TASK": { + "type": "string", + "sensitive": false, + "required": true, + "default": "true" + } + }, + "conditions": [ + { + "inputName": "CAN_PERFORM_TASK", + "operator": "eq", + "value": "value2" + } + ], + "command": { + "windows": [ + "echo {{.CAN_PERFORM_TASK}} > C:\\Users\\Administrator\\task.txt" + ] + }, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [] + } + }, + "limits": {}, + "name": "step to simulate conditionally performing a command based on previous step" + }, + { + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { + "windows": ["cat C:\\Users\\Administrator\\task.txt"] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": { + "TASK_COMPLETED": { + "source": "stdout", + "sourceType": "output", + "extractMethod": "content", + "expression": "", + "required": true, + "sensitive": false + } + }, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [] + } + }, + "conditions": [], + "limits": {}, + "name": "step to check if the previous command ran conditionally" + }, + { + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "inputs": {}, + "expectedInputs": { + "TASK_COMPLETED": { + "type": "string", + "sensitive": false, + "required": true, + "default": "true" + } + }, + "outputFieldRules": {}, + "conditions": [ + { + "inputName": "TASK_COMPLETED", + "operator": "eq", + "value": "value2\r\n" + } + ], + "command": { + "windows": ["timeout 1"] + }, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [] + } + }, + "limits": {}, + "name": "step to output if a task was completed" + } + ] + } +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/job_windows_conditional_actions.yaml b/_vendor/github.com/chef/samples/courier-job-examples/job_windows_conditional_actions.yaml new file mode 100644 index 0000000000..a493b9808f --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/job_windows_conditional_actions.yaml @@ -0,0 +1,140 @@ +--- +name: Windows conditional actions +description: + A job to simulate how courier can execute steps conditionally based on + a response +scheduleRule: immediate +exceptionRules: [] +target: + executionType: sequential + groups: + - timeoutSeconds: 160 + batchSize: + type: number + value: 1 + distributionMethod: rolling + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: nodes + nodeIdentifiers: + - "--NODE1--" +actions: + accessMode: agent + steps: + - interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + command: + windows: + - echo 'Adding value2 sample' + inputs: {} + expectedInputs: {} + outputFieldRules: + CAN_PERFORM_TASK: + source: stdout + sourceType: output + extractMethod: regEx + expression: value2 + required: true + sensitive: false + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: [] + limits: {} + conditions: [] + name: step to simulate a value being received + - interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + inputs: {} + outputFieldRules: {} + expectedInputs: + CAN_PERFORM_TASK: + type: string + sensitive: false + required: true + default: "true" + conditions: + - inputName: CAN_PERFORM_TASK + operator: eq + value: value2 + command: + windows: + - echo {{.CAN_PERFORM_TASK}} > C:\Users\Administrator\task.txt + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: [] + limits: {} + name: step to simulate conditionally performing a command based on previous step + - interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + command: + windows: + - cat C:\Users\Administrator\task.txt + inputs: {} + expectedInputs: {} + outputFieldRules: + TASK_COMPLETED: + source: stdout + sourceType: output + extractMethod: content + expression: "" + required: true + sensitive: false + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: [] + conditions: [] + limits: {} + name: step to check if the previous command ran conditionally + - interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + inputs: {} + expectedInputs: + TASK_COMPLETED: + type: string + sensitive: false + required: true + default: "true" + outputFieldRules: {} + conditions: + - inputName: TASK_COMPLETED + operator: eq + value: "value2\r\n" + command: + windows: + - timeout 1 + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: [] + limits: {} + name: step to output if a task was completed diff --git a/_vendor/github.com/chef/samples/courier-job-examples/macos-job-example.json b/_vendor/github.com/chef/samples/courier-job-examples/macos-job-example.json new file mode 100644 index 0000000000..367c585df1 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/macos-job-example.json @@ -0,0 +1,138 @@ +{ + "name": "shell command with mac OS", + "description": "To demonstrate a reboot action as a part of a simple courier job on multiple operating systems", + "scheduleRule": "immediate", + "exceptionRules": [], + "target": { + "executionType": "sequential", + "groups": [ + { + "timeoutSeconds": 240, + "batchSize": { + "type": "number", + "value": 1 + }, + "distributionMethod": "batching", + "successCriteria": [ + { + "numRuns": { "type": "percent", "value": 100 }, + "status": "success" + } + ], + "nodeListType": "nodes", + "nodeIdentifiers": ["--NODE1--"] + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": [ + { + "name": "step to check last reboot time windows and linux", + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { + "linux": ["last reboot"], + "darwin": ["last reboot"], + "windows": ["wmic os get lastbootuptime"] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": { + "last_reboot_time": { + "source": "stdout", + "sourceType": "output", + "extractMethod": "content", + "expression": "false", + "required": true, + "sensitive": false + } + }, + "retryCount": 1, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "none", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [] + }, + { + "name": "step to reboot machine", + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/restart-interpreter" + }, + "command": { + "exec": "machine_reboot", + "args": { + "time": "now" + } + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": {}, + "retryCount": 1, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "none", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [] + }, + { + "name": "step to check last reboot time windows and linux after restart", + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { + "linux": ["last reboot"], + "darwin": ["last reboot"], + "windows": ["wmic os get lastbootuptime"] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": { + "new_reboot_time": { + "source": "stdout", + "sourceType": "output", + "extractMethod": "content", + "expression": "false", + "required": true, + "sensitive": false + } + }, + "retryCount": 1, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "none", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [] + } + ] + } +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/macos-job-example.yaml b/_vendor/github.com/chef/samples/courier-job-examples/macos-job-example.yaml new file mode 100644 index 0000000000..62708e659a --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/macos-job-example.yaml @@ -0,0 +1,121 @@ +--- +name: shell command with mac OS +description: + To demonstrate a reboot action as a part of a simple courier job on multiple + operating systems +scheduleRule: immediate +exceptionRules: [] +target: + executionType: sequential + groups: + - timeoutSeconds: 240 + batchSize: + type: number + value: 1 + distributionMethod: batching + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: nodes + nodeIdentifiers: + - "--NODE1--" +actions: + accessMode: agent + steps: + - name: step to check last reboot time windows and linux + interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + command: + linux: + - last reboot + darwin: + - last reboot + windows: + - wmic os get lastbootuptime + inputs: {} + expectedInputs: {} + outputFieldRules: + last_reboot_time: + source: stdout + sourceType: output + extractMethod: content + expression: "false" + required: true + sensitive: false + retryCount: 1 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: none + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] + - name: step to reboot machine + interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/restart-interpreter + command: + exec: machine_reboot + args: + time: 200 + inputs: {} + expectedInputs: {} + outputFieldRules: {} + retryCount: 1 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: none + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] + - name: step to check last reboot time windows and linux after restart + interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + command: + linux: + - last reboot + darwin: + - last reboot + windows: + - wmic os get lastbootuptime + inputs: {} + expectedInputs: {} + outputFieldRules: + new_reboot_time: + source: stdout + sourceType: output + extractMethod: content + expression: "false" + required: true + sensitive: false + retryCount: 1 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: none + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] diff --git a/_vendor/github.com/chef/samples/courier-job-examples/multi-node-multi-group-job-immediate-sequential-batched.json b/_vendor/github.com/chef/samples/courier-job-examples/multi-node-multi-group-job-immediate-sequential-batched.json new file mode 100644 index 0000000000..b8ed1ceb54 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/multi-node-multi-group-job-immediate-sequential-batched.json @@ -0,0 +1,81 @@ +{ + "name": "multi-node-multi-group-job-batching", + "description": "demonstrating an immediate job executing sequential on multiple nodes with batched rollout", + "scheduleRule": "immediate", + "exceptionRules": [], + "target": { + "executionType": "sequential", + "groups": [ + { + "timeoutSeconds": 300, + "batchSize": { + "type": "number", + "value": 2 + }, + "distributionMethod": "batching", + "successCriteria": [ + { + "numRuns": { "type": "percent", "value": 100 }, + "status": "success" + } + ], + "nodeListType": "nodes", + "nodeIdentifiers": [ + "--NODE1--", + "--NODE2--", + "--NODE3--", + "--NODE4--", + "--NODE5--" + ] + }, + { + "timeoutSeconds": 300, + "batchSize": { + "type": "number", + "value": 2 + }, + "distributionMethod": "batching", + "successCriteria": [ + { + "numRuns": { "type": "percent", "value": 100 }, + "status": "success" + } + ], + "nodeListType": "nodes", + "nodeIdentifiers": ["--NODE6--", "--NODE7--", "--NODE8--"] + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": [ + { + "name": "step to sleep for a random period", + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { + "linux": ["sleep $((RANDOM % 120))"] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": {}, + "retryCount": 1, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [] + } + ] + } +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/multi-node-multi-group-job-immediate-sequential-batched.yaml b/_vendor/github.com/chef/samples/courier-job-examples/multi-node-multi-group-job-immediate-sequential-batched.yaml new file mode 100644 index 0000000000..348d8b9164 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/multi-node-multi-group-job-immediate-sequential-batched.yaml @@ -0,0 +1,69 @@ +--- +name: multi-node-multi-group-job-batching +description: + demonstrating an immediate job executing sequential on multiple nodes + with batched rollout +scheduleRule: immediate +exceptionRules: [] +target: + executionType: sequential + groups: + - timeoutSeconds: 300 + batchSize: + type: number + value: 2 + distributionMethod: batching + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: nodes + nodeIdentifiers: + - "--NODE1--" + - "--NODE2--" + - "--NODE3--" + - "--NODE4--" + - "--NODE5--" + - timeoutSeconds: 300 + batchSize: + type: number + value: 2 + distributionMethod: batching + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: nodes + nodeIdentifiers: + - "--NODE6--" + - "--NODE7--" + - "--NODE8--" +actions: + accessMode: agent + steps: + - name: step to sleep for a random period + interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + command: + linux: + - sleep $((RANDOM % 120)) + inputs: {} + expectedInputs: {} + outputFieldRules: {} + retryCount: 1 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] diff --git a/_vendor/github.com/chef/samples/courier-job-examples/multi-node-one-group-immediate-rolling-linux.json b/_vendor/github.com/chef/samples/courier-job-examples/multi-node-one-group-immediate-rolling-linux.json new file mode 100644 index 0000000000..4069685570 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/multi-node-one-group-immediate-rolling-linux.json @@ -0,0 +1,65 @@ +{ + "name": "multi-node-one-group-immediate-rolling", + "description": "demonstrating a immediate job executing sequential on batches of percentage", + "scheduleRule": "immediate", + "exceptionRules": [], + "target": { + "executionType": "sequential", + "groups": [ + { + "timeoutSeconds": 300, + "batchSize": { + "type": "percent", + "value": 20 + }, + "distributionMethod": "rolling", + "successCriteria": [ + { + "numRuns": { "type": "percent", "value": 100 }, + "status": "success" + } + ], + "nodeListType": "nodes", + "nodeIdentifiers": [ + "--NODE1--", + "--NODE2--", + "--NODE3--", + "--NODE4--", + "--NODE5--" + ] + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": [ + { + "name": "step to sleep for a random period", + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { + "linux": ["sleep $((RANDOM % 120))"] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": {}, + "retryCount": 1, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "none", + "delaySeconds": 1, + "arguments": [] + } + }, + "limits": {}, + "conditions": [] + } + ] + } +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/multi-node-one-group-immediate-rolling-linux.yaml b/_vendor/github.com/chef/samples/courier-job-examples/multi-node-one-group-immediate-rolling-linux.yaml new file mode 100644 index 0000000000..8b92e37458 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/multi-node-one-group-immediate-rolling-linux.yaml @@ -0,0 +1,49 @@ +--- +name: multi-node-one-group-immediate-rolling +description: demonstrating a immediate job executing sequential on batches of percentage +scheduleRule: immediate +exceptionRules: [] +target: + executionType: sequential + groups: + - timeoutSeconds: 300 + batchSize: + type: percent + value: 20 + distributionMethod: rolling + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: nodes + nodeIdentifiers: + - "--NODE1--" + - "--NODE2--" + - "--NODE3--" + - "--NODE4--" + - "--NODE5--" +actions: + accessMode: agent + steps: + - name: step to sleep for a random period + interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + command: + linux: + - sleep $((RANDOM % 120)) + inputs: {} + expectedInputs: {} + outputFieldRules: {} + retryCount: 1 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: none + delaySeconds: 1 + arguments: [] + limits: {} + conditions: [] diff --git a/_vendor/github.com/chef/samples/courier-job-examples/multi-node-two-groups-immediate-parallel-linux.json b/_vendor/github.com/chef/samples/courier-job-examples/multi-node-two-groups-immediate-parallel-linux.json new file mode 100644 index 0000000000..b4679de37c --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/multi-node-two-groups-immediate-parallel-linux.json @@ -0,0 +1,76 @@ +{ + "name": "multi-node-two-groups-immediate-parallel-linux", + "description": "demonstrating an immediate job executing parallel on multi nodes", + "scheduleRule": "immediate", + "exceptionRules": [], + "target": { + "executionType": "parallel", + "groups": [ + { + "timeoutSeconds": 1500, + "batchSize": { + "type": "number", + "value": 1 + }, + "distributionMethod": "batching", + "successCriteria": [ + { + "numRuns": { "type": "percent", "value": 100 }, + "status": "success" + } + ], + "nodeListType": "nodes", + "nodeIdentifiers": ["--NODE1--", "--NODE2--"] + }, + { + "timeoutSeconds": 1500, + "batchSize": { + "type": "number", + "value": 1 + }, + "distributionMethod": "batching", + "successCriteria": [ + { + "numRuns": { "type": "percent", "value": 100 }, + "status": "success" + } + ], + "nodeListType": "nodes", + "nodeIdentifiers": ["--NODE3--", "--NODE4--", "--NODE5--"] + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": [ + { + "name": "step to sleep", + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { + "linux": ["sleep 10"], + "windows": ["timeout 10"] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": {}, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [] + } + ] + } +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/multi-node-two-groups-immediate-parallel-linux.yaml b/_vendor/github.com/chef/samples/courier-job-examples/multi-node-two-groups-immediate-parallel-linux.yaml new file mode 100644 index 0000000000..dbbb860f6c --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/multi-node-two-groups-immediate-parallel-linux.yaml @@ -0,0 +1,66 @@ +--- +name: multi-node-two-groups-immediate-parallel-linux +description: demonstrating an immediate job executing parallel on multi nodes +scheduleRule: immediate +exceptionRules: [] +target: + executionType: parallel + groups: + - timeoutSeconds: 1500 + batchSize: + type: number + value: 1 + distributionMethod: batching + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: nodes + nodeIdentifiers: + - "--NODE1--" + - "--NODE2--" + - timeoutSeconds: 1500 + batchSize: + type: number + value: 1 + distributionMethod: batching + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: nodes + nodeIdentifiers: + - "--NODE3--" + - "--NODE4--" + - "--NODE5--" +actions: + accessMode: agent + steps: + - name: step to sleep + interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + command: + linux: + - sleep 10 + windows: + - timeout 10 + inputs: {} + expectedInputs: {} + outputFieldRules: {} + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] diff --git a/_vendor/github.com/chef/samples/courier-job-examples/nginx_install_linux.json b/_vendor/github.com/chef/samples/courier-job-examples/nginx_install_linux.json new file mode 100644 index 0000000000..7c6b93f211 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/nginx_install_linux.json @@ -0,0 +1,222 @@ +{ + "name": "nginx-install", + "description": "A simple demonstration that shows a multi-step job that declares outputs and evaluates inputs to install or configure applications conditionally", + "scheduleRule": "immediate", + "exceptionRules": [], + "target": { + "executionType": "sequential", + "groups": [ + { + "timeoutSeconds": 160, + "batchSize": { + "type": "number", + "value": 1 + }, + "distributionMethod": "rolling", + "successCriteria": [ + { + "numRuns": { + "type": "percent", + "value": 100 + }, + "status": "success" + } + ], + "nodeListType": "nodes", + "nodeIdentifiers": ["--NODE1--"] + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": [ + { + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { + "linux": ["which nginx >/dev/null && echo true || echo false"] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": { + "NGINX_FOUND": { + "source": "stdout", + "sourceType": "output", + "extractMethod": "content", + "expression": "", + "required": true, + "sensitive": false + } + }, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [] + } + }, + "limits": {}, + "conditions": [], + "name": "a step to check nginx presence" + }, + { + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "inputs": {}, + "expectedInputs": { + "NGINX_FOUND": { + "type": "string", + "sensitive": false, + "required": true, + "default": "" + } + }, + "outputFieldRules": {}, + "conditions": [ + { + "inputName": "NGINX_FOUND", + "operator": "eq", + "value": "false\n" + } + ], + "command": { + "linux": [ + "yum install nginx -y 2>&1 >/dev/null", + "systemctl enable nginx 2>&1 >/dev/null", + "systemctl start nginx 2>&1 >/dev/null" + ] + }, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [] + } + }, + "limits": {}, + "name": "install nginx conditionally" + }, + { + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { + "linux": [ + "curl -s http://localhost:80 | grep 'hello world!' >/dev/null && echo true || echo false" + ] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": { + "EXPECTED_PAGE_FOUND": { + "source": "stdout", + "sourceType": "output", + "extractMethod": "content", + "expression": "", + "required": true, + "sensitive": false + } + }, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [] + } + }, + "limits": {}, + "conditions": [], + "name": "check if nginx is configured" + }, + { + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "inputs": {}, + "expectedInputs": { + "EXPECTED_PAGE_FOUND": { + "type": "string", + "sensitive": false, + "required": true, + "default": "" + } + }, + "outputFieldRules": {}, + "conditions": [ + { + "inputName": "EXPECTED_PAGE_FOUND", + "operator": "eq", + "value": "false\n" + } + ], + "command": { + "linux": [ + "echo '

hello world!

' | sudo tee /usr/share/nginx/html/index.html > /dev/null" + ] + }, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [] + } + }, + "limits": {}, + "name": "configure nginx if not already" + }, + { + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { + "linux": ["curl -s http://localhost:80 | grep 'hello world!'"] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": {}, + "conditions": [], + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [] + } + }, + "limits": {}, + "name": "check if nginx is properly configured" + } + ] + } +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/nginx_install_linux.yaml b/_vendor/github.com/chef/samples/courier-job-examples/nginx_install_linux.yaml new file mode 100644 index 0000000000..564c837c12 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/nginx_install_linux.yaml @@ -0,0 +1,169 @@ +--- +name: nginx-install +description: + A simple demonstration that shows a multi-step job that declares outputs + and evaluates inputs to install or configure applications conditionally +scheduleRule: immediate +exceptionRules: [] +target: + executionType: sequential + groups: + - timeoutSeconds: 160 + batchSize: + type: number + value: 1 + distributionMethod: rolling + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: nodes + nodeIdentifiers: + - "--NODE1--" +actions: + accessMode: agent + steps: + - interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + command: + linux: + - which nginx >/dev/null && echo true || echo false + inputs: {} + expectedInputs: {} + outputFieldRules: + NGINX_FOUND: + source: stdout + sourceType: output + extractMethod: content + expression: "" + required: true + sensitive: false + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: [] + limits: {} + conditions: [] + name: a step to check nginx presence + - interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + inputs: {} + expectedInputs: + NGINX_FOUND: + type: string + sensitive: false + required: true + default: "" + outputFieldRules: {} + conditions: + - inputName: NGINX_FOUND + operator: eq + value: "false + + " + command: + linux: + - yum install nginx -y 2>&1 >/dev/null + - systemctl enable nginx 2>&1 >/dev/null + - systemctl start nginx 2>&1 >/dev/null + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: [] + limits: {} + name: install nginx conditionally + - interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + command: + linux: + - "curl -s http://localhost:80 | grep 'hello world!' >/dev/null && echo true + || echo false" + inputs: {} + expectedInputs: {} + outputFieldRules: + EXPECTED_PAGE_FOUND: + source: stdout + sourceType: output + extractMethod: content + expression: "" + required: true + sensitive: false + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: [] + limits: {} + conditions: [] + name: check if nginx is configured + - interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + inputs: {} + expectedInputs: + EXPECTED_PAGE_FOUND: + type: string + sensitive: false + required: true + default: "" + outputFieldRules: {} + conditions: + - inputName: EXPECTED_PAGE_FOUND + operator: eq + value: "false + + " + command: + linux: + - "echo '

hello world!

' | sudo tee /usr/share/nginx/html/index.html + > /dev/null" + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: [] + limits: {} + name: configure nginx if not already + - interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + command: + linux: + - curl -s http://localhost:80 | grep 'hello world!' + inputs: {} + expectedInputs: {} + outputFieldRules: {} + conditions: [] + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: [] + limits: {} + name: check if nginx is properly configured diff --git a/_vendor/github.com/chef/samples/courier-job-examples/nginx_patch.json b/_vendor/github.com/chef/samples/courier-job-examples/nginx_patch.json new file mode 100644 index 0000000000..9318159f9b --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/nginx_patch.json @@ -0,0 +1,154 @@ +{ + "name": "nginx-patch", + "description": "A simple demonstration to showcase patching an installed application", + "scheduleRule": "immediate", + "exceptionRules": [], + "target": { + "executionType": "sequential", + "groups": [ + { + "timeoutSeconds": 300, + "batchSize": { + "type": "number", + "value": 2 + }, + "distributionMethod": "batching", + "successCriteria": [ + { + "numRuns": { "type": "percent", "value": 100 }, + "status": "success" + } + ], + "nodeListType": "nodes", + "nodeIdentifiers": ["--NODE1--"] + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": [ + { + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { "linux": ["nginx -v 2>&1 >/dev/null"] }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": { + "NGINX_FOUND": { + "source": "stdout", + "sourceType": "output", + "extractMethod": "content", + "expression": "", + "required": true, + "sensitive": false + } + }, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [] + } + }, + "limits": {}, + "conditions": [], + "name": "a step to check nginx presence" + }, + { + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "inputs": {}, + "expectedInputs": { + "NGINX_FOUND": { + "type": "string", + "sensitive": false, + "required": true, + "default": "" + } + }, + "outputFieldRules": {}, + "conditions": [ + { + "inputName": "NGINX_FOUND", + "operator": "eq", + "value": "nginx version: nginx/1.25.0\n" + } + ], + "command": { "linux": ["sleep 5"] }, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [] + } + }, + "limits": {}, + "name": "Sleep if nginx version is 1.25.0" + }, + { + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "inputs": {}, + "expectedInputs": { + "NGINX_FOUND": { + "type": "string", + "sensitive": false, + "required": true, + "default": "" + } + }, + "outputFieldRules": {}, + "conditions": [ + { + "inputName": "NGINX_FOUND", + "operator": "eq", + "value": "nginx version: nginx/1.23.4\n" + } + ], + "command": { + "linux": [ + "sudo apt-get remove nginx nginx-common -y", + "sudo apt-get purge nginx nginx-common -y", + "wget http://nginx.org/keys/nginx_signing.key 2>&1 >/dev/null", + "sudo apt-key add nginx_signing.key", + "sudo add-apt-repository \"deb http://nginx.org/packages/mainline/ubuntu/ $(lsb_release -sc) nginx\" 2>&1 >/dev/null", + "sudo apt-get update", + "sudo apt-get install nginx=1.25.0-1~$(lsb_release -sc) 2>&1 >/dev/null", + "sudo systemctl enable nginx", + "sudo systemctl start nginx" + ] + }, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [] + } + }, + "limits": {}, + "name": "Install nginx 1.25.0, if the version is 1.23.4" + } + ] + } +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/nginx_patch.yaml b/_vendor/github.com/chef/samples/courier-job-examples/nginx_patch.yaml new file mode 100644 index 0000000000..2b76a214f8 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/nginx_patch.yaml @@ -0,0 +1,123 @@ +--- +name: nginx-patch +description: A simple demonstration to showcase patching an installed application +scheduleRule: immediate +exceptionRules: [] +target: + executionType: sequential + groups: + - timeoutSeconds: 300 + batchSize: + type: number + value: 2 + distributionMethod: batching + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: nodes + nodeIdentifiers: + - "--NODE1--" +actions: + accessMode: agent + steps: + - interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + command: + linux: + - nginx -v 2>&1 >/dev/null + inputs: {} + expectedInputs: {} + outputFieldRules: + NGINX_FOUND: + source: stdout + sourceType: output + extractMethod: content + expression: "" + required: true + sensitive: false + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: [] + limits: {} + conditions: [] + name: a step to check nginx presence + - interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + inputs: {} + expectedInputs: + NGINX_FOUND: + type: string + sensitive: false + required: true + default: "" + outputFieldRules: {} + conditions: + - inputName: NGINX_FOUND + operator: eq + value: "nginx version: nginx/1.25.0 + + " + command: + linux: + - sleep 5 + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: [] + limits: {} + name: Sleep if nginx version is 1.25.0 + - interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + inputs: {} + expectedInputs: + NGINX_FOUND: + type: string + sensitive: false + required: true + default: "" + outputFieldRules: {} + conditions: + - inputName: NGINX_FOUND + operator: eq + value: "nginx version: nginx/1.23.4 + + " + command: + linux: + - sudo apt-get remove nginx nginx-common -y + - sudo apt-get purge nginx nginx-common -y + - wget http://nginx.org/keys/nginx_signing.key 2>&1 >/dev/null + - sudo apt-key add nginx_signing.key + - sudo add-apt-repository "deb http://nginx.org/packages/mainline/ubuntu/ $(lsb_release + -sc) nginx" 2>&1 >/dev/null + - sudo apt-get update + - sudo apt-get install nginx=1.25.0-1~$(lsb_release -sc) 2>&1 >/dev/null + - sudo systemctl enable nginx + - sudo systemctl start nginx + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: [] + limits: {} + name: Install nginx 1.25.0, if the version is 1.23.4 diff --git a/_vendor/github.com/chef/samples/courier-job-examples/nodeman-query-immediate-linux.json b/_vendor/github.com/chef/samples/courier-job-examples/nodeman-query-immediate-linux.json new file mode 100644 index 0000000000..8ce2972f5e --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/nodeman-query-immediate-linux.json @@ -0,0 +1,85 @@ +{ + "name": "nodeman-query-immediate-linux", + "description": "Demonstrating a courier job using an adhoc search query against different sample atttributes as target", + "scheduleRule": "immediate", + "exceptionRules": [], + "target": { + "executionType": "sequential", + "groups": [ + { + "timeoutSeconds": 3000, + "batchSize": { + "type": "number", + "value": 1 + }, + "distributionMethod": "batching", + "successCriteria": [ + { + "numRuns": { "type": "percent", "value": 100 }, + "status": "success" + } + ], + "nodeListType": "filter", + "filter": { + "constraints": { + "attributes": [ + { + "name": "kernel_name", + "operator": "=", + "value": ["Linux"] + }, + { + "name": "primary_ip", + "operator": "MATCHES", + "value": ["^172\\.31\\.29.*"] + } + ], + "skills": [ + { + "name": "courier-runner", + "version": ["<= 1.9.996"] + }, + { + "name": "chef-gohai", + "version": ["= 0.1.0"] + } + ] + } + } + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": [ + { + "name": "step to sleep", + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { + "linux": ["sleep 10"], + "windows": ["timeout 10"] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": {}, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [] + } + ] + } +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/nodeman-saved-list-immediate.json b/_vendor/github.com/chef/samples/courier-job-examples/nodeman-saved-list-immediate.json new file mode 100644 index 0000000000..7758bce15b --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/nodeman-saved-list-immediate.json @@ -0,0 +1,60 @@ +{ + "name": "nodeman-saved-list-immediate-linux", + "description": "demonstrating a courier job utilising a saved node list", + "scheduleRule": "immediate", + "exceptionRules": [], + "target": { + "executionType": "sequential", + "groups": [ + { + "timeoutSeconds": 3000, + "batchSize": { + "type": "number", + "value": 1 + }, + "distributionMethod": "batching", + "successCriteria": [ + { + "numRuns": { "type": "percent", "value": 100 }, + "status": "success" + } + ], + "nodeListType": "savedList", + "listId": "--LISTID1--" + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": [ + { + "name": "step to sleep", + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { + "linux": ["sleep 10"], + "windows": ["timeout 10"] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": {}, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [] + } + ] + } +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/nodeman-saved-list-immediate.yaml b/_vendor/github.com/chef/samples/courier-job-examples/nodeman-saved-list-immediate.yaml new file mode 100644 index 0000000000..a40ca3725d --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/nodeman-saved-list-immediate.yaml @@ -0,0 +1,49 @@ +--- +name: nodeman-saved-list-immediate-linux +description: demonstrating a courier job utilising a saved node list +scheduleRule: immediate +exceptionRules: [] +target: + executionType: sequential + groups: + - timeoutSeconds: 3000 + batchSize: + type: number + value: 1 + distributionMethod: batching + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: savedList + listId: "--LISTID1--" +actions: + accessMode: agent + steps: + - name: step to sleep + interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + command: + linux: + - sleep 10 + windows: + - timeout 10 + inputs: {} + expectedInputs: {} + outputFieldRules: {} + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] diff --git a/_vendor/github.com/chef/samples/courier-job-examples/nodeman-saved-query-immediate-linux.json b/_vendor/github.com/chef/samples/courier-job-examples/nodeman-saved-query-immediate-linux.json new file mode 100644 index 0000000000..7dd3c1e7e7 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/nodeman-saved-query-immediate-linux.json @@ -0,0 +1,60 @@ +{ + "name": "nodeman-saved-filter-immediate-linux", + "description": "Demonstrating a courier job utlising a saved node filter", + "scheduleRule": "immediate", + "exceptionRules": [], + "target": { + "executionType": "sequential", + "groups": [ + { + "timeoutSeconds": 3000, + "batchSize": { + "type": "number", + "value": 1 + }, + "distributionMethod": "batching", + "successCriteria": [ + { + "numRuns": { "type": "percent", "value": 100 }, + "status": "success" + } + ], + "nodeListType": "savedFilter", + "filterId": "--FILTERID1--" + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": [ + { + "name": "step to sleep", + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { + "linux": ["sleep 10"], + "windows": ["timeout 10"] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": {}, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [] + } + ] + } +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/nodeman-saved-query-immediate-linux.yaml b/_vendor/github.com/chef/samples/courier-job-examples/nodeman-saved-query-immediate-linux.yaml new file mode 100644 index 0000000000..9561f02b75 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/nodeman-saved-query-immediate-linux.yaml @@ -0,0 +1,49 @@ +--- +name: nodeman-saved-filter-immediate-linux +description: Demonstrating a courier job utlising a saved node filter +scheduleRule: immediate +exceptionRules: [] +target: + executionType: sequential + groups: + - timeoutSeconds: 3000 + batchSize: + type: number + value: 1 + distributionMethod: batching + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: savedFilter + filterId: "--FILTERID1--" +actions: + accessMode: agent + steps: + - name: step to sleep + interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + command: + linux: + - sleep 10 + windows: + - timeout 10 + inputs: {} + expectedInputs: {} + outputFieldRules: {} + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] diff --git a/_vendor/github.com/chef/samples/courier-job-examples/single-node-job-future-linux.json b/_vendor/github.com/chef/samples/courier-job-examples/single-node-job-future-linux.json new file mode 100644 index 0000000000..bd21c2ad7a --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/single-node-job-future-linux.json @@ -0,0 +1,60 @@ +{ + "name": "single-node-job-future-linux", + "description": "demonstrating a scheduled job executing on a specific day", + "scheduleRule": "RRULE:FREQ=MINUTELY;COUNT=2;WKST=MO", + "exceptionRules": [], + "target": { + "executionType": "sequential", + "groups": [ + { + "timeoutSeconds": 300, + "batchSize": { + "type": "number", + "value": 1 + }, + "distributionMethod": "batching", + "successCriteria": [ + { + "numRuns": { "type": "percent", "value": 100 }, + "status": "success" + } + ], + "nodeListType": "nodes", + "nodeIdentifiers": ["--NODE1--"] + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": [ + { + "name": "step to sleep", + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { + "linux": ["sleep 10"], + "windows": ["timeout 10"] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": {}, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [] + } + ] + } +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/single-node-job-future-linux.yaml b/_vendor/github.com/chef/samples/courier-job-examples/single-node-job-future-linux.yaml new file mode 100644 index 0000000000..60650e4804 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/single-node-job-future-linux.yaml @@ -0,0 +1,50 @@ +--- +name: single-node-job-future-linux +description: demonstrating a scheduled job executing on a specific day +scheduleRule: RRULE:FREQ=MINUTELY;COUNT=2;WKST=MO +exceptionRules: [] +target: + executionType: sequential + groups: + - timeoutSeconds: 300 + batchSize: + type: number + value: 1 + distributionMethod: batching + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: nodes + nodeIdentifiers: + - "--NODE1--" +actions: + accessMode: agent + steps: + - name: step to sleep + interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + command: + linux: + - sleep 10 + windows: + - timeout 10 + inputs: {} + expectedInputs: {} + outputFieldRules: {} + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] diff --git a/_vendor/github.com/chef/samples/courier-job-examples/single-node-job-reoccurring-exception.json b/_vendor/github.com/chef/samples/courier-job-examples/single-node-job-reoccurring-exception.json new file mode 100644 index 0000000000..9bf5c93be4 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/single-node-job-reoccurring-exception.json @@ -0,0 +1,65 @@ +{ + "name": "single-node-job-reoccurring-linux", + "description": "demonstrating a scheduled job that runs multiple times with exceptions", + "scheduleRule": "RRULE:FREQ=MINUTELY;COUNT=10", + "exceptionRules": [ + { + "rrule": "RRULE:FREQ=MINUTELY;INTERVAL=3", + "duration": 1 + } + ], + "target": { + "executionType": "sequential", + "groups": [ + { + "timeoutSeconds": 300, + "batchSize": { + "type": "number", + "value": 1 + }, + "distributionMethod": "batching", + "successCriteria": [ + { + "numRuns": { "type": "percent", "value": 100 }, + "status": "success" + } + ], + "nodeListType": "nodes", + "nodeIdentifiers": ["--NODE1--"] + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": [ + { + "name": "step to sleep", + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { + "linux": ["sleep 10"], + "windows": ["timeout 10"] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": {}, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [] + } + ] + } +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/single-node-job-reoccurring-exception.yaml b/_vendor/github.com/chef/samples/courier-job-examples/single-node-job-reoccurring-exception.yaml new file mode 100644 index 0000000000..dea66fdcef --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/single-node-job-reoccurring-exception.yaml @@ -0,0 +1,52 @@ +--- +name: single-node-job-reoccurring-linux +description: demonstrating a scheduled job that runs multiple times with exceptions +scheduleRule: RRULE:FREQ=MINUTELY;COUNT=10 +exceptionRules: + - rrule: RRULE:FREQ=MINUTELY;INTERVAL=3 + duration: 1 +target: + executionType: sequential + groups: + - timeoutSeconds: 300 + batchSize: + type: number + value: 1 + distributionMethod: batching + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: nodes + nodeIdentifiers: + - "--NODE1--" +actions: + accessMode: agent + steps: + - name: step to sleep + interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 1.9.99 + name: chef-platform/shell-interpreter + command: + linux: + - sleep 10 + windows: + - timeout 10 + inputs: {} + expectedInputs: {} + outputFieldRules: {} + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] diff --git a/_vendor/github.com/chef/samples/courier-job-examples/ssl_cert_rotation.json b/_vendor/github.com/chef/samples/courier-job-examples/ssl_cert_rotation.json new file mode 100644 index 0000000000..cb0ccbe1a1 --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/ssl_cert_rotation.json @@ -0,0 +1,185 @@ +{ + "name": "Certificate rotation", + "description": "A job to demonstrate how on demand certificate rotation can be performed on servers. It uses inspec to check for expiry and shell for fixing", + "scheduleRule": "immediate", + "exceptionRules": [], + "target": { + "executionType": "sequential", + "groups": [ + { + "timeoutSeconds": 120, + "batchSize": { + "type": "number", + "value": 1 + }, + "distributionMethod": "batching", + "successCriteria": [ + { + "numRuns": { + "type": "percent", + "value": 100 + }, + "status": "success" + } + ], + "nodeListType": "nodes", + "nodeIdentifiers": ["--NODE1--"] + } + ] + }, + "actions": { + "accessMode": "agent", + "steps": [ + { + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "6.6.0" + }, + "name": "chef-platform/inspec-interpreter" + }, + "command": { + "exec": "scan", + "args": { + "path": "https://github.com/akshayparvatikar29/cert-compliance" + } + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": { + "INSPEC_VALUE": { + "source": "stdout", + "sourceType": "output", + "extractMethod": "regEx", + "expression": "0 successful", + "required": true, + "sensitive": false + } + }, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "none", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [], + "name": "checking the certificate" + }, + { + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "6.6.0" + }, + "name": "chef-platform/shell-interpreter" + }, + "inputs": {}, + "expectedInputs": { + "INSPEC_VALUE": { + "type": "string", + "sensitive": false, + "required": true, + "default": "" + } + }, + "outputFieldRules": {}, + "conditions": [ + { + "inputName": "INSPEC_VALUE", + "operator": "eq", + "value": "0 successful" + } + ], + "command": { + "linux": [ + "sudo openssl genrsa -out /home/ec2-user/compliance/certificates/server-aug24.key 2048", + "sudo openssl req -new -key /home/ec2-user/compliance/certificates/server-aug24.key -out /home/ec2-user/compliance/certificates/server-aug24.csr -config /home/ec2-user/compliance/certificates/san.cnf", + "sudo openssl x509 -req -days 31 -in /home/ec2-user/compliance/certificates/server-aug24.csr -signkey /home/ec2-user/compliance/certificates/server-aug24.key -out /home/ec2-user/compliance/certificates/server-aug24.crt -extensions req_ext -extfile /home/ec2-user/compliance/certificates/san.cnf" + ] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": {}, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "none", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [], + "name": "creating certificate" + }, + { + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { + "linux": [ + "sudo printf '\nServerName 34.224.75.161\nDocumentRoot /var/www/html\nSSLEngine on\nSSLCertificateFile /home/ec2-user/compliance/certificates/server-aug24.crt\nSSLCertificateKeyFile /home/ec2-user/compliance/certificates/server-aug24.key\n'>>/etc/httpd/conf.d/Certificate_Details.conf", + "sudo yum install mod_ssl" + ] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": {}, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [], + "name": "create a file and add certificate details" + }, + { + "interpreter": { + "skill": { + "minVersion": "1.0.0", + "maxVersion": "1.9.99" + }, + "name": "chef-platform/shell-interpreter" + }, + "command": { + "linux": [ + "sudo systemctl restart httpd.service", + "sudo systemctl start firewalld", + "sudo systemctl enable firewalld", + "sudo firewall-cmd --add-service=https", + "sudo firewall-cmd --add-service=http" + ] + }, + "inputs": {}, + "expectedInputs": {}, + "outputFieldRules": {}, + "retryCount": 2, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "type": "linear", + "delaySeconds": 1, + "arguments": [1, 3, 5] + } + }, + "limits": {}, + "conditions": [], + "name": "Restart httpd service and setup firewall" + } + ] + } +} diff --git a/_vendor/github.com/chef/samples/courier-job-examples/ssl_cert_rotation.yaml b/_vendor/github.com/chef/samples/courier-job-examples/ssl_cert_rotation.yaml new file mode 100644 index 0000000000..5ee4524b4c --- /dev/null +++ b/_vendor/github.com/chef/samples/courier-job-examples/ssl_cert_rotation.yaml @@ -0,0 +1,147 @@ +--- +name: Certificate rotation +description: A job to demonstrate how on demand certificate rotation can be performed + on servers. It uses inspec to check for expiry and shell for fixing +scheduleRule: immediate +exceptionRules: [] +target: + executionType: sequential + groups: + - timeoutSeconds: 120 + batchSize: + type: number + value: 1 + distributionMethod: batching + successCriteria: + - numRuns: + type: percent + value: 100 + status: success + nodeListType: nodes + nodeIdentifiers: + - "--NODE1--" +actions: + accessMode: agent + steps: + - interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 6.6.0 + name: chef-platform/inspec-interpreter + command: + exec: scan + args: + path: https://github.com/akshayparvatikar29/cert-compliance + inputs: {} + expectedInputs: {} + outputFieldRules: + INSPEC_VALUE: + source: stdout + sourceType: output + extractMethod: regEx + expression: 0 successful + required: true + sensitive: false + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: none + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] + name: checking the certificate + - interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 6.6.0 + name: chef-platform/shell-interpreter + inputs: {} + expectedInputs: {} + outputFieldRules: {} + conditions: [] + command: + linux: + - sudo openssl genrsa -out /home/ec2-user/compliance/certificates/server-aug24.key + 2048 + - sudo openssl req -new -key /home/ec2-user/compliance/certificates/server-aug24.key + -out /home/ec2-user/compliance/certificates/server-aug24.csr -config /home/ec2-user/compliance/certificates/san.cnf + - sudo openssl x509 -req -days 31 -in /home/ec2-user/compliance/certificates/server-aug24.csr + -signkey /home/ec2-user/compliance/certificates/server-aug24.key -out /home/ec2-user/compliance/certificates/server-aug24.crt + -extensions req_ext -extfile /home/ec2-user/compliance/certificates/san.cnf + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: none + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + name: creating certificate + - interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 6.6.0 + name: chef-platform/shell-interpreter + command: + linux: + - |- + sudo printf ' + ServerName 34.224.75.161 + DocumentRoot /var/www/html + SSLEngine on + SSLCertificateFile /home/ec2-user/compliance/certificates/server-aug24.crt + SSLCertificateKeyFile /home/ec2-user/compliance/certificates/server-aug24.key + '>>/etc/httpd/conf.d/Certificate_Details.conf + - sudo yum install mod_ssl + inputs: {} + expectedInputs: {} + outputFieldRules: {} + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] + name: create a file and add certificate details + - interpreter: + skill: + minVersion: 1.0.0 + maxVersion: 6.6.0 + name: chef-platform/shell-interpreter + command: + linux: + - sudo systemctl restart httpd.service + - sudo systemctl start firewalld + - sudo systemctl enable firewalld + - sudo firewall-cmd --add-service=https + - sudo firewall-cmd --add-service=http + inputs: {} + expectedInputs: {} + outputFieldRules: {} + retryCount: 2 + failureBehavior: + action: retryThenFail + retryBackoffStrategy: + type: linear + delaySeconds: 1 + arguments: + - 1 + - 3 + - 5 + limits: {} + conditions: [] + name: Restart httpd service and setup firewall diff --git a/_vendor/github.com/chef/samples/skills/chef-client-interpreter.json b/_vendor/github.com/chef/samples/skills/chef-client-interpreter.json new file mode 100644 index 0000000000..2c03ef96eb --- /dev/null +++ b/_vendor/github.com/chef/samples/skills/chef-client-interpreter.json @@ -0,0 +1,9 @@ +{ + "name": "chef-client-interpreter", + "canister": { + "origin": "chef-platform", + "name": "chef-client-interpreter", + "service": false + }, + "configurationTemplates": [] +} \ No newline at end of file diff --git a/_vendor/github.com/chef/samples/skills/courier-runner-skill.json b/_vendor/github.com/chef/samples/skills/courier-runner-skill.json new file mode 100644 index 0000000000..d96f8ccae2 --- /dev/null +++ b/_vendor/github.com/chef/samples/skills/courier-runner-skill.json @@ -0,0 +1,17 @@ +{ + "name": "courier-runner", + "canister": { + "name": "courier-runner", + "origin": "chef-platform", + "service": true + }, + "configurationTemplates": [ + { + "content": "W2xvZ10KZGlyID0gInt7LnNldHRpbmdzLmxvZ19kaXJ9fSIKZm9ybWF0ID0gInt7LnNldHRpbmdzLmxvZ19mb3JtYXR9fSIKbGV2ZWwgPSAie3suc2V0dGluZ3MubG9nX2xldmVsfX0iCm91dHB1dCA9ICJ7ey5zZXR0aW5ncy5sb2dfb3V0cHV0fX0iCgpbbm9kZV0Kbm9kZV9pZCA9ICJ7ey5hZ2VudC5ub2RlSWR9fSIKCnt7aWYgaW5kZXggLnNldHRpbmdzICJzaGVsbF9pbnRlcnByZXRlciJ9fQpbW2ludGVycHJldGVyc11dCm5hbWUgPSAie3suc2V0dGluZ3Muc2hlbGxfaW50ZXJwcmV0ZXJ9fSIKe3tlbmR9fQp7e2lmIGluZGV4IC5zZXR0aW5ncyAicmVzdGFydF9pbnRlcnByZXRlciJ9fQpbW2ludGVycHJldGVyc11dCm5hbWUgPSAie3suc2V0dGluZ3MucmVzdGFydF9pbnRlcnByZXRlcn19Igp7e2VuZH19Cnt7aWYgaW5kZXggLnNldHRpbmdzICJpbnNwZWNfaW50ZXJwcmV0ZXIifX0KW1tpbnRlcnByZXRlcnNdXQpuYW1lID0gInt7LnNldHRpbmdzLmluc3BlY19pbnRlcnByZXRlcn19Igp7e2VuZH19Cnt7aWYgaW5kZXggLnNldHRpbmdzICJjaGVmX2NsaWVudF9pbnRlcnByZXRlciJ9fQpbW2ludGVycHJldGVyc11dCm5hbWUgPSAie3suc2V0dGluZ3MuY2hlZl9jbGllbnRfaW50ZXJwcmV0ZXJ9fSIKe3tlbmR9fQoKW3JlcG9ydGVyXQpuYW1lID0gInt7LnNldHRpbmdzLnJlcG9ydGVyX25hbWV9fSIKYXV0aGVudGljYXRpb25UeXBlID0gICJ7ey5zZXR0aW5ncy5yZXBvcnRlcl9hdXRoZW50aWNhdGlvbl90eXBlfX0iCmRpciA9ICJ7ey5zZXR0aW5ncy5yZXBvcnRlcl9kaXJ9fSIKaW50ZXJuYWxJblNlYyA9IHt7LnNldHRpbmdzLnJlcG9ydGVyX2ludGVydmFsX2luX3NlY319CnJldHJ5SW50ZXJ2YWxJblNlYyA9IHt7LnNldHRpbmdzLnJlcG9ydGVyX3JldHJ5X2ludGVydmFsX2luX3NlY319CnRvdGFsUmV0cnlEdXJhdGlvbkluTWluID0ge3suc2V0dGluZ3MucmVwb3J0ZXJfdG90YWxfcmV0cnlfZHVyYXRpb25faW5fbWlufX0KCltnYXRld2F5X2NvbmZpZ10KdGVuYW50ZnFkbnMgPSAie3suYWdlbnQudGVuYW50RnFkbnN9fSIKbm9kZV9yb2xlX2xpbmtfaWQgPSAie3suc2tpbGwubm9kZVJvbGVMaW5rSWR9fSIKcGxhdGZvcm1fY3JlZGVudGlhbF9wYXRoID0gInt7LnNraWxsLnBsYXRmb3JtQ3JlZGVudGlhbHNQYXRofX0iCnJvb3RfY2FfcGF0aCA9ICJ7ey5hZ2VudC5yb290Q2FQYXRofX0iCmluc2VjdXJlID0gInt7LmFnZW50Lmluc2VjdXJlfX0iCgpbcXVldWVdCnByb3ZpZGVyID0gMA==", + "fileName": "user.toml", + "filePath": "/hab/user/courier-runner/config", + "name": "courier-runner-template", + "windowsFilePath": "c:\\hab\\user\\courier-runner\\config" + } + ] +} diff --git a/_vendor/github.com/chef/samples/skills/gohai-skill.json b/_vendor/github.com/chef/samples/skills/gohai-skill.json new file mode 100644 index 0000000000..4f08e0ec34 --- /dev/null +++ b/_vendor/github.com/chef/samples/skills/gohai-skill.json @@ -0,0 +1,17 @@ +{ + "name": "chef-gohai", + "canister": { + "origin": "chef-platform", + "name": "chef-gohai", + "service": true + }, + "configurationTemplates": [ + { + "content": "W2dvaGFpXQpub2RlX2lkID0gInt7LmFnZW50Lm5vZGVJZH19Igpub2RlX3JvbGVfbGlua19pZCA9ICJ7ey5za2lsbC5ub2RlUm9sZUxpbmtJZH19IgpwbGF0Zm9ybV9jcmVkZW50aWFsc19wYXRoID0gInt7LnNraWxsLnBsYXRmb3JtQ3JlZGVudGlhbHNQYXRofX0iCmluc2VjdXJlID0ge3suYWdlbnQuaW5zZWN1cmV9fQpyb290X2NhX3BhdGggPSAie3suYWdlbnQucm9vdENhUGF0aH19IgoKW2FwaV0KdGVuYW50X2ZxZG5zID0gInt7LmFnZW50LnRlbmFudEZxZG5zfX0iCgpbbG9nZ2VyXQpsb2dfbGV2ZWwgPSAie3suc2V0dGluZ3MubG9nX2xldmVsfX0iCmxvZ190b19zdGRvdXQgPSB7ey5zZXR0aW5ncy5sb2dfdG9fc3Rkb3V0fX0KbG9nX3RvX2ZpbGUgPSB7ey5zZXR0aW5ncy5sb2dfdG9fZmlsZX19CmxvZ19maWxlX3BhdGggPSAie3suc2V0dGluZ3MubG9nX2ZpbGVfcGF0aH19Ig==", + "fileName": "user.toml", + "filePath": "/hab/user/chef-gohai/config", + "name": "default", + "windowsFilePath": "c:\\hab\\user\\chef-gohai\\config" + } + ] +} \ No newline at end of file diff --git a/_vendor/github.com/chef/samples/skills/inspec-interpreter-skill.json b/_vendor/github.com/chef/samples/skills/inspec-interpreter-skill.json new file mode 100644 index 0000000000..e4ceac47fd --- /dev/null +++ b/_vendor/github.com/chef/samples/skills/inspec-interpreter-skill.json @@ -0,0 +1,9 @@ +{ + "name": "inspec-interpreter", + "canister": { + "origin": "chef-platform", + "name": "inspec-interpreter", + "service": false + }, + "configurationTemplates": [] +} \ No newline at end of file diff --git a/_vendor/github.com/chef/samples/skills/restart-interpreter-skill.json b/_vendor/github.com/chef/samples/skills/restart-interpreter-skill.json new file mode 100644 index 0000000000..ac4355f32d --- /dev/null +++ b/_vendor/github.com/chef/samples/skills/restart-interpreter-skill.json @@ -0,0 +1,9 @@ +{ + "name": "restart-interpreter", + "canister": { + "origin": "chef-platform", + "name": "restart-interpreter", + "service": false + }, + "configurationTemplates": [] +} \ No newline at end of file diff --git a/_vendor/github.com/chef/samples/skills/shell-interpreter-skill.json b/_vendor/github.com/chef/samples/skills/shell-interpreter-skill.json new file mode 100644 index 0000000000..56a64d56db --- /dev/null +++ b/_vendor/github.com/chef/samples/skills/shell-interpreter-skill.json @@ -0,0 +1,9 @@ +{ + "name": "shell-interpreter", + "canister": { + "origin": "chef-platform", + "name": "shell-interpreter", + "service": false + }, + "configurationTemplates": [] +} \ No newline at end of file diff --git a/_vendor/modules.txt b/_vendor/modules.txt index 698f2b7062..b91974a145 100644 --- a/_vendor/modules.txt +++ b/_vendor/modules.txt @@ -14,6 +14,7 @@ # github.com/chef/compliance-profiles/docs-chef-io v0.0.0-20250207053335-f11d6ce5b3c1 # github.com/chef/compliance-remediation-2022/docs-chef-io v0.0.0-20240313054833-ebbc45209efa # github.com/chef/license-service/docs-chef-io v0.0.0-20250120051510-ae1de80f4621 +# github.com/chef/samples v0.0.0-20250304162216-b7bf3710b07e # github.com/chef/chef-docs-theme v0.0.0-20250217213320-727f9bce8258 # github.com/FortAwesome/Font-Awesome v0.0.0-20240108205627-a1232e345536 # github.com/cowboy/jquery-hashchange v0.0.0-20100902193700-0310f3847f90 diff --git a/config/_default/menu.toml b/config/_default/menu.toml index b793b0c3eb..40db08d6f4 100644 --- a/config/_default/menu.toml +++ b/config/_default/menu.toml @@ -677,15 +677,30 @@ identifier = "chef_infra" #### #### -# Chef SaaS Menu +# Chef Cloud Menu #### -[[saas]] -title = "Chef SaaS" -identifier = "chef_saas" +[[cloud]] +title = "Chef Cloud" +identifier = "chef_cloud" + + [[cloud]] + title = "Chef 360 SaaS" + identifier = "chef_cloud/360" + parent = "chef_cloud" + + [[cloud]] + title = "Get started" + identifier = "chef_cloud/360/get_started" + parent = "chef_cloud/360" + + [[cloud]] + title = "Chef SaaS" + identifier = "chef_cloud/saas" + parent = "chef_cloud" #### -# End Chef SaaS Menu +# End Chef Cloud Menu #### #### diff --git a/config/_default/module.toml b/config/_default/module.toml index de91fca655..e20dc9799c 100644 --- a/config/_default/module.toml +++ b/config/_default/module.toml @@ -364,6 +364,19 @@ workspace = '' source = "assets" target = "assets" +### +# Mount chef/samples +### + +[[imports]] + disable = false + ignoreConfig = false + path = "github.com/chef/samples" + +[[imports.mounts]] + source = '.' + target = 'static/samples' + ### # Mount Hugo theme ### diff --git a/config/_default/params.toml b/config/_default/params.toml index 1e6e473921..d0f6110ba7 100644 --- a/config/_default/params.toml +++ b/config/_default/params.toml @@ -4,12 +4,12 @@ menuOrder = [ "overview", "360", "automate", + "cloud", "desktop", "habitat", "infra", "server", "inspec", - "saas", "workstation", "effortless", "supermarket", diff --git a/content/360/saas/_index.md b/content/360/saas/_index.md new file mode 100644 index 0000000000..cd1de9def9 --- /dev/null +++ b/content/360/saas/_index.md @@ -0,0 +1,38 @@ ++++ +title = "Progress Chef 360 SaaS" +linkTitle = "Chef 360 SaaS" + +[cascade] + [cascade.params] + product = ['chef-360-saas'] + +[menu.cloud] +title = "Overview" +parent = "chef_cloud/360" +identifier = "chef_cloud/360/overview" +weight = 10 ++++ + +Chef 360 SaaS focuses on job orchestration and node management in the cloud to complete your DevOPS journeys whenever, wherever, and however a business scenario requires. Chef 360 SaaS is hosted, maintained, and upgraded by Chef allowing you to focus on your workflows. + +**Whenever**: Chef 360 SaaS provides real-time observability of the changing infrastructure environment through scheduled actions, continuous scanning or immediate "execute-once" semantics. + +**Wherever**: Chef 360 SaaS operates across hybrid environments from on-premises data centers through to all major public clouds, and secures the wide variety of platforms and resources supported by Chef. + +**Whatever**: Chef 360 SaaS enables DevOps and security engineering teams--whether they follow ITIL or ChatOps--to leverage the native JSON syntax or use one of several, extensible infrastructure-as-code DSLs. + +Chef 360 SaaS has a workflow engine to execute varied jobs in compliance and infrastructure management: + +- Regularly scan, audit, and remediate infrastructure, protecting your fleet with certified industry compliance profiles like CIS, SOC2, and CSPM. +- Create composable jobs quickly using shell scripting and out-of-the-box skills to develop full playbooks, capable of coordinating the other DevOps IaC tools you own. +- Safely build, package, and deploy applications from a fully cloud-native, zero-trust platform in conjunction with Chef Habitat. +- Discover assets effortlessly from existing Chef environments, other Progress products like What's-Up-Gold, and even your own CMDB and monitoring solutions. +- Leverage an open partner ecosystem with Chef premium content and content from thought leaders such as OSL and MITRE, and easily extensible formats which require no special knowledge. + +## Additional guides + +- [Chef 360 user interface](https://docs.chef.io/360/1.2/chef_360_ui/) +- [Chef Courier](https://docs.chef.io/360/1.2/courier/) +- [Chef Node Management](https://docs.chef.io/360/1.2/courier/jobs/) +- [Organization and user management](https://docs.chef.io/360/1.2/administration/) +- [API and CLI references](https://docs.chef.io/360/1.2/reference/) diff --git a/content/360/saas/get_started/_index.md b/content/360/saas/get_started/_index.md new file mode 100644 index 0000000000..45d787fcba --- /dev/null +++ b/content/360/saas/get_started/_index.md @@ -0,0 +1,37 @@ ++++ +title = "Get started with Chef 360 SaaS" +linkTitle = "Get started" + +[menu.cloud] +title = "Overview" +identifier = "chef_cloud/360/get_started/overview" +parent = "chef_cloud/360/get_started" +weight = 10 ++++ + +This section provides quickstart guides for getting started with Chef 360 SaaS and its tools. + +## Get started guides + +Before you begin with these guides, [review the system requirements]({{< relref "system_requirements" >}}). + +Chef 360 SaaS guides: + +- [Set up Chef 360 SaaS]({{< relref "set_up" >}}) + +Chef 360 Platform CLI guides: + +- [Install and register the Chef 360 Platform CLIs]({{< relref "install_cli" >}}) + +Chef Node Management guides: + +- [Register the Node Management agent]({{< relref "register_node_agent" >}}) +- [Define skills]({{< relref "define_skills" >}}) +- [Create a skill assembly]({{< relref "create_skill_assembly" >}}) +- [Create override settings]({{< relref "override_settings" >}}) +- [Create a node cohort]({{< relref "node_cohort" >}}) +- [Enroll nodes]({{< relref "enroll_nodes" >}}) + +Chef Courier job guides: + +- [Run jobs with Chef Courier]({{< relref "jobs" >}}) diff --git a/content/360/saas/get_started/create_skill_assembly.md b/content/360/saas/get_started/create_skill_assembly.md new file mode 100644 index 0000000000..9b742909a6 --- /dev/null +++ b/content/360/saas/get_started/create_skill_assembly.md @@ -0,0 +1,33 @@ ++++ +title = "Create a skill assembly" + +[menu.cloud] +title = "Create a skill assembly" +identifier = "chef_cloud/360/get_started/skill assembly" +parent = "chef_cloud/360/get_started" +weight = 70 ++++ + +A skill assembly defines a set of skills should be installed or removed from nodes using add and remove rules. + +## Prerequisites + +- [Skills are defined]({{< relref "define_skills" >}}). + +## Create a skill assembly + +To create a skill assembly, follow these steps: + +{{< readfile file="content/360/saas/reusable_text/md/skill_assembly_get_started.md" >}} + +## Troubleshooting + +Use the `assembly find-one-assembly` subcommand to verify that the skill assembly was created or updated successfully: + +```sh +chef-node-management-cli management assembly find-one-assembly --skillAssemblyId --profile +``` + +## Next steps + +- [Create override settings]({{< relref "override_settings.md" >}}) that define required skill settings. diff --git a/content/360/saas/get_started/define_skills.md b/content/360/saas/get_started/define_skills.md new file mode 100644 index 0000000000..c5dd6f025e --- /dev/null +++ b/content/360/saas/get_started/define_skills.md @@ -0,0 +1,131 @@ ++++ +title = "Define skills" + +[menu.cloud] +title = "Define skills" +identifier = "chef_cloud/360/get_started/skills" +parent = "chef_cloud/360/get_started" +weight = 60 ++++ + +This document describes how to define the set of required skills on a node or set of nodes. + +A skill is an agent that gives you the ability to perform actions on a node to achieve an outcome. + +## Prerequisites + +- [Node Management agent is registered]({{< relref "register_node_agent" >}}). +- The Chef Infra Client interpreter requires Chef Infra Client installed on each node. +- The Chef InSpec interpreter requires Chef InSpec installed on each node. + +## Create skill definitions + +The following Chef 360 skills are required or recommended for managing nodes, running actions, and returning action results: + +- Courier Runner skill +- Gohai skill +- Shell interpreter skill +- Restart interpreter skill +- Chef Client interpreter skill + +### Courier Runner + +The Courier Runner skill interprets the Courier Job definitions sent to it by the Courier Dispatcher and executes them on the node. + +1. Create a JSON file called `courier-runner-skill.json` containing the following skill definition for Courier Runner: + + {{% readfile file="_vendor/github.com/chef/samples/skills/courier-runner-skill.json" highlight="json" %}} + + {{< note >}} If the skill is registered as a service, then the `name` and `canister.name` fields must be identical. {{< /note >}} + +1. Create the skill: + + ```sh + chef-node-management-cli management skill create-skill --body-file courier-runner-skill.json --profile + ``` + +### Gohai + +The Gohai skill collects attributes about a node in addition to attributes collected by the Node Management agent. + +1. Create a file named `gohai-skill.json` containing the skill definition for gohai. + + {{% readfile file="_vendor/github.com/chef/samples/skills/gohai-skill.json" highlight="json" %}} + + {{< note >}} If the skill is registered as a service, then the `name` and `canister.name` fields must be identical. {{< /note >}} + +1. Create the skill: + + ```sh + chef-node-management-cli management skill create-skill --body-file gohai-skill.json --profile + ``` + +### Shell interpreter + +The Shell interpreter skill executes OS commands in a Courier Job. + +1. Create a file named `shell-interpreter-skill.json` containing the skill definition: + + {{% readfile file="_vendor/github.com/chef/samples/skills/shell-interpreter-skill.json" highlight="json" %}} + +1. Create the skill: + + ```sh + chef-node-management-cli management skill create-skill --body-file shell-interpreter-skill.json --profile + ``` + +### Restart interpreter + +If your jobs will reboot a node, then you need the Restart interpreter skill. + +1. Create a file named `restart-interpreter-skill.json` containing the skill definition. + + {{% readfile file="_vendor/github.com/chef/samples/skills/restart-interpreter-skill.json" highlight="json" %}} + +1. Create the skill: + + ```sh + chef-node-management-cli management skill create-skill --body-file restart-interpreter-skill.json --profile + ``` + +### Chef Infra Client interpreter + +If your Courier jobs will invoke Infra Client runs, then you need the Chef Infra Client interpreter skill. + +1. Create a file named `chef-client-interpreter-skill.json` and add the following the skill definition. + + {{% readfile file="_vendor/github.com/chef/samples/skills/chef-client-interpreter.json" highlight="json" %}} + +1. Create the skill: + + ```sh + chef-node-management-cli management skill create-skill --body-file chef-client-interpreter-skill.json --profile + ``` + +### Chef InSpec interpreter + +If your Courier jobs will invoke Chef InSpec scans, then you need the Chef InSpec interpreter skill. + +1. Create a file named `inspec-interpreter-skill.json` and add the following skill definition. + + {{% readfile file="_vendor/github.com/chef/samples/skills/inspec-interpreter-skill.json" highlight="json" %}} + +1. Create the skill: + + ```sh + chef-node-management-cli management skill create-skill --body-file inspec-interpreter-skill.json --profile + ``` + +## Verify skills + +- Get a list of all the defined skills using the `find-all-skills` subcommand: + + ```sh + chef-node-management-cli management skill find-all-skills --profile + ``` + + It returns an output listing the defined skills. + +## Next step + +- [Create a skill assembly]({{< relref "create_skill_assembly.md" >}}) that adds or removes skills from nodes. diff --git a/content/360/saas/get_started/enroll_nodes.md b/content/360/saas/get_started/enroll_nodes.md new file mode 100644 index 0000000000..6d7a380a5c --- /dev/null +++ b/content/360/saas/get_started/enroll_nodes.md @@ -0,0 +1,216 @@ ++++ +title = "Enroll nodes" + +[menu.cloud] +title = "Enroll nodes" +identifier = "chef_cloud/360/get_started/enroll_nodes" +parent = "chef_cloud/360/get_started" +weight = 100 ++++ + +Node enrollment brings nodes under management by Chef 360 SaaS. + +This document demonstrates two different methods of node enrollment: + +- cookbook-based enrollment +- single-node enrollment + +{{< note >}} + +This version of Chef 360 SaaS doesn't support node re-enrollment. + +{{< /note >}} + +## Prerequisites + +- [A node cohort has been created]({{< relref "node_cohort" >}}). + +## Requirements + +Review the [node requirements]({{< relref "system_requirements#node-requirements" >}}) before enrolling nodes. + +## Single-node enrollment + +Single-node enrollment enrolls nodes from the server side. +With this method, you define connection and configuration details and push them up to Chef 360 SaaS, which connects to each node and installs Chef Habitat, Chef Node Management, and any skills or agents assigned to a node cohort. + +### Enroll Linux nodes + +To enroll a Linux node, follow these steps: + +1. Create a JSON file that defines the node connection settings: + + {{% readfile file="content/360/saas/reusable_text/json/enroll-node-linux-rsa.json" highlight="json" %}} + + {{< note >}} + + Format SSH keys in a JSON payload as a single-line string. + To add a multiline key, replace new lines with the newline character `\n`. + + Use the following command to replace new lines in a PEM file: + + ```sh + awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' + ``` + + {{< /note >}} + + Replace the following: + + - `` with the ID of the cohort that the node will be enrolled with. + - `` with a public domain name or IP address. + - `` with the SSH username to authenticate with the node. + - `` with the SSH key used to authenticate with the node. + - `` with the SSH port. Default is `22`. + + {{< note >}} + + You can also authenticate with an SSH password instead of an RSA key. To do so, replace `key` with `password` in the SSH connection settings file. For example, `"password": ""`. + + {{< /note >}} + +1. Enroll the node using the `enrollment enroll-node` command: + + ```sh + chef-node-management-cli enrollment enroll-node --body-file --profile + ``` + + The response is similar to the following: + + ```json + { + "item": { + "id": "36c570b1-798a-4530-ada5-2661dfeb3fac", + "nodeId": "e4b1b524-4e77-4448-b1a9-01b80288c898" + } + } + ``` + +### Enroll Windows nodes + +To enroll a Windows node, follow these steps: + +1. Create a JSON file that defines the node connection settings: + + {{% readfile file="content/360/saas/reusable_text/json/enroll-node-windows.json" highlight="json" %}} + + Replace the following: + + - `` with the ID of the cohort that the node will be enrolled with. + - `` with the node's public domain name or IP address. + - `` with the Windows username to authenticate with the node. + - `` with the Windows password used to authenticate with the node. + +1. Enroll the node using the `enrollment enroll-node` command: + + ```sh + chef-node-management-cli enrollment enroll-node --body-file --profile + ``` + + The response is similar to the following: + + ```json + { + "item": { + "id": "36c570b1-798a-4530-ada5-2661dfeb3fac", + "nodeId": "e4b1b524-4e77-4448-b1a9-01b80288c898" + } + } + ``` + +## Cookbook-based enrollment + +With cookbook-based enrollment, you enroll nodes from the client side by uploading a [cookbook](https://docs.chef.io/cookbooks/) with enrollment settings to Chef Infra Server and then Chef Infra Client enrolls the node with Chef 360 SaaS. + +### Enroll nodes + +The `chef-cookbook-enroll` cookbook uses the `node_management_enroll` custom resource and a [wrapper cookbook](https://www.chef.io/blog/writing-wrapper-cookbooks) to define enrollment settings. + +To configure the cookbooks and define enrollment settings, follow these steps: + +1. Download the [`chef360-node-enroll` cookbook](https://supermarket.chef.io/cookbooks/chef360-node-enroll). + +1. Upload the `chef360-node-enroll` cookbook, which includes the `node_management_enroll` resource, to your Chef Infra Server: + + ```bash + knife cookbook upload chef360-node-enroll --cookbook-path + ``` + + Replace `COOKBOOK_DIR_PATH` with the path to your cookbook directory. + +1. Create a wrapper cookbook and add the `chef360-node-enroll` cookbook as a dependency: + + ```sh + chef generate cookbook + ``` + + In the [`metadata.rb` file](https://docs.chef.io/config_rb_metadata/) of your wrapper cookbook, add the following dependency to include the `chef-cookbook-enroll` cookbook: + + ```ruby + depends 'chef360-node-enroll', '~> 1.0.0' + ``` + +1. Define the `node_management_enroll` resource in your wrapper cookbook's recipe: + + ```ruby + node_management_enroll 'Enroll Node' do + chef_platform_url '' + enroll_type '' + api_port '' + access_key '' + secret_key '' + cohort_id '' + hab_builder_url '' + working_dir_path '' + upgrade_skills + end + ``` + + Replace: + + - `` with the fully qualified domain name (FQDN) for your Chef 360 SaaS deployment. + - `` with either `full` or `partial` depending on the form of enrollment. Use `full` unless you must `partial`. + - `` with the API port configured in Chef 360 SaaS. The default value is `31000`. + - `` with an access key for secure communication with Chef 360 SaaS. Store securely using an [encrypted Chef data bag](https://docs.chef.io/data_bags/) or a [secrets manager](https://docs.chef.io/infra_language/secrets/). + - `` with a secret key for secure communication with Chef 360 SaaS. Store securely using an [encrypted Chef data bag](https://docs.chef.io/data_bags/) or a [secrets manager](https://docs.chef.io/infra_language/secrets/). + - `` with a valid cohort UUID. The cohort defines all skills and settings installed on the node. + - `` with the URL of the Chef Habitat Builder used by your organization. Default value: `https://bldr.habitat.sh` + - `` with a temporary working directory where all required builds are downloaded. Specify a valid path based on the OS. Default value: `/tmp`. + - `` with `true` or `false`. If `true`, Chef 360 SaaS checks for the latest skill versions and installs them if found. Default value: `false`. + +1. Push the wrapper cookbook or policy to the Chef Infra Server. + + 1. If you're using a role, [upload](https://docs.chef.io/workstation/knife_cookbook/#upload) the wrapper cookbook to the Chef Infra Server: + + ```bash + knife cookbook upload --cookbook-path + ``` + + 1. If you're using a Policyfile, [create `Policyfile.lock.json` file](https://docs.chef.io/workstation/ctl_chef/#chef-install) and [push](https://docs.chef.io/workstation/ctl_chef/#chef-push) the Policyfile to Chef Infra Server: + + ```bash + chef install + chef push + ``` + +1. Include the wrapper cookbook in your node's run-list by adding it to a role or Policyfile. See the [run-list](https://docs.chef.io/run_lists/) and [role](https://docs.chef.io/roles/#manage-roles) documentation for more information. + + The next time Chef Infra Client runs, it executes the `node_management_enroll` resource and the node is enrolled with Chef 360 SaaS. + +## Check the node enrollment status + +{{< readfile file="content/360/saas/reusable_text/md/node_enrollment_status_node_id.md" >}} + +## Verify that the skills are installed + +- Verify that the skills are installed: + + ```sh + chef-node-management-cli management node find-one-node --nodeId --profile + ``` + + The response includes a list of the installed skills. + +## Next step + +- [Create a Courier job]({{< relref "jobs.md" >}}). diff --git a/content/360/saas/get_started/install_cli.md b/content/360/saas/get_started/install_cli.md new file mode 100644 index 0000000000..71e10bd1b5 --- /dev/null +++ b/content/360/saas/get_started/install_cli.md @@ -0,0 +1,168 @@ ++++ +title = "Install CLIs and register your workstation" + +draft = false + +[menu.cloud] +title = "Install CLIs" +identifier = "chef_cloud/360/get_started/cli" +parent = "chef_cloud/360/get_started" +weight = 40 ++++ + +This page documents how to download and install the Chef 360 Platform CLIs and register your workstation with your Chef 360 SaaS deployment. + +## Prerequisites + +- [Chef 360 SaaS configured]({{< relref "set_up" >}}). +- `/usr/local/bin` is present in the PATH environment variable. + +## Install CLIs + +{{< readfile file="content/360/saas/reusable_text/md/clis_install_saas.md" >}} + +## Install and configure the bash-completion package + +{{< readfile file="content/360/saas/reusable_text/md/install_bash_completion.md" >}} + +## Add your license + +{{< readfile file="content/360/saas/reusable_text/md/clis_add_license.md" >}} + +## Verify profiles + +{{< readfile file="content/360/saas/reusable_text/md/clis_verify_profiles.md" >}} + +## Assign the Node Manager and Courier Operator roles + +The `node-manager` and `courier-operator` roles allow you to manage nodes, manage skills on nodes, and run Chef Courier jobs. + +Before you begin, ensure you have: + +- Your user ID. Use the `user-account identity get-self-user` subcommand to get your user ID. +- The name of a profile with the org-admin role. + +Follow this step to give your user account the `node-manager` and `courier-operator` roles: + +- Assign the `node-manager` role and `courier-operator` role using the `user-account user assign-role` subcommand: + + ```sh + chef-platform-auth-cli user-account user assign-role --body '{"name": "node-manager", "roleId": "6e7df273-928b-41ec-b6f6-e3f5138a6f9e"}' --userId --profile + ``` + + ```sh + chef-platform-auth-cli user-account user assign-role --body '{"name": "courier-operator", "roleId": "ac12c3a6-95f7-429d-b3fc-584ce1cf74de"}' --userId --profile + ``` + + Replace: + + - `` with your user ID. + - `` with your profile that has the org-admin role. + +## Create profiles for the Node Manager and Courier Operator roles + +Create a profile _for each role_ that you added to your user account in the previous step. + +To create a profile, follow these steps: + +1. Create a profile using the `register-device` subcommand that associates your workstation with a specific tenant, organization, and role: + + ```sh + chef-platform-auth-cli register-device --device-name --profile-name --url + ``` + + {{< note >}} + + If you've configured Chef 360 SaaS with a system-generated or custom certificate in the API/UI settings, use the following CLI arguments: + + - If you don't have the root certificate authority, use the `--insecure` flag. This flag skips certificate validation. + - If have the root certificate authority present, use the `--cafile ` flag. + + {{< /note >}} + + Replace: + + - `` with a name for the workstation. + - `` with a profile name for the role that this profile will use. For example, add the `courier-operator` profile name for the `courier-operator` role. + - `` with the tenant URL, for example `https://chef360.example.com:31000`. + + The CLI responds with an authorization code that includes a link to log into Chef 360 SaaS. + + ```sh + Device Id : ac:de:48:00:11:22-admin-chef-courier-cli + Device Name : + OAuth Code : + + Please log in and authorise the the device by using the link below: + https://chef360.example.com/platform/user-accounts/v1/identity/device/ac:de:48:00:11:22-admin-chef-courier-cli/authorise?oauthCode=&appType=chef-courier-cli&deviceName= + + Is the device authorised? (y or n) + ``` + + Paste the link into your browser and log in. + The CLI waits for the device registration process to finish in the browser. + +1. Open a browser, navigate to the link returned by the CLI, and log in if you haven't already. + +1. Select the organization and role you would like to link to this profile and select **Submit**. + + {{< figure src="/images/360/select-role.png" width="500px" alt="Chef 360 SaaS organization and role selection screen." >}} + +1. On the **Device Authorization** screen, Chef 360 SaaS shows your OAuth code and you can select an expiration date for your session. + + Chef 360 SaaS automatically refreshes your access token up to this expiration date. + + After entering this information, select **Authorize**. + + {{< figure src="/images/360/setting-expiry-token.png" alt="Chef 360 SaaS device authorization screen with OAuth token and expiration date." width="500px">}} + +1. Return to your terminal and enter `y` to continue. + + The CLI displays your device profile and your workstation is authorized to access Chef 360 SaaS services. + + ```sh + Is the device authorised? (y or n) + > y + Profile: + + [tenant-org-role] + DeviceId = "ac:de:48:00:11:22-admin-chef-courier-cli" + Url = "https://demo.chef360.io/" + OrgName = "Demo Organization" + RoleName = "org-admin" + AccessKey = "FIT3SXM...TCYK4V05Y" + SecretKey = "Cwaygh4FqE2sT...rX4wBu0hp9IE9YpzoGuX" + + Device registered successfully + ``` + +1. Optional: Test your connection by getting the role associated with your user account: + + ```sh + chef-platform-auth-cli user-account self get-role --profile + ``` + + Replace `` with the name of your profile. + +1. Optional: Set your new profile as the default profile. + + The Chef 360 Platform CLIs use a default profile automatically in any command that accepts the `--profile` argument. + If you don't set a default profile, you will have to specify it in each command with `--profile `. + + Set a default profile: + + ```sh + chef-platform-auth-cli set-default-profile + ``` + + Replace `` with the name of the default profile. + +1. Repeat this procedure so that you have separate profiles for the Node Manager and Courier Operator roles. + +## Additional information + +- [Chef 360 CLI reference documentation](https://docs.chef.io/360/1.2/reference/cli/) + +## Next step + +- [Register the Node Management agent]({{< relref "register_node_agent.md" >}}). diff --git a/content/360/saas/get_started/jobs.md b/content/360/saas/get_started/jobs.md new file mode 100644 index 0000000000..46efe89d58 --- /dev/null +++ b/content/360/saas/get_started/jobs.md @@ -0,0 +1,291 @@ ++++ +title = "Run a Courier job on a node" + +[menu.cloud] +title = "Run Courier jobs" +identifier = "chef_cloud/360/get_started/jobs" +parent = "chef_cloud/360/get_started" +weight = 110 ++++ + +A Courier job defines the actions performed on a node or set of nodes, the schedule that the actions are performed on, and the group of nodes that the actions are performed on. +A job can be executed multiple times across multiple nodes for multiple actions. + +## Prerequisites + +- [Nodes are enrolled]({{< relref "enroll_nodes" >}}). + +## Define a job + +Jobs are defined using a job template, which is a file in JSON, YAML, or TOML format that tells Chef Courier the name of the job, when the job should run, the nodes that the job should run on, and the actions that the job should take. + +This job template creates a job that's executed one node, it runs immediately, and it uses the `chef-platform/shell-interpreter` to run the `sleep 10` command. + +- Create a file called `create-job-simple.json` and with the following JSON string: + + {{% readfile file="_vendor/github.com/chef/samples/courier-job-examples/create-job-simple.json" highlight="json" %}} + + Replace `` in the JSON file with the node identifier of your enrolled node. + +## Create the job + +When you add the job to Chef 360 SaaS, the Courier Dispatcher sends the job definition to the Courier Runner on the specified node which determines when and how to run the job. +You can submit a job definition using a JSON, YAML, or TOML file. The default format is JSON. + +- Add the job run using the job template file: + + ```sh + chef-courier-cli scheduler jobs add-job --body-file create-job-simple.json --profile + ``` + + The default file format is JSON, you can also submit the job using YAML or TOML using the `--body-format` option. For example: + + ```sh + chef-courier-cli scheduler jobs add-job --body-file create-job-simple.yaml --body-format yaml + ``` + + The response is similar to the following: + + ```json + { + "item": { + "exceptionReasons": [], + "id": "61013744-bd6e-437c-a995-b6211318624e", + "nextExecutionTime": "2024-03-27T14:57:20.551342549Z" + } + } + ``` + + The output includes the job ID (`61013744-bd6e-437c-a995-b6211318624e` in the example response), which can be used to for tracking the job. + +## Get the job instance details + +A job instance is created every time the job executes. This job is set to run immediately, so only one job instance is created. + +- Get the details of the job instance using the job ID: + + ```sh + chef-courier-cli state instance list-all --job-id --profile + ``` + + The response is similar to the following: + + ```json + + { + "items": [ + { + "actionSpec": { + "accessMode": "agent", + "steps": [ + { + "command": { + "linux": [ + "sleep 10" + ] + }, + "conditions": [], + "description": "", + "expectedInputs": {}, + "failureBehavior": { + "action": "retryThenFail", + "retryBackoffStrategy": { + "arguments": [ + 1, + 3, + 5 + ], + "delaySeconds": 0, + "type": "none" + } + }, + "inputs": {}, + "interpreter": { + "name": "chef-platform/shell-interpreter", + "skill": { + "maxVersion": "", + "minVersion": "1.0.0" + } + }, + "limits": { + "cores": 0, + "cpu": 1, + "timeoutSeconds": 0 + }, + "name": "sleep", + "outputFieldRules": {}, + "retryCount": 2 + } + ] + }, + "createdAt": "2024-07-12T01:10:20.064474Z", + "id": "befe88f3-ac3f-4bad-9e1a-6017332929ab", + "jobId": "448ecaf3-5e44-4e7b-9e98-62dfa8c69b1c", + "lastUpdatedBy": "00000000-0000-0000-0000-000000000000", + "status": "running", + "targetSpec": { + "executionType": "sequential", + "groups": [ + { + "batchSize": { + "type": "number", + "value": 1 + }, + "distributionMethod": "batching", + "filter": null, + "filterId": "00000000-0000-0000-0000-000000000000", + "listId": "00000000-0000-0000-0000-000000000000", + "nodeIdentifiers": [ + "1f4c680d-4dc6-4edf-83b6-ded81388f244", + "020ab866-9d3d-4ca7-919d-c21b4f9ef2a4", + "925f244c-65b4-4ab9-9ebd-4b17f8e2277b" + ], + "nodeListType": "nodes", + "successCriteria": [ + { + "numRuns": { + "type": "percent", + "value": 100 + }, + "status": "success" + } + ], + "timeoutSeconds": 60 + } + ] + }, + "updatedAt": "2024-07-12T01:10:20.064474Z" + } + ], + "pagination": { + "itemsPerPage": 10, + "nextLink": "", + "page": 1, + "pageItemCount": 1, + "previousLink": "", + "startIndex": 1, + "totalItems": 1, + "totalPages": 1 + } + } + ``` + + The response includes the job instance ID (`"id": "befe88f3-ac3f-4bad-9e1a-6017332929ab"`), which you can use to track the job instance. + +## Get job run details + +A job run is created for each target node in a job instance. + + + +- Request the details of each job run using the instance ID: + + ```sh + chef-courier-cli state instance list-instance-runs --instanceId --profile + ``` + + The response is similar to the following: + + ```json + { + "items": [ + { + "groupNumber": 0, + "lastUpdateTime": "2024-03-27T15:00:09.185273Z", + "nodeId": "03ba18c0-68b2-43ba-93fd-b6952443421e", + "receivedTime": "2024-03-27T14:58:57.226555Z", + "runId": "496f0d9a-f0be-4cb7-8cbb-2285b5c42045", + "status": "success" + }, + { + "groupNumber": 0, + "lastUpdateTime": "2024-03-27T14:58:48.582415Z", + "nodeId": "2768a3b5-f5a6-45ae-a8b6-42d531c6416a", + "receivedTime": "2024-03-27T14:57:51.753876Z", + "runId": "306d3a00-d483-4aa2-bb09-1cd8c91c15e8", + "status": "success" + }, + { + "groupNumber": 1, + "lastUpdateTime": "2024-03-27T14:58:51.090507Z", + "nodeId": "a8b1f470-fedc-45e8-ba0a-b26dd551c1d0", + "receivedTime": "2024-03-27T14:57:49.229442Z", + "runId": "376226b9-f916-42a1-8620-a4636598c5e5", + "status": "success" + }, + { + "groupNumber": 1, + "lastUpdateTime": "2024-03-27T14:59:58.186538Z", + "nodeId": "acb38595-64af-4532-8589-2aeb2ad876fc", + "receivedTime": "2024-03-27T14:58:55.934629Z", + "runId": "22d7d6a9-33b5-4565-8575-2f2ee24a06a1", + "status": "success" + }, + { + "groupNumber": 1, + "lastUpdateTime": "2024-03-27T15:01:05.766027Z", + "nodeId": "e4b1b524-4e77-4448-b1a9-01b80288c898", + "receivedTime": "2024-03-27T15:00:03.220273Z", + "runId": "56960929-ca32-463a-bc6e-c0a6cca4f89d", + "status": "success" + } + ], + "totalItems": 5 + } + ``` + + Each job run has a run ID. You can use the job run IDs to get information about each step of a job run. + + In this example, the run IDs are: + + - `"496f0d9a-f0be-4cb7-8cbb-2285b5c42045"` + - `"306d3a00-d483-4aa2-bb09-1cd8c91c15e8"` + - `"376226b9-f916-42a1-8620-a4636598c5e5"` + - `"22d7d6a9-33b5-4565-8575-2f2ee24a06a1"` + - `"56960929-ca32-463a-bc6e-c0a6cca4f89d"` + + + +## Get the job run step details for a run + +- Use the job run ID to get a list of steps executed during a job run: + + ```sh + chef-courier-cli state run list-steps --runId --profile + ``` + + ```json + { + "items": [ + { + "inputs": "", + "interpreterPath": "/hab/pkgs/chef-platform/shell-interpreter/0.1.3/20240318113204/bin/shell-interpreter", + "interpreterVersion": "", + "numAttempts": 1, + "outputs": "", + "reason": "", + "status": "success", + "stepNumber": 1 + } + ], + "totalItems": 1 + } + ``` + +## Debug Courier jobs + +You can also review the job step details by connecting to a node with SSH and checking the Courier Runner logs. + +For a Linux node: + +```sh +cd /hab/svc/courier-runner/logs +tail -f courier-log +``` + +For a Windows node: + +```powershell +cd C:\hab\svc\courier-runner\logs +gc .\courier-log -Wait +``` diff --git a/content/360/saas/get_started/node_cohort.md b/content/360/saas/get_started/node_cohort.md new file mode 100644 index 0000000000..07e3b63bd6 --- /dev/null +++ b/content/360/saas/get_started/node_cohort.md @@ -0,0 +1,58 @@ ++++ +title = "Create a node cohort" + +[menu.cloud] +title = "Create a node cohort" +identifier = "chef_cloud/360/get_started/cohort" +parent = "chef_cloud/360/get_started" +weight = 90 ++++ + +{{< readfile file="content/360/saas/reusable_text/md/node_cohort_overview.md" >}} + +## Prerequisites + +- [Override settings are defined]({{< relref "override_settings" >}}). + +## Create a node cohort + +To create a node cohort, follow these steps: + +1. Create a file named `node-cohort.json` that contains the skill assembly ID and the settings ID it should be associated to. + + ```json + { + "name": "node-cohort-mchef", + "description": "Description first cohort", + "settingId": "5b305ea5-c89b-4ac3-a471-60dadf4980ed", + "skillAssemblyId":"4ecbe415-838a-4446-abc1-9c57de9211d8" + } + ``` + +1. Create the node cohort: + + ```sh + chef-node-management-cli management cohort create-cohort --body-file node-cohort.json --profile + ``` + + ```json + { + "item": { + "cohortId": "86628101-0f31-48aa-b035-a8889232e568" + } + } + ``` + + The above command returns a response containing the `cohortId`. Save it for using during Node Enrollment. + +## Troubleshooting + +- Verify that the node cohort was created successfully: + + ```sh + chef-node-management-cli management cohort find-one-cohort --cohortId --profile + ``` + +## Next step + +- [Enroll Nodes]({{< relref "enroll_nodes.md" >}}). diff --git a/content/360/saas/get_started/override_settings.md b/content/360/saas/get_started/override_settings.md new file mode 100644 index 0000000000..fb5b279e86 --- /dev/null +++ b/content/360/saas/get_started/override_settings.md @@ -0,0 +1,55 @@ ++++ +title = "Create override settings" + +[menu.cloud] +title = "Create override settings" +identifier = "chef_cloud/360/get_started/override settings" +parent = "chef_cloud/360/get_started" +weight = 80 ++++ + +When you created the Courier Runner skill definition in the previous section, +it contained a base64-encoded TOML string in the value of `content` key. This TOML includes settings that can or should be overridden with settings for your Chef 360 SaaS system. +When Node Management runs on a node, it executes Courier Runner using values in the TOML file that are set by values stored in the Courier Runner's default settings or the Courier Runner's override settings. + +## Prerequisites + +- [A skill assembly is defined]({{< relref "create_skill_assembly" >}}). + +## Create override settings + +Create node override settings for the Courier Runner and Gohai skills. + +1. Create a file named `node-override-setting.json` and paste in the following JSON: + + {{% readfile file="_vendor/github.com/chef/samples/cohorts/node-override-setting.json" highlight="json" %}} + + This JSON file creates settings for Courier Runner. + +1. Use the `create-setting` subcommand to create the override setting: + + ```sh + chef-node-management-cli management setting create-setting --body-file node-override-setting.json --profile + ``` + + which returns: + + ```json + { + "item": { + "settingId": "" + } + } + ``` + + Save the setting ID, you'll use it to create a node cohort. + +1. Verify that the setting was created. + + ```sh + chef-node-management-cli management setting find-one-setting --settingId --profile + ``` + +## Next step + +- [Create a node cohort]({{< relref "node_cohort.md" >}}) diff --git a/content/360/saas/get_started/register_node_agent.md b/content/360/saas/get_started/register_node_agent.md new file mode 100644 index 0000000000..167f827286 --- /dev/null +++ b/content/360/saas/get_started/register_node_agent.md @@ -0,0 +1,75 @@ ++++ +title = "Register Node Management agent" + +[menu.cloud] +title = "Register Node Management Agent" +identifier = "chef_cloud/360/get_started/Register Node Management Agent" +parent = "chef_cloud/360/get_started" +weight = 50 ++++ + +The Node Management agent manages skills on a node. +You must define settings on the Node Management agent before defining skills and override settings that are installed on nodes. + +## Prerequisites + +- [CLIs are installed and registered]({{< relref "../get_started/install_cli" >}}). + +## Register the Node Management agent + +To register the Node Management agent, follow these steps: + +1. Create a file named `register-agent-skill.json` that defines the Node Management agent settings: + + ```json + { + "bldrUrl": "", + "bldrChannel": "", + "bldrAuthToken": "", + "nodeCheckinInterval": , + "updateSkillMetadataInterval": , + "logLevel": "" + } + ``` + + Replace: + + - `` with the Chef Habitat Builder URL. Use `https://bldr.habitat.sh` for Chef's Habitat Builder or the URL of your own Habitat Builder deployment. + - `` with the release channel from which to install skills. For example, `stable`. + - `` with the authentication token for Habitat Builder. If you're using Chef's Habitat Builder, set this to an empty string. + - `` with the interval (in seconds) at which check-in occurs. Value starting from `3600` (1 hour). + - `` with the interval (in seconds) at which skill definitions are updated. Value starting from `3600` (1 hour). + - ``: The logging level of the agent. For example, `debug`. + + Supported log levels: + + `debug` + : Reports detailed information that can aid in identifying issues or debugging a workload. This includes the info, warn, and error logs. + + `info` + : Reports general information about the system's operations. + + `warn` + : Reports potential failures, but the operation can continue functioning for the time being. + + `error` + : Reports errors that prevent the execution of an operation. + +1. Create the skill assembly: + + ```sh + chef-node-management-cli management skill update-agent --body-file register-agent-skill.json + ``` + + It returns the following response: + + ```json + { + "code" : 200, + "message" : update-agent successful + } + ``` + +## Next step + +- [Create skill definitions]({{< relref "define_skills.md" >}}). diff --git a/content/360/saas/get_started/set_up.md b/content/360/saas/get_started/set_up.md new file mode 100644 index 0000000000..5da08ea112 --- /dev/null +++ b/content/360/saas/get_started/set_up.md @@ -0,0 +1,62 @@ ++++ +title = "Set up your Chef 360 SaaS environment" + +[menu.cloud] +title = "Set up Chef 360 SaaS" +identifier = "chef_cloud/360/get_started/set_up" +parent = "chef_cloud/360/get_started" +weight = 30 ++++ + +This document describes how to login and configure Chef 360 SaaS, add users, and add a license. + +## Prerequisites + +- If you don't already have one, you'll need a [Chef 360 SaaS account](https://www.chef.io/products/chef-360-saas) before you can get started. +- Review the [system requirements]({{< relref "system_requirements" >}}). + +## Login + +After signing up for a Chef 360 SaaS account, you'll receive three emails with information for logging in and setting up your account. an email with your Progress Chef license key, an email to set your user password, and an email notifying you of the organization you've been added to and the role you've been given. + +To login and set your license, follow these steps: + +1. Open the link in the email titled _Set Password_. + +1. In the Chef 360 SaaS login page, enter your onetime password and a new replacement password. + + The login page shows a message indicating that your password was successfully set. + +1. Login using your new password and email address. + +1. In the **Welcome** page, select the tenant you're logging into and the **tenant-admin** role, then select **Proceed**. + + You are now logged into Chef 360 SaaS with the Tenant Admin role. + +## Add users + +To add a new user to Chef 360 SaaS, follow these steps: + +1. From the Chef 360 SaaS web user interface, select **Tenant Management**. + +1. In the left navigation menu, select **User Management**. + +1. Select **Invite User** on the right side of the User Management page. + +1. In the **Invite User** dialog, enter the user's email address and user role, then select **Send Invite**. + +The new user will receive an email with instructions for logging in and setting a password. + +## Troubleshooting + +### Setting your password failed + +If your login failed because you forgot your password or you missed the five minute window to set your password, you can reset it by following these steps: + +1. At your organization's login page (**`https://CUSTOMER_SUBDOMAIN.cloud.chef.io/app/hub`**), select **Forgot Password** and enter the email address you used sign up with Chef 360 SaaS. + +1. You'll receive an email with a link to reset your password. You have five minutes follow the link and create a new password. + +## Next step + +- [Install Chef 360 CLIs]({{< relref "install_cli" >}}) diff --git a/content/360/saas/get_started/system_requirements.md b/content/360/saas/get_started/system_requirements.md new file mode 100644 index 0000000000..f00f3eb50d --- /dev/null +++ b/content/360/saas/get_started/system_requirements.md @@ -0,0 +1,78 @@ ++++ +title = "Chef 360 SaaS system requirements" + +[menu.cloud] +title = "System requirements" +identifier = "chef_cloud/360/get_started/requirements" +parent = "chef_cloud/360/get_started" +weight = 20 ++++ + +## Node requirements + +This guide describes two methods of enrolling nodes, either with a Chef Infra cookbook or with single-node enrollment from Chef 360 SaaS. +See the node requirements for those methods in the following sections. + +### Ports + +Open the following default ports for outbound connections. + +| Port | Description | +|-------|------------------------------| +| 443 | HTTPS | +| 31050 | RabbitMQ AMQP/AMQP-TLS | +| 31000 | Nginx Reverse Proxy NodePort | +| 22 | SSH (optional) | +| 80 | HTTP (optional) | + +### Cookbook-based enrollment + +Nodes enrolled with Chef 360 SaaS using a Chef Infra cookbook have the following requirements: + +- Nodes must have Chef Infra Client installed. +- Nodes have a public DNS or public IP address that can be reached from `https://CUSTOMER_SUBDOMAIN.cloud.chef.io`. +- Nodes must allow for outbound and inbound communication with +- Nodes can't have localhost (127.0.0.1) as an IP address. +- You must have sudo privileges on the node. +- Note: Requires Chef Infra Server or running Chef Infra Client in zero mode. For SaaS, this requires Chef 360 SaaS Enterprise. + +### Chef 360 SaaS enrollment + +Nodes enrolled using single-node enrollment have the following requirements. + +Connection requirements: + +- Nodes must be accessible with SSH or WinRM from `https://CUSTOMER_SUBDOMAIN.cloud.chef.io`. +- Nodes must have a public DNS or public IP address that can be reached from `https://CUSTOMER_SUBDOMAIN.cloud.chef.io`. +- Nodes must allow for outbound and inbound communication with +- A node IP address can't be localhost (127.0.0.1) +- A node CIDR address can't be in the same range as the Chef 360 SaaS services. The default CIDR range for Chef 360 SaaS services is `10.244.0.0/16` or `10.96.0.0/12`. +- The node's ports for RabbitMQ (31050) and the nginx API gateway (31000) must be open to Chef 360 SaaS. + +Nodes connected to with SSH have the following requirements: + +- Port 22 must be open. +- The user must have sudo privileges. +- The user must connect with an ed25519 or RSA(2048) login key without a passphrase. + +Nodes connected to with WinRM have the following requirements: + +- Ports 5985 and 5986 must be open. +- Configure WinRM by running the following: + + ```ps1 + winrm quickconfig # select Yes + winrm set winrm/config/service/Auth '@{Basic="true"}' + winrm set winrm/config/service '@{AllowUnencrypted="true"}' + netsh advfirewall firewall add rule name="WinRM-HTTP" dir=in localport=5985 protocol=TCP action=allow + netsh advfirewall firewall add rule name="WinRM-HTTPS" dir=in localport=5986 protocol=TCP action=allow + ``` + +### Skill requirements + +Chef 360 Platform skills are supported on the following platforms. + +| OS | Architecture | Version | +| ------- | ------------ | ----------------------------- | +| Linux | x86_64 | Kernel 2.6.32 or later | +| Windows | x86_64 | Windows Server 2019 and later | diff --git a/content/360/saas/reusable_text/index.md b/content/360/saas/reusable_text/index.md new file mode 100644 index 0000000000..7471a763f6 --- /dev/null +++ b/content/360/saas/reusable_text/index.md @@ -0,0 +1,11 @@ ++++ +title = 'Headless section' + +[[cascade]] + [cascade.build] + list = 'local' + publishResources = false + render = 'never' ++++ + + diff --git a/content/360/saas/reusable_text/json/enroll-node-linux-rsa.json b/content/360/saas/reusable_text/json/enroll-node-linux-rsa.json new file mode 100644 index 0000000000..2b67174e4e --- /dev/null +++ b/content/360/saas/reusable_text/json/enroll-node-linux-rsa.json @@ -0,0 +1,9 @@ +{ + "cohortId": "", + "url": "", + "sshCredentials": { + "username": "", + "key": "", + "port": + } +} diff --git a/content/360/saas/reusable_text/json/enroll-node-windows.json b/content/360/saas/reusable_text/json/enroll-node-windows.json new file mode 100644 index 0000000000..e59b226862 --- /dev/null +++ b/content/360/saas/reusable_text/json/enroll-node-windows.json @@ -0,0 +1,8 @@ +{ + "cohortId": "", + "url": "", + "winRMCredentials": { + "username": "", + "password": "" + } +} diff --git a/content/360/saas/reusable_text/md/clis_add_license.md b/content/360/saas/reusable_text/md/clis_add_license.md new file mode 100644 index 0000000000..89045c62f1 --- /dev/null +++ b/content/360/saas/reusable_text/md/clis_add_license.md @@ -0,0 +1,12 @@ + +Before you can use the Chef 360 Platform CLIs, you must add your license to your workstation. + +- To add a license, use the `license-management license load-license` command and your license key: + + ```sh + chef-platform-auth-cli license-management license load-license --body '{"licenseId":""}' --profile tenant-admin + ``` + + Replace `` with the license key you received in your email. + + After adding your license, `chef-platform-auth-cli` returns a success message. diff --git a/content/360/saas/reusable_text/md/clis_install_saas.md b/content/360/saas/reusable_text/md/clis_install_saas.md new file mode 100644 index 0000000000..616c41b7e1 --- /dev/null +++ b/content/360/saas/reusable_text/md/clis_install_saas.md @@ -0,0 +1,20 @@ + +Follow these steps to download and install the Chef 360 CLIs: + +1. From the Chef 360 SaaS home page, select **Download Centre**. + +1. From the **Download Centre** page, follow the instructions to download and install each CLI tool. + +1. After the CLIs are installed, run each CLI with the `--help` flag to verify that it's installed: + + - ```sh + chef-courier-cli --help + ``` + + - ```sh + chef-platform-auth-cli --help + ``` + + - ```sh + chef-node-management-cli --help + ``` diff --git a/content/360/saas/reusable_text/md/clis_verify_profiles.md b/content/360/saas/reusable_text/md/clis_verify_profiles.md new file mode 100644 index 0000000000..a1ae4565aa --- /dev/null +++ b/content/360/saas/reusable_text/md/clis_verify_profiles.md @@ -0,0 +1,42 @@ + +Use these commands to verify your profiles and credentials. + +1. List all your profiles with the `list-profile-names` subcommand. For example: + + ```sh + chef-platform-auth-cli list-profile-names + ``` + + The response is similar to the following: + + ```sh + List of available profile names: + 1. tenant1 + 2. default + ``` + + You can use `list-profile-names` subcommand with any of the Chef 360 Platform CLIs to get a list of your profiles. + +1. Get details of your default profile using the `get-default-profile` subcommand: + + ```sh + chef-platform-auth-cli get-default-profile + ``` + + The response is similar to the following: + + ```sh + Default profile: + + [default] + DeviceId = "ac:de:48:00:11:22-admin-chef-courier-cli" + Url = "http://tenant-1.dev-360.example.com" + OrgName = "Test OU1" + RoleName = "org-admin" + AccessKey = "FIT3SXM...YK4V05Y" + SecretKey = "Cwaygh4FqE2s...p9IE9YpzoGuX" + Cafile = "" + Insecure = true + ``` + + You can use `get-default-profile` subcommand with any of the Chef 360 Platform CLIs to get your default profile. diff --git a/content/360/saas/reusable_text/md/install_bash_completion.md b/content/360/saas/reusable_text/md/install_bash_completion.md new file mode 100644 index 0000000000..2d1debcd24 --- /dev/null +++ b/content/360/saas/reusable_text/md/install_bash_completion.md @@ -0,0 +1,51 @@ +Each Chef 360 Platform CLI has a `completion bash` subcommand. You must install the [bash-completion package](https://github.com/scop/bash-completion) to run these subcommands. + +To install and configure the bash-completion package, follow these steps: + +1. Install the bash-completion package. + + To install the bash-completion package on Linux systems, use the APT or Yum package manager: + + ```bash + sudo apt-get install bash-completion + ``` + + or + + ```bash + sudo yum install bash-completion + ``` + + To install the bash-completion package on macOS, use Homebrew: + + ```bash + brew install bash-completion + ``` + +1. Configure your Bash shell. + + To load the bash-completion package in every shell session by default, you must enable it in the `.bash_profile` or `.bashrc` file. + + To enable it on Linux systems, add the following lines to the `.bash_profile` or `.bashrc` file: + + ```bash + if [ -f /etc/bash_completion ] && ! shopt -oq posix; then + . /etc/bash_completion + fi + ``` + + To enable it on macOS, add the following lines to the `.bash_profile` or `.bashrc` file: + + ```bash + if [ -f $(brew --prefix)/etc/bash_completion ]; then + . $(brew --prefix)/etc/bash_completion + fi + ``` + + or + + ```bash + if [[ -r "$(brew --prefix)/etc/profile.d/bash_completion.sh" ]]; then + . "$(brew --prefix)/etc/profile.d/bash_completion.sh" + fi + ``` diff --git a/content/360/saas/reusable_text/md/node_cohort_overview.md b/content/360/saas/reusable_text/md/node_cohort_overview.md new file mode 100644 index 0000000000..c18eb45893 --- /dev/null +++ b/content/360/saas/reusable_text/md/node_cohort_overview.md @@ -0,0 +1,3 @@ +A node cohort defines skills and settings installed on every node in a cohort. + +After you create a cohort, you assign nodes to the cohort during node enrollment and Chef 360 SaaS installs or removes the skills and settings on every node accordingly. diff --git a/content/360/saas/reusable_text/md/node_enrollment_status_node_id.md b/content/360/saas/reusable_text/md/node_enrollment_status_node_id.md new file mode 100644 index 0000000000..8547d75b29 --- /dev/null +++ b/content/360/saas/reusable_text/md/node_enrollment_status_node_id.md @@ -0,0 +1,23 @@ +You can get the node enrollment level of a node using the node ID and the `management node find-one-node` subcommand: + +```sh +chef-node-management-cli management node find-one-node --nodeId --profile +``` + +Once a node is successfully enrolled, the enrollment level is set to `enrolled`, otherwise it remains at `admitted`. + +```json +"enrollmentLevel": "enrolled" +``` + +You can also check the enrollment status for the individual steps: + +```sh +chef-node-management-cli status get-status --nodeId --profile +``` + +Each step should have a `success` status. + +```json +"status": "Success" +``` diff --git a/content/360/saas/reusable_text/md/skill_assembly_get_started.md b/content/360/saas/reusable_text/md/skill_assembly_get_started.md new file mode 100644 index 0000000000..a892e20cf1 --- /dev/null +++ b/content/360/saas/reusable_text/md/skill_assembly_get_started.md @@ -0,0 +1,21 @@ +1. Create a file named `skill-assembly.json` and paste in the following skill assembly definition: + + {{% readfile file="_vendor/github.com/chef/samples/cohorts/skill-assembly.json" highlight="json" %}} + +1. Create the skill assembly: + + ```sh + chef-node-management-cli management assembly create-assembly --body-file skill-assembly.json --profile + ``` + + The response is similar to the following: + + ```json + { + "item": { + "skillAssemblyId": "e2e66c8a-79ff-4bdc-a4cd-739c3f02f9e9" + } + } + ``` + + Save the value of `skillAssemblyId`, you will use it to create a node cohort. diff --git a/content/saas/_index.md b/content/saas/_index.md index 0f7ade8c66..57e5a7c1e9 100644 --- a/content/saas/_index.md +++ b/content/saas/_index.md @@ -6,10 +6,10 @@ draft = false product = ["saas"] [menu] - [menu.saas] + [menu.cloud] title = "Overview" - identifier = "chef_infra/Overview" - parent = "chef_saas" + identifier = "chef_cloud/saas/Overview" + parent = "chef_cloud/saas" weight = 10 +++ diff --git a/content/saas/get_started.md b/content/saas/get_started.md index 90aa3c09f8..0aeb9bbd7d 100644 --- a/content/saas/get_started.md +++ b/content/saas/get_started.md @@ -2,10 +2,10 @@ title = "Get Started with Chef SaaS" draft = false [menu] - [menu.saas] + [menu.cloud] title = "Get Started" - identifier = "chef_infra/Get Started with Chef SaaS" - parent = "chef_saas" + identifier = "chef_cloud/saas/Get Started with Chef SaaS" + parent = "chef_cloud/saas" weight = 20 +++ diff --git a/content/saas/opsworks_migration.md b/content/saas/opsworks_migration.md index 3df57ac3a6..9b317da767 100644 --- a/content/saas/opsworks_migration.md +++ b/content/saas/opsworks_migration.md @@ -2,10 +2,10 @@ title = "Migrate from AWS OpsWorks to Chef SaaS" draft = false [menu] - [menu.saas] + [menu.cloud] title = " AWS OpsWorks Migration" - identifier = "chef_infra/OpsWorks Migration" - parent = "chef_saas" + identifier = "chef_cloud/saas/OpsWorks Migration" + parent = "chef_cloud/saas" weight = 30 +++ diff --git a/content/saas/register_nodes.md b/content/saas/register_nodes.md index 02e0dfbf03..2f5811eb22 100644 --- a/content/saas/register_nodes.md +++ b/content/saas/register_nodes.md @@ -2,10 +2,10 @@ title = "Redirect existing nodes to Chef SaaS" draft = false [menu] - [menu.saas] + [menu.cloud] title = "Redirect nodes" - identifier = "chef_infra/Register Nodes to Chef SaaS Environment" - parent = "chef_saas" + identifier = "chef_cloud/saas/Register Nodes to Chef SaaS Environment" + parent = "chef_cloud/saas" weight = 50 +++ diff --git a/content/saas/sso.md b/content/saas/sso.md index d960477218..97b18ccb93 100644 --- a/content/saas/sso.md +++ b/content/saas/sso.md @@ -3,11 +3,11 @@ title = "Configure SSO for Chef SaaS" draft = false [menu] - [menu.saas] + [menu.cloud] title = "Configure SSO" - identifier = "chef_infra/Configure SSO" - parent = "chef_saas" + identifier = "chef_cloud/saas/Configure SSO" + parent = "chef_cloud/saas" weight = 40 +++ diff --git a/go.mod b/go.mod index a09206a305..766235df9c 100644 --- a/go.mod +++ b/go.mod @@ -12,6 +12,7 @@ require ( github.com/chef/desktop-config/docs-chef-io v0.0.0-20240814044820-5af667d41a43 // indirect github.com/chef/effortless/docs-chef-io v0.0.0-20230711123605-c8beb79aba4f // indirect github.com/chef/license-service/docs-chef-io v0.0.0-20250120051510-ae1de80f4621 // indirect + github.com/chef/samples v0.0.0-20250304162216-b7bf3710b07e // indirect github.com/chef/supermarket/docs-chef-io v0.0.0-20241105172430-a362eded8f72 // indirect github.com/cowboy/jquery-hashchange v0.0.0-20100902193700-0310f3847f90 // indirect github.com/habitat-sh/habitat/components/docs-chef-io v0.0.0-20241227173243-de19b906a228 // indirect diff --git a/go.sum b/go.sum index dcff5a0df3..9a7af7272e 100644 --- a/go.sum +++ b/go.sum @@ -16,6 +16,8 @@ github.com/chef/effortless/docs-chef-io v0.0.0-20230711123605-c8beb79aba4f h1:6+ github.com/chef/effortless/docs-chef-io v0.0.0-20230711123605-c8beb79aba4f/go.mod h1:Lfq+HjwAQwUJ41EPTO/8qbI1oJb2i415fR28d2Ig9kc= github.com/chef/license-service/docs-chef-io v0.0.0-20250120051510-ae1de80f4621 h1:xhFjMLTM/newy2E4YVEZPE8Pfr7Z1yJOkby7BRDlbA8= github.com/chef/license-service/docs-chef-io v0.0.0-20250120051510-ae1de80f4621/go.mod h1:leNCF0KadV7zjm7YpVegNnbmWYUFXgaPKHP4tTDacos= +github.com/chef/samples v0.0.0-20250304162216-b7bf3710b07e h1:Eyntx13lbTXGobnPhPzsN3SuNTLb/6j4Fe5CseiCsLo= +github.com/chef/samples v0.0.0-20250304162216-b7bf3710b07e/go.mod h1:RiMNPQ6ddrNSgTOcBrYaEVicaP52xs9TQz4RA+XTreA= github.com/chef/supermarket/docs-chef-io v0.0.0-20241105172430-a362eded8f72 h1:mGnH8fxL69YfwoLP+mJP5fodAukQVf0A5lmF+7Cq/64= github.com/chef/supermarket/docs-chef-io v0.0.0-20241105172430-a362eded8f72/go.mod h1:D+9mmEZxCwpdhZ8LrEODBWMwMufmJUubSt5NlU/lLB4= github.com/cowboy/jquery-hashchange v0.0.0-20100902193700-0310f3847f90 h1:p/a5iSATj0OjrqJLX/YKxYdGXhZzW58yyyNIC4JY4S0= diff --git a/static/images/360/select-role.png b/static/images/360/select-role.png new file mode 100644 index 0000000000..d3845f92cc Binary files /dev/null and b/static/images/360/select-role.png differ diff --git a/static/images/360/setting-expiry-token.png b/static/images/360/setting-expiry-token.png new file mode 100644 index 0000000000..84a33c60a0 Binary files /dev/null and b/static/images/360/setting-expiry-token.png differ