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