flow
flow copied to clipboard
Impossible automate setup/bootstrap node via several reasons.
When we used command like this:
./boot-tools/bootstrap key --address "consensus-001.nodes.flow.com:3569" --role consensus -o ./bootstrap
We cannot use the standard output for the next steps.
Because no option for output in plain text or JSON format.
Ok, we can use > for forward output to a text file and then parse it.
But we got not just a text, we have ANSI colored text with ESC codes (((
And on this step, we also must parse all ESC chars.
Common who did this? How to use it with ansible? See how trivial tasks mutate to monster, and I am just in the first steps of the manual.
bootstrap key --address "flow.domain.org:3569" --role collection -o /var/flow/bootstrap > result.txt
YOUR_MACHINE_ACCOUNT_ADDRESS=$(echo $(cat result.txt |sed 's/\x1b\[[0-9;]*[mGKHF]//g' | grep machineAccountPubKey | cut -d '=' -f2) )
echo ${YOUR_MACHINE_ACCOUNT_ADDRESS}
bootstrap machine-account --address ${YOUR_MACHINE_ACCOUNT_ADDRESS} -o /var/flow/bootstrap