This commit is contained in:
2023-11-18 17:28:18 +03:00
commit 6063360ded
9 changed files with 163 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
("/sysconfig-base/language" action "write" lang ("en_US"))
("/sysconfig-base/kbd" action "write" layout "ctrl_shift_toggle")
("/datetime-installer" action "write" commit #t name "RU" zone "Europe/Moscow" utc #t)
("/evms/control" action "write" control open installer #t)
("/evms/control" action "write" control update)
("/evms/profiles/server" action apply commit #f clearall #t exclude ())
("/evms/control" action "write" control commit)
("/evms/control" action "write" control close)
("/pkg-init" action "write")
("/pkg-install" action "write" lists "" auto #t)
("/preinstall" action "write")
("/grub" action "write" device "/dev/vda" passwd #f passwd_1 "*" passwd_2 "*")
("/net-eth" action "write" reset #t)
("/net-eth" action "write" name "eth0" configuration "dhcp")
("/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")

View File

@@ -0,0 +1,5 @@
((server
(title . "Setup")
(action . trivial)
(actiondata ("/" (size 1024000 . #t ) (fsim . "Ext2/3") (methods plain)))
))

11
alt-server-v-10/setup.sh Normal file
View File

@@ -0,0 +1,11 @@
#!/bin/bash -e
# 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
# 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

17
alt-server-v-10/setup.yml Normal file
View File

@@ -0,0 +1,17 @@
---
- name: Provision
hosts: default
become: true
become_method: su
gather_facts: false
vars:
become_password: vagrant
tasks:
- name: Shell
ansible.builtin.shell: |
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
echo "vagrant ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/vagrant
chmod 0440 /etc/sudoers.d/vagrant

View File

@@ -0,0 +1,22 @@
iso_url = "./iso/alt-server-v-10.1-x86_64.iso"
iso_checksum = "sha256:9955e7bb5ee9affbe3de7473a3bcd53f7d8463b9e2f43ef6831ebfe71bc7da6c"
ssh_username = "vagrant"
ssh_password = "vagrant"
vm_name = "alt-server-v-10"
http_dir = "./alt-server-v-10/http"
output_directory = "./builds/alt-server-v-10"
output_filename = "alt-server-v-10-amd64"
boot_command = [
"<wait><wait><wait><wait><wait><wait><wait><wait>",
"e<wait><down><down><down><end><spacebar>",
"ai curl=http://{{ .HTTPIP }}:{{ .HTTPPort }}/",
"<f10>"
]
setup_playbook = "./alt-server-v-10/setup.yml"
setup_script = "./alt-server-v-10/setup.sh"