Last active
March 6, 2019 11:28
-
-
Save hkwi/e47e5b618f9011f1c5fbc51c5a46bc7e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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