-
Notifications
You must be signed in to change notification settings - Fork 0
/
cloudflared.jps
47 lines (40 loc) · 1.13 KB
/
cloudflared.jps
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
version: 0.1
type: update
name: 'Cloudflared'
homepage: https://github.com/layershift/cloudflared
id: 'cloudflared'
description:
short: Cloudflared tunnel client
logo: cloudflared.png
categories:
- apps/others
targetNodes:
nodeType:
- "*"
onInstall:
deployRPM:
nodeId: ${targetNodes.nodeGroup}
onAfterRedeployContainer:
- forEach(event.response.responses):
deployRPM:
nodeId: ${@i.nodeid}
onAfterScaleOut:
- forEach(event.response.nodes):
deployRPM:
nodeId: ${@i.id}
onUninstall: removeRPM
actions:
deployRPM:
user: root
cmd[${this.nodeId}]:
- yum -q install yum-utils -y
- yum -q update -y
- yum-config-manager --add-repo https://pkg.cloudflare.com/cloudflared-ascii.repo
- yum -q install cloudflared -y
- echo -e "Cmnd_Alias CLOUDFLARED = /usr/local/bin/cloudflared * \n\n%ssh-access ALL = NOPASSWD:CLOUDFLARED" | tee /etc/sudoers.d/cloudflared
removeRPM:
user: root
cmd[${targetNodes.nodeGroup}]:
- yum -q autoremove cloudflared -y
- rm -f /etc/yum.repos.d/cloudflared-ascii.repo
- rm -f /etc/sudoers.d/cloudflared