-
Notifications
You must be signed in to change notification settings - Fork 8
/
discovery-beauty.ign
29 lines (29 loc) · 9.6 KB
/
discovery-beauty.ign
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
{
"ignition": {
"version": "3.1.0"
},
"systemd": {
"units": [
{
"name": "precache-images.service",
"enabled": true,
"contents": "[Unit]\nDescription=Load prestaged images in discovery stage\n\nBefore=agent.service\n\n[Service]\nType=oneshot\nUser=root\nWorkingDirectory=/var/mnt\nExecStart=bash /usr/local/bin/extract-ai.sh --label data\n#TimeoutStopSec=30\nExecStopPost=systemctl disable precache-images.service\n\n[Install]\nWantedBy=multi-user.target default.target\nWantedBy=agent.service"
}
]
},
"storage": {
"files": [
{
"overwrite": true,
"path": "/usr/local/bin/extract-ai.sh",
"mode": 493,
"user": {
"name": "root"
},
"contents": {
"source": "data:text/plain;charset=utf-8;base64,IyEvYmluL2Jhc2gKIwojIFV0aWxpdHkgZm9yIGxvYWRpbmcgcHJlc3RhZ2VkIGltYWdlcyBkdXJpbmcgbm9kZSBpbnN0YWxsYXRpb24KIwoKUFJPRz0kKGJhc2VuYW1lICIkMCIpCgpEQVRBRElSPSIvdG1wL3ByZXN0YWdpbmciCkZTPSIvZGV2L2Rpc2svYnktcGFydGxhYmVsL2RhdGEiCgojIERldGVybWluZSB0aGUgaW1hZ2UgbGlzdCBmcm9tIHRoZSBzY3JpcHQgbmFtZSwgZXh0cmFjdC1haS5zaCBvciBleHRyYWN0LW9jcC5zaApJTUdfR1JPVVA9JChlY2hvICIke1BST0d9IiB8IHNlZCAtciAncy8uKmV4dHJhY3QtKC4qKVwuc2gvXDEvJykKSU1HX0xJU1RfRklMRT0iJHtEQVRBRElSfS8ke0lNR19HUk9VUH0taW1hZ2VzLnR4dCIKTUFQUElOR19GSUxFPSIke0RBVEFESVJ9L21hcHBpbmcudHh0IgoKIyBTZXQgdGhlIHBhcmFsbGVsaXphdGlvbiBqb2IgcG9vbCBzaXplIHR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9jYWwgcmM9MAogICAgbG9jYWwgbmFtZT0KCiAgICBlY2hvICIke1BST0d9OiBbREVCVUddIEV4dHJhY3RpbmcgaW1hZ2UgJHt1cml9IgogICAgbmFtZT0kKGJhc2VuYW1lICIke3VyaS86L199IikKICAgIGlmICEgdGFyIC0tdXNlLWNvbXByZXNzLXByb2dyYW09cGlneiAteGYgIiR7bmFtZX0udGd6IjsgdGhlbgogICAgICAgIGVjaG8gIiR7UFJPR306IFtFUlJPUl0gQ291bGQgbm90IGV4dHJhY3QgdGhlIGltYWdlICR7bmFtZX0udGd6IgogICAgICAgIHJldHVybiAxCiAgICBmaQoKICAgIGlmIFtbICIke0lNR19HUk9VUH0iID0gImFpIiAmJiAtbiAiJHt0YWd9IiAmJiAiJHt1cml9IiA9fiAiQHNoYSIgXV07IHRoZW4KICAgICAgICAjIER1cmluZyB0aGUgQUkgbG9hZGluZyBzdGFnZSwgaWYgdGhlIGltYWdlIGhhcyBhIHRhZywgbG9hZCB0aGF0IGludG8gY29udGFpbmVyIHN0b3JhZ2UgYXMgd2VsbAogICAgICAgIGVjaG8gIiR7UFJPR306IFtJTkZPXSBDb3B5aW5nICR7dXJpfSwgd2l0aCB0YWcgJHt0YWd9IFske2N1cnJlbnRfY29weX0vJHt0b3RhbF9jb3BpZXN9XSIKICAgICAgICBub3RhZz0ke3VyaS9AKn0KICAgICAgICBza29wZW8gY29weSAtLXJldHJ5LXRpbWVzIDEwICJkaXI6Ly8ke1BXRH0vJHtuYW1lfSIgImNvbnRhaW5lcnMtc3RvcmFnZToke3VyaX0iIC1xICYmIFwKICAgICAgICAgICAgc2tvcGVvIGNvcHkgLS1yZXRyeS10aW1lcyAxMCAiZGlyOi8vJHtQV0R9LyR7bmFtZX0iICJjb250YWluZXJzLXN0b3JhZ2U6JHtub3RhZ306JHt0YWd9IiAtcQogICAgICAgIHJjPSQ/CiAgICBlbHNlCiAgICAgICAgZWNobyAiJHtQUk9HfTogW0lORk9dIENvcHlpbmcgJHt1cml9IF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IiR7Y3VycmVudF9jb3B5fSIgIiR7dG90YWxfY29waWVzfSIgIiR7dXJpfSIgIiR7dGFnfSIKICAgICAgICByYz0kPwogICAgZG9uZQoKICAgIGVjaG8gIiR7UFJPR306IFtJTkZPXSBJbWFnZSBsb2FkIGRvbmUiCiAgICByZXR1cm4gIiR7cmN9Igp9CgppZiBbWyAiJHtCQVNIX1NPVVJDRVswXX0iID0gIiR7MH0iIF1dOyB0aGVuCiAgICAjCiAgICAjIFByb2Nlc3MgY21kbGluZSBhcmd1bWVudHMKICAgICMKCiAgICBsb25nb3B0cz0oCiAgICAgICAgImhlbHAiCiAgICAgICAgImxhYmVsOiIKICAgICkKCiAgICBsb25nb3B0c19zdHI9JChJRlM9LDsgZWNobyAiJHtsb25nb3B0c1sqXX0iKQoKICAgIGlmICEgT1BUUz0kKGdldG9wdCAtbyAiaGw6IiAtLWxvbmcgIiR7bG9uZ29wdHNfc3RyfSIgLS1uYW1lICIkMCIgLS0gIiRAIik7IHRoZW4KICAgICAgICB1c2FnZQogICAgICAgIGV4aXQgMQogICAgZmkKCiAgICBldmFsIHNldCAtLSAiJHtPUFRTfSIKCiAgICB3aGlsZSA6OyBkbwogICAgICAgIGNhc2UgIiQxIiBpbgogICAgICAgICAgICAtbHwtLWxhYmVsKQogICAgICAgICAgICAgICAgRlM9Ii9kZXYvZGlzay9ieS1wYXJ0bGFiZWwvJHsyfSIKICAgICAgICAgICAgICAgIHNoaWZ0IDIKICAgICAgICAgICAgICAgIDs7CiAgICAgICAgICAgIC0tKQogICAgICAgICAgICAgICAgc2hpZnQKICAgICAgICAgICAgICAgIGJyZWFrCiAgICAgICAgICAgICAgICA7OwogICAgICAgICAgICAtaHwtLWhlbHApCiAgICAgICAgICAgICAgICB1c2FnZQogICAgICAgICAgICAgICAgOzsKICAgICAgICAgICAgKikKICAgICAgICAgICAgICAgIHVzYWdlCiAgICAgICAgICAgICAgICA7OwogICAgICAgIGVzYWMKICAgIGRvbmUKCiAgICBmYWlsZWRfY29waWVzPSgpICMgQXJyYXkgdGhhdCB3aWxsIGluY2x1ZGUgYWxsIHRoZSBpbWFnZXMgdGhhdCBmYWlsZWQgdG8gYmUgcHVsbGVkCgogICAgbW91bnRfZGF0YQoKICAgIGxvYWRfaW1hZ2VzCgogICAgaWYgISByZXRyeV9pbWFnZXM7IHRoZW4KICAgICAgICBlY2hvICIke1BST0d9OiBbRkFJTF0gJHsjZmFpbGVkX2NvcGllc1tAXX0gaW1hZ2VzIHdlcmUgbm90IGxvYWRlZCBzdWNjZXNzZnVsbHksIGFmdGVyICQoKFNFQ09ORFMtU1RBUlQpKSBzZWNvbmRzIiAjbnVtYmVyIG9mIGZhaWxpbmcgaW1hZ2VzCiAgICAgICAgZXhpdCAxCiAgICBlbHNlCiAgICAgICAgZWNobyAiJHtQUk9HfTogW1NVQ0NFU1NdIEFsbCBpbWFnZXMgd2VyZSBsb2FkZWQsIGluICQoKFNFQ09ORFMtU1RBUlQpKSBzZWNvbmRzIgogICAgICAgIGV4aXQgMAogICAgZmkKZmkK"
}
}
]
}
}