-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from choria-plugins/modulize
Transform into a regular puppet module
- Loading branch information
Showing
27 changed files
with
304 additions
and
27 deletions.
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
This file was deleted.
Oops, something went wrong.
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
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
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
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,16 @@ | ||
lookup_options: | ||
mcollective_agent_service::gem_dependencies: | ||
merge: | ||
strategy: deep | ||
mcollective_agent_service::package_dependencies: | ||
merge: | ||
strategy: deep | ||
mcollective_agent_service::config: | ||
merge: | ||
strategy: deep | ||
mcollective_agent_service::client_config: | ||
merge: | ||
strategy: deep | ||
mcollective_agent_service::server_config: | ||
merge: | ||
strategy: deep |
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,27 @@ | ||
--- | ||
mcollective_agent_service::config_name: service | ||
mcollective_agent_service::common_files: | ||
- data/service_data.rb | ||
- data/service_data.ddl | ||
- util/service/base.rb | ||
- util/service/puppetservice.rb | ||
- util/service/serviceservice.rb | ||
- validator/service_name.rb | ||
- validator/service_name.ddl | ||
- agent/service.ddl | ||
- agent/service.json | ||
mcollective_agent_service::executable_files: [] | ||
mcollective_agent_service::common_directories: | ||
- util/service | ||
mcollective_agent_service::server_files: | ||
- agent/service.rb | ||
mcollective_agent_service::server_directories: [] | ||
mcollective_agent_service::client_files: | ||
- application/service.rb | ||
mcollective_agent_service::client_directories: [] | ||
mcollective_agent_service::policies: | ||
- action: allow | ||
callers: "*" | ||
actions: status | ||
facts: "*" | ||
classes: "*" |
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,138 @@ | ||
{ | ||
"$schema": "https://choria.io/schemas/mcorpc/ddl/v1/agent.json", | ||
"metadata": { | ||
"name": "service", | ||
"description": "Manages Operating System Services", | ||
"author": "R.I.Pienaar <[email protected]>", | ||
"license": "Apache-2.0", | ||
"version": "4.0.1", | ||
"url": "https://github.com/choria-plugins/service-agent", | ||
"timeout": 60 | ||
}, | ||
"actions": [ | ||
{ | ||
"action": "restart", | ||
"input": { | ||
"service": { | ||
"prompt": "Service Name", | ||
"description": "The service to restart", | ||
"type": "string", | ||
"default": null, | ||
"optional": false, | ||
"validation": "service_name", | ||
"maxlength": 90 | ||
} | ||
}, | ||
"output": { | ||
"status": { | ||
"description": "The status of the service after restarting", | ||
"display_as": "Service Status", | ||
"default": "unknown" | ||
} | ||
}, | ||
"display": "failed", | ||
"description": "Restart a service", | ||
"aggregate": [ | ||
{ | ||
"function": "summary", | ||
"args": [ | ||
"status" | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"action": "start", | ||
"input": { | ||
"service": { | ||
"prompt": "Service Name", | ||
"description": "The service to start", | ||
"type": "string", | ||
"default": null, | ||
"optional": false, | ||
"validation": "service_name", | ||
"maxlength": 90 | ||
} | ||
}, | ||
"output": { | ||
"status": { | ||
"description": "The status of the service after starting", | ||
"display_as": "Service Status", | ||
"default": "unknown" | ||
} | ||
}, | ||
"display": "failed", | ||
"description": "Start a service", | ||
"aggregate": [ | ||
{ | ||
"function": "summary", | ||
"args": [ | ||
"status" | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"action": "status", | ||
"input": { | ||
"service": { | ||
"prompt": "Service Name", | ||
"description": "The service to get the status for", | ||
"type": "string", | ||
"default": null, | ||
"optional": false, | ||
"validation": "service_name", | ||
"maxlength": 90 | ||
} | ||
}, | ||
"output": { | ||
"status": { | ||
"description": "The status of the service", | ||
"display_as": "Service Status", | ||
"default": "unknown" | ||
} | ||
}, | ||
"display": "always", | ||
"description": "Gets the status of a service", | ||
"aggregate": [ | ||
{ | ||
"function": "summary", | ||
"args": [ | ||
"status" | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"action": "stop", | ||
"input": { | ||
"service": { | ||
"prompt": "Service Name", | ||
"description": "The service to stop", | ||
"type": "string", | ||
"default": null, | ||
"optional": false, | ||
"validation": "service_name", | ||
"maxlength": 90 | ||
} | ||
}, | ||
"output": { | ||
"status": { | ||
"description": "The status of the service after stopping", | ||
"display_as": "Service Status", | ||
"default": "unknown" | ||
} | ||
}, | ||
"display": "failed", | ||
"description": "Stop a service", | ||
"aggregate": [ | ||
{ | ||
"function": "summary", | ||
"args": [ | ||
"status" | ||
] | ||
} | ||
] | ||
} | ||
] | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,12 @@ | ||
--- | ||
version: 5 | ||
|
||
defaults: | ||
datadir: "data" | ||
data_hash: yaml_data | ||
|
||
hierarchy: | ||
- name: "plugin" | ||
path: "plugin.yaml" | ||
- name: "defaults" | ||
path: "defaults.yaml" |
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,48 @@ | ||
class mcollective_agent_service ( | ||
String $config_name, | ||
Array[String] $client_files = [], | ||
Array[String] $client_directories = [], | ||
Array[String] $server_files = [], | ||
Array[String] $server_directories = [], | ||
Array[String] $common_files = [], | ||
Array[String] $common_directories = [], | ||
Array[String] $executable_files = [], | ||
Boolean $manage_gem_dependencies = true, | ||
Hash $gem_dependencies = {}, | ||
Boolean $manage_package_dependencies = true, | ||
Hash $package_dependencies = {}, | ||
Boolean $manage_class_dependencies = true, | ||
Array[String] $class_dependencies = [], | ||
Mcollective::Policy_action $policy_default = $mcollective::policy_default, | ||
Array[Mcollective::Policy] $policies = [], | ||
Hash $config = {}, | ||
Hash $client_config = {}, | ||
Hash $server_config = {}, | ||
Boolean $client = $mcollective::client, | ||
Boolean $server = $mcollective::server, | ||
Enum["present", "absent"] $ensure = "present" | ||
) { | ||
mcollective::module_plugin{$name: | ||
config_name => $config_name, | ||
client_files => $client_files, | ||
server_files => $server_files, | ||
common_files => $common_files, | ||
executable_files => $executable_files, | ||
client_directories => $client_directories, | ||
server_directories => $server_directories, | ||
common_directories => $common_directories, | ||
gem_dependencies => $gem_dependencies, | ||
manage_gem_dependencies => $manage_gem_dependencies, | ||
package_dependencies => $package_dependencies, | ||
manage_package_dependencies => $manage_package_dependencies, | ||
class_dependencies => $class_dependencies, | ||
policy_default => $policy_default, | ||
policies => $policies, | ||
config => $config, | ||
client_config => $client_config, | ||
server_config => $server_config, | ||
client => $client, | ||
server => $server, | ||
ensure => $ensure | ||
} | ||
} |
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,22 @@ | ||
{ | ||
"name": "choria-mcollective_agent_service", | ||
"version": "4.0.1", | ||
"author": "R.I.Pienaar <[email protected]>", | ||
"license": "Apache-2.0", | ||
"summary": "Manages Operating System Services", | ||
"source": "https://github.com/choria-plugins/service-agent", | ||
"project_page": "https://github.com/choria-plugins/service-agent", | ||
"issues_url": "https://github.com/choria-plugins/service-agent/issues", | ||
"dependencies": [ | ||
{ | ||
"name": "choria/mcollective", | ||
"version_requirement": ">= 0.14.5 < 2.0.0" | ||
} | ||
], | ||
"requirements": [ | ||
{ | ||
"name": "puppet", | ||
"version_requirement": ">= 8.0.0 < 9.0.0" | ||
} | ||
] | ||
} |
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
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
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
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
Oops, something went wrong.