Skip to content

Instantly share code, notes, and snippets.

@hkwi
Last active March 6, 2019 11:28
Show Gist options
  • Save hkwi/e47e5b618f9011f1c5fbc51c5a46bc7e to your computer and use it in GitHub Desktop.
Save hkwi/e47e5b618f9011f1c5fbc51c5a46bc7e to your computer and use it in GitHub Desktop.
HOSTS="s0 s1 s2"
CLOUD_CFG=$(cat <<"EOF"
#cloud-config
ssh_pwauth: yes
system_info:
default_user:
name: admin
# Following hash is password "hogehoge"
passwd: '$6$rounds=4096$aKbowvLi$V6KFRnvPQ8qKpD7/QwKr.JrE8e9cJ8O4cHwnyMNRAmczwR01jBvrJ9JbkXzli4oEua41qvuBz.YH3Ju8akV8B.'
lock_passwd: false
primary_group: admin
EOF
)
for HOST in $HOSTS; do
lxc launch ubuntu:xenial $HOST -c user.user-data="$CLOUD_CFG";
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment