I have a package hosted remotely as either a deb or rpm. Does cloud-init support installing packages from hard-coded remote locations. I'm wanting to install GitLab CLI on machines I spin up but GitLab doesn't provide a repository.
1 Answer
Workaround with runcmd
One method to work around this, if the feature doesn't exist is to use runcmd
,
You can use this to yum install
or curl
and hand the package to dpkg
,
runcmd:
- [ ls, -l, / ]
- [ sh, -xc, "echo $(date) ': hello world!'" ]
- [ sh, -c, echo "=========hello world=========" ]
- ls -l /root
# Note: Don't write files to /tmp from cloud-init use /run/somedir instead.
# Early boot environments can race systemd-tmpfiles-clean LP: #1707222.
- mkdir /run/mydir
- [ wget, "http://slashdot.org", -O, /run/mydir/index.html ]