Update 3 files
- /home/.chezmoitemplates/secrets/JUMPCLOUD_CONNECT_KEY - /home/.chezmoiscripts/windows/run_onchange_before_03-jumpcloud.ps1.tmpl - /home/.chezmoiscripts/universal/run_onchange_before_03-jumpcloud.sh.tmpl
This commit is contained in:
parent
0e610cc53d
commit
fefb690486
3 changed files with 32 additions and 0 deletions
|
@ -0,0 +1,21 @@
|
||||||
|
{{- if and (eq .host.distro.family "linux") (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (or (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "JUMPCLOUD_CONNECT_KEY")) (env "JUMPCLOUD_CONNECT_KEY")) -}}
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# @file JumpCloud Device Enrollment
|
||||||
|
# @brief Enrolls the device as a JumpCloud asset if `JUMPCLOUD_CONNECT_KEY` is defined
|
||||||
|
# @description
|
||||||
|
# This script enrolls the device as a JumpCloud managed asset. The `JUMPCLOUD_CONNECT_KEY` secret should
|
||||||
|
# be populated using one of the methods described in the [Secrets documentation](https://install.doctor/docs/customization/secrets).
|
||||||
|
#
|
||||||
|
# *Note: You should check out the supported systems before trying to enroll devices.*
|
||||||
|
#
|
||||||
|
# ## Links
|
||||||
|
#
|
||||||
|
# * [JumpCloud device management requirements](https://support.jumpcloud.com/support/s/article/jumpcloud-agent-compatibility-system-requirements-and-impacts1)
|
||||||
|
|
||||||
|
{{ includeTemplate "universal/profile-before" }}
|
||||||
|
{{ includeTemplate "universal/logg-before" }}
|
||||||
|
|
||||||
|
logg info 'Enrolling device with JumpCloud by running the kickstart script'
|
||||||
|
curl --tlsv1.2 --silent --show-error --header 'x-connect-key: {{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "JUMPCLOUD_CONNECT_KEY")) }}{{- includeTemplate "secrets/JUMPCLOUD_CONNECT_KEY" | decrypt -}}{{ else }}{{- env "JUMPCLOUD_CONNECT_KEY" -}}{{ end }}' https://kickstart.jumpcloud.com/Kickstart | sudo bash
|
||||||
|
|
||||||
|
{{ end -}}
|
|
@ -0,0 +1,3 @@
|
||||||
|
{{- if and (eq .host.distro.family "windows") (stat (joinPath .host.home ".config" "age" "chezmoi.txt")) (or (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "JUMPCLOUD_CONNECT_KEY")) (env "JUMPCLOUD_CONNECT_KEY")) -}}
|
||||||
|
cd $env:temp | Invoke-Expression; Invoke-RestMethod -Method Get -URI https://raw.githubusercontent.com/TheJumpCloud/support/master/scripts/windows/InstallWindowsAgent.ps1 -OutFile InstallWindowsAgent.ps1 | Invoke-Expression; ./InstallWindowsAgent.ps1 -JumpCloudConnectKey "{{ if (stat (joinPath .chezmoi.sourceDir ".chezmoitemplates" "secrets" "JUMPCLOUD_CONNECT_KEY")) }}{{- includeTemplate "secrets/JUMPCLOUD_CONNECT_KEY" | decrypt -}}{{ else }}{{- env "JUMPCLOUD_CONNECT_KEY" -}}{{ end }}"
|
||||||
|
{{- end -}}
|
8
home/.chezmoitemplates/secrets/JUMPCLOUD_CONNECT_KEY
Normal file
8
home/.chezmoitemplates/secrets/JUMPCLOUD_CONNECT_KEY
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
-----BEGIN AGE ENCRYPTED FILE-----
|
||||||
|
YWdlLWVuY3J5cHRpb24ub3JnL3YxCi0+IFgyNTUxOSA4WGJ1YytScVd3Y2M5Qld5
|
||||||
|
TUNkNGRUcnE2dDM2MXlhWGVBQnRiamtQK25zCnZLNE9uaU8wWm1OUi9pTzhidFc3
|
||||||
|
Nk9RVVdBVlNScUpibUxWbzRtcUw4UEEKLS0tIFArZ1M0S2huNmFGdjZnTHE0Z3Fv
|
||||||
|
dHgzYzRyZHdNME51bktQenRrVjRSY2cKE8he0EmO8f42R16QvRaOvhwKhoEM7V1f
|
||||||
|
1Lb/SEx5SIrvQbs17Sx762L9Gwkx0VaOErX/mJK2CvmCcXZ2ZB1QX1Ui7lbF5sCc
|
||||||
|
hg==
|
||||||
|
-----END AGE ENCRYPTED FILE-----
|
Loading…
Reference in a new issue