-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplugin.yaml
More file actions
174 lines (152 loc) · 6.47 KB
/
Copy pathplugin.yaml
File metadata and controls
174 lines (152 loc) · 6.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
##################################################################################
# Cloudify Package Installer Plugin Types
# Author: kemi
##################################################################################
tosca_definitions_version: cloudify_dsl_1_1
plugins:
package_installer:
executor: host_agent
source: https://github.com/kemiz/cloudify-package-installer-plugin/archive/master.zip
workflows:
##################################################################################
# Package workflows
# Install, remove & update packages on Ubuntu or CentOS systems
##################################################################################
install_packages:
mapping: package_installer.package_installer_workflows.tasks.install_packages
parameters:
package_list:
description: >
Provide a list of RPM or DEB file URLs to install
node_id:
description: >
The node id to execute workflow on
remove_packages:
mapping: package_installer.package_installer_workflows.tasks.remove_packages
parameters:
package_list:
description: >
Provide a list of RPM or DEB file URLs to uninstall
node_id:
description: >
The node id to execute workflow on
##################################################################################
# Service workflows
# Start, stop & restart installed services on Ubuntu or CentOS systems
##################################################################################
start_service:
mapping: package_installer.package_installer_workflows.service_workflows.start_service
parameters:
service_name:
type: string
description: >
Name of the service to start
node_id:
type: string
description: >
The node id to execute workflow on
stop_service:
mapping: package_installer.package_installer_workflows.service_workflows.stop_service
parameters:
service_name:
type: string
description: >
Name of the service to stop
node_id:
type: string
description: >
The node id to execute workflow on
node_types:
##################################################################################
# Service Installer Type
# Extends the PackageInstaller type and adds capabilities to control a service.
# A list of packages can be supplied which will be installed in sequential order.
# The implementation uses: "sudo service <service_name> start / stop / restart"
# to control the service operation
##################################################################################
cloudify.nodes.PackageInstaller:
derived_from: cloudify.nodes.SoftwareComponent
properties:
service_name:
default: 'PackageInstaller_Node'
version:
default: 1
config:
default: None
interfaces:
cloudify.interfaces.lifecycle:
create:
implementation: package_installer.package_installer_plugin.tasks.install_packages
inputs:
config:
default: { get_property: [ SELF, config ] }
##################################################################################
# Package Command mappings
##################################################################################
package.commands:
install_packages:
implementation: package_installer.package_installer_plugin.tasks.install_packages
remove_packages:
implementation: package_installer.package_installer_plugin.tasks.remove_packages
##################################################################################
# Service Installer Type
# Extends the PackageInstaller type and adds capabilities to control a service.
# A list of packages can be supplied which will be installed in sequential order.
# The implementation uses: "sudo service <service_name> start / stop / restart"
# to control the service operation
##################################################################################
cloudify.nodes.ServiceInstaller:
derived_from: cloudify.nodes.PackageInstaller
interfaces:
cloudify.interfaces.lifecycle:
start:
implementation: package_installer.package_installer_plugin.service_tasks.start_service
inputs:
service_name:
default: { get_property: [ SELF, service_name ] }
stop:
implementation: package_installer.package_installer_plugin.service_tasks.stop_service
inputs:
service_name:
default: { get_property: [ SELF, service_name ] }
##################################################################################
# Service Command mappings
##################################################################################
service.commands:
start_service:
implementation: package_installer.package_installer_plugin.service_tasks.start_service
inputs:
service_name:
default: { get_property: [ SELF, service_name ] }
stop_service:
implementation: package_installer.package_installer_plugin.service_tasks.stop_service
inputs:
service_name:
default: { get_property: [ SELF, service_name ] }
restart_service:
implementation: package_installer.package_installer_plugin.service_tasks.restart_service
inputs:
service_name:
default: { get_property: [ SELF, service_name ] }
##################################################################################
# Configuration Type
##################################################################################
configuration:
derived_from: cloudify.nodes.Root
properties:
config: {}
relationships:
service.contained_in:
derived_from: cloudify.relationships.contained_in
properties:
service_name:
default: 'service'
target_interfaces:
cloudify.interfaces.relationship_lifecycle:
postconfigure:
implementation: package_installer.package_installer_plugin.service_relationships.contained_in
inputs:
service_name:
default: { get_property: [ SELF, service_name ] }
description: >
Name of the service to stop