By Mike DeVita
Like the title says, for some reason this cloud config doesn’t finish… It creates the user with the right keys the run_cmd doesnt finish nor does the group creation… What am I missing?
Also how do you specify passwd: the doc’s state a password hash but i’m really not sure how to generate such a thing for a linux system.
#cloud-config
users:
- name: alpha
groups: sudo
shell: /bin/zsh
sudo: ['ALL=(ALL) NOPASSWD:ALL']
ssh-authorized-keys:
- key1goeshere
groups:
- npm: [alpha]
packages:
- git
- vim
- zsh
- htop
run_cmd:
- curl -sL https://deb.nodesource.com/setup | sudo bash -
- apt-get install nodejs -y
- npm set prefix /usr/local
- chown -R /usr/lib/node/* /usr/local/bin /usr/local/lib
- chmod -R 2775 /usr/local/lib /usr/local/bin /usr/lib/node/*
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
The commands do not run as the module should be runcmd not run_cmd One thing that has personally frustrated me when working with cloud-config files is that they are a bit inconsistent about naming.
As for the passwd, it takes a SHA-512 password hash. On a Unix system, you can generate that using:
mkpasswd --method=SHA-512 --rounds=4096
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.