Hello everyone.
I'm trying to automate the setup of my PBS using Ansible and ran into an issue where I can't create a ZFS pool via the API.
I decided to try creating it using curl for testing. My script looks like this:
But it gives me this error:
I've tried different options but haven't succeeded. Where did I go wrong?
I'm trying to automate the setup of my PBS using Ansible and ran into an issue where I can't create a ZFS pool via the API.
I decided to try creating it using curl for testing. My script looks like this:
Bash:
curl -X POST \
--insecure --cookie "$(<cookie)" --header "$(<csrftoken)" \
-H "Content-Type: application/json" \
-d '{
"name": "pool",
"devices": ["/dev/sdb", "/dev/sdc"],
"raidlevel": "mirror",
"compression": "lz4",
"ashift": 12
}' \
"https://$APINODE:8007/api2/json/nodes/localhost/disks/zfs"
But it gives me this error:
parameter verification failed - 'devices': Expected string value.
I've tried different options but haven't succeeded. Where did I go wrong?