This commit is contained in:
Cindy Deng 2021-05-12 23:58:38 -07:00
Родитель f2ea75661f
Коммит 01514a0641
2 изменённых файлов: 22 добавлений и 14 удалений

Просмотреть файл

@ -46,7 +46,7 @@ echo ""
# run scripts in order, can take parsed input from above # run scripts in order, can take parsed input from above
./validate-tier1-os.sh ./validate-tier1-os.sh
./install-container-management.sh ./install-container-management.sh
./install-edge-runtime.sh ./install-edge-runtime.sh ${parsed_cmds[SCOPE_ID]} ${parsed_cmds[REGISTRATION_ID]} ${parsed_cmds[SYMMETRIC_KEY]}
./validate-post-install.sh ./validate-post-install.sh
cd .. cd ..

Просмотреть файл

@ -1,26 +1,34 @@
#script to install edge runtime 1.2 #script to install edge runtime 1.2
# update # update
# sudo apt-get update sudo apt-get update
# install Azure IoT Edge Runtime 1.2 # install Azure IoT Edge Runtime 1.2
# sudo apt-get install aziot-edge -y sudo apt-get install aziot-edge -y
# create .toml from template # create .toml from template
# sudo cp /etc/aziot/config.toml.edge.template /etc/aziot/config.toml sudo cp /etc/aziot/config.toml.edge.template /etc/aziot/config.toml
CONNECTION_STRING=$1 SCOPE_ID=$1
REGISTRATION_ID=$2
SYMMETRIC_KEY=$3
# replace with connection string sed -i '/## DPS provisioning with symmetric key/,/## DPS provisioning with X.509 certificate/c\
sed -i '/## Manual provisioning with connection string/,/## Manual provisioning with symmetric key/c\ ## DPS provisioning with symmetric key\
## Manual provisioning with connection string\
\
[provisioning]\ [provisioning]\
source = "manual"\ source = "dps"\
connection_string = \"'$CONNECTION_STRING'\" \ global_endpoint = "https://global.azure-devices-provisioning.net"\
id_scope = \"'$SCOPE_ID'\"\
\ \
# [provisioning.attestation]\
method = "symmetric_key"\
registration_id = \"'$REGISTRATION_ID'\"\
\ \
## Manual provisioning with symmetric key\ symmetric_key = { value = \"'$SYMMETRIC_KEY'\" } # inline key (base64), or...\
' sample.toml # symmetric_key = { uri = "file:///var/secrets/device-id.key" } # file URI, or...\
# symmetric_key = { uri = "pkcs11:slot-id=0;object=device%20id?pin-value=1234" } # PKCS#11 URI\
\
## DPS provisioning with X.509 certificate\
' /etc/aziot/config.toml
# sudo iotedge config apply sudo iotedge config apply