I have some cloudinit scripts to execute when my AWS EC2 Ubuntu instance starts up.
I want to setup GIT config variables, with the code below.
#cloud-config
runcmd:
- [ sh, -c, "git config --global user.name 'myname'"]
When logged into the terminal. I can execute git config --global user.name 'myname' with no problem.
However when I attempt to start my instance with the cloudinit code. I get an error message
fatal: $HOME not set
My understanding is this is because the HOME is not set when the instance starts up.
Looking for a solution, to get the git variable to be set on startup or an alternate solution.