Skip to content

Instantly share code, notes, and snippets.

@tinoji
Created February 7, 2018 01:02
Show Gist options
  • Select an option

  • Save tinoji/7e066d61a84d98374b08d2414d9524f2 to your computer and use it in GitHub Desktop.

Select an option

Save tinoji/7e066d61a84d98374b08d2414d9524f2 to your computer and use it in GitHub Desktop.

Revisions

  1. tinoji created this gist Feb 7, 2018.
    19 changes: 19 additions & 0 deletions proxmox_lxc_pct_provisioner.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,19 @@
    pct create <id> /var/lib/vz/template/cache/centos-7-default_20170504_amd64.tar.xz \
    -arch amd64 \
    -ostype <centos|ubuntu|etc> \
    -hostname <hostname> \
    -cores <cores> \
    -memory <memory(MB)> \
    -swap <swap(MB)> \
    -storage local-lvm \
    -password \
    -net0 name=eth0,bridge=<bridge>,gw=<gateway>,ip=<cidr>,type=veth &&\
    pct start <id> &&\
    sleep 10 &&\
    pct resize <id> rootfs <storage(ex: +4G)> &&\
    pct exec <id> -- bash -c "yum update -y &&\
    yum install -y openssh-server &&\
    systemctl start sshd &&\
    useradd -mU hogeuser &&\
    echo "password" | passwd --stdin hogeuser"