-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add windows find disabled agents ps1 (#66)
* Add Windows Support kb0285 Added kb0285_find_disabled_agents.ps1 to enable detection of disabled agents on Windows. Modified kb0285_find_disabled_agents.json so it will use the correct version of the script on Linux and Windows. * Updated kb0285_find_disabled_agents.ps1 Updated it so that it functions like the Linux version. * Added blank line to the end of file. * Updated kb0285 tasks Updated kb0285 for backwards compatability.
- Loading branch information
1 parent
fd11da8
commit 44957de
Showing
5 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
{ | ||
"puppet_task_version": 1, | ||
"description": "KB0285 Find Disabled Agents - This Task to be used in conjunction with Puppet Enterprise Knowledge Base Article KB0285 - https://support.puppet.com/hc/en-us/articles/360006717334", | ||
"supports_noop": false | ||
"supports_noop": false, | ||
"implementations": [ | ||
{"name": "kb0285a_bash_find_disabled_agents.sh", "requirements": ["shell"]}, | ||
{"name": "kb0285b_powershell_find_disabled_agents.ps1", "requirements": ["powershell"]} | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"puppet_task_version": 1, | ||
"description": "KB0285 Find Disabled Agents - This Task to be used in conjunction with Puppet Enterprise Knowledge Base Article KB0285 - https://support.puppet.com/hc/en-us/articles/360006717334", | ||
"supports_noop": false | ||
} | ||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"puppet_task_version": 1, | ||
"description": "KB0285 Find Disabled Agents - This Task to be used in conjunction with Puppet Enterprise Knowledge Base Article KB0285 - https://support.puppet.com/hc/en-us/articles/360006717334", | ||
"supports_noop": false | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
$LOCKFILE="$(cmd.exe /c puppet config print statedir)/agent_disabled.lock" | ||
|
||
if(Test-Path $LOCKFILE) { | ||
Write-Output "Puppet agent is disabled" | ||
cat $LOCKFILE | ||
} | ||
else { | ||
Write-Output "Puppet agent is enabled" | ||
EXIT 1 | ||
} |