|
|
@ -57,10 +57,14 @@ function create() { |
|
|
|
packages=(git file bc bash-completion) |
|
|
|
[[ "$OPTION_SSH" == true ]] && packages+=(openssh-server) |
|
|
|
packages_string=$(join ', ' "${packages[@]}") |
|
|
|
|
|
|
|
timezone='Indian/Reunion' #FIXME: should be retrieved from host |
|
|
|
debian_repo='debian.mithril.re' #FIXME: should be retrieved from host |
|
|
|
|
|
|
|
user_data="$( |
|
|
|
cat <<EOF |
|
|
|
#cloud-config |
|
|
|
timezone: 'Indian/Reunion' |
|
|
|
timezone: '$timezone' |
|
|
|
apt: |
|
|
|
preserve_sources_list: false |
|
|
|
conf: | |
|
|
@ -68,19 +72,19 @@ apt: |
|
|
|
DPkg::Lock::Timeout "60"; |
|
|
|
primary: |
|
|
|
- arches: [default] |
|
|
|
uri: http://debian.mithril.re/debian |
|
|
|
uri: http://$debian_repo/debian |
|
|
|
security: |
|
|
|
- arches: [default] |
|
|
|
uri: http://debian.mithril.re/debian-security |
|
|
|
uri: http://$debian_repo/debian-security |
|
|
|
sources_list: | |
|
|
|
# generated by miaou-cloud |
|
|
|
# generated by miaou |
|
|
|
deb \$PRIMARY \$RELEASE main |
|
|
|
deb \$PRIMARY \$RELEASE-updates main |
|
|
|
deb \$SECURITY \$RELEASE-security main |
|
|
|
package_update: true |
|
|
|
package_upgrade: true |
|
|
|
package_reboot_if_required: true |
|
|
|
packages: $packages_string |
|
|
|
packages: [ $packages_string ] |
|
|
|
write_files: |
|
|
|
- path: /etc/sudoers.d/10-add_TOOLBOX_to_secure_path |
|
|
|
content: > |
|
|
@ -96,6 +100,7 @@ runcmd: |
|
|
|
final_message: "Container from datasource \$datasource is finally up, after \$UPTIME seconds" |
|
|
|
EOF |
|
|
|
)" |
|
|
|
|
|
|
|
lxc init local:debian/$CONTAINER_RELEASE/cloud "$CONTAINER" --config user.user-data="$user_data" -q |
|
|
|
|
|
|
|
# allow directory `SHARED` to be read-write mounted |
|
|
@ -159,7 +164,7 @@ EOF |
|
|
|
fi |
|
|
|
|
|
|
|
if [[ "$OPTION_SSH" == true && "$OPTION_SAMEUSER" == true ]]; then |
|
|
|
lxc-miaou-enable-ssh "$CONTAINER" |
|
|
|
lxc-miaou-enable-ssh "$CONTAINER" >/dev/null |
|
|
|
fi |
|
|
|
|
|
|
|
PREFIX="" echoinfo OK |
|
|
|