diff --git a/.gitignore b/.gitignore index d42bcf2..edcc058 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -iso/*.iso \ No newline at end of file +iso/*.iso +package.box \ No newline at end of file diff --git a/alt-server-v-10/http/autoinstall.scm b/alt-server-v-10/http/autoinstall.scm index bea8a8f..6c9f6cc 100644 --- a/alt-server-v-10/http/autoinstall.scm +++ b/alt-server-v-10/http/autoinstall.scm @@ -10,9 +10,10 @@ ("/pkg-install" action "write" lists "" auto #t) ("/preinstall" action "write") ("/grub" action "write" device "/dev/vda" passwd #f passwd_1 "*" passwd_2 "*") +; настройка сетевого интерфейса на получение адреса по DHCP ("/net-eth" action "write" reset #t) -("/net-eth" action "write" name "eth0" configuration "dhcp") +("/net-eth" action "write" name "ens5" ipv "4" configuration "dhcp" default "" search "" dns "" computer_name "newhost" ipv_enabled #t) ("/net-eth" action "write" commit #t) ("/root/change_password" language ("en_US") passwd_2 "vagrant" passwd_1 "vagrant") ("/users/create_account" new_name "vagrant" gecos "vagrant" allow_su #t auto #f passwd_1 "vagrant" passwd_2 "vagrant" autologin #f) -("/postinstall/laststate" script "http://server/script.sh") \ No newline at end of file +("/postinstall/laststate" script "https://raw.githubusercontent.com/Maks1mS/alt-linux-vagrant-boxes/main/alt-server-v-10/setup.sh") \ No newline at end of file diff --git a/alt-server-v-10/setup.sh b/alt-server-v-10/setup.sh index ad77381..fa3761a 100644 --- a/alt-server-v-10/setup.sh +++ b/alt-server-v-10/setup.sh @@ -1,11 +1,13 @@ #!/bin/bash -e +a= . install2-init-functions + # add vagrant's public key - user can ssh without password -mkdir -pm 700 /home/vagrant/.ssh -curl -q -o /home/vagrant/.ssh/authorized_keys https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub -chmod 0600 /home/vagrant/.ssh/authorized_keys -chown -R vagrant:vagrant /home/vagrant/.ssh +run_chroot mkdir -pm 700 /home/vagrant/.ssh +run_chroot curl -q -o /home/vagrant/.ssh/authorized_keys https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub +run_chroot chmod 0600 /home/vagrant/.ssh/authorized_keys +run_chroot chown -R vagrant:vagrant /home/vagrant/.ssh # give sudo access (grants all permissions to user vagrant) -echo "vagrant ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/vagrant -chmod 0440 /etc/sudoers.d/vagrant \ No newline at end of file +run_chroot echo "vagrant ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/vagrant +run_chroot chmod 0440 /etc/sudoers.d/vagrant \ No newline at end of file