[ 'o=${distro_id},a=${distro_codename}', 'o=${distro_id},a=${distro_codename}-security', ], 'unattended_mail' => $config['mail'], 'unattended_automatic_reboot' => true, 'unattended_syslog_enable' => true, ], $config ); return [ # setup unattended upgrades (new Task())->setModule(new AptModule([ 'package' => 'unattended-upgrades', 'updateCache' => true, ])), (new Task())->setModule(new TemplateModule([ 'src' => __DIR__ . '/unattended-upgrades/auto-upgrades.twig', 'dest' => '/etc/apt/apt.conf.d/20auto-upgrades', 'vars' => $config, 'owner' => 'root', 'group' => 'root', 'mode' => 0644, ])), (new Task())->setModule(new TemplateModule([ 'src' => __DIR__ . '/unattended-upgrades/unattended-upgrades.twig', 'dest' => '/etc/apt/apt.conf.d/50unattended-upgrades', 'vars' => $config, 'owner' => 'root', 'group' => 'root', 'mode' => 0644, ])), # setup user (new Task())->setModule(new AptModule([ 'package' => 'zsh', ])), (new Task())->setModule(new UserModule([ 'username' => $config['username'], 'password' => $config['password'], 'groups' => ['sudo'], 'append' => true, 'shell' => '/bin/zsh', ])), (new Task())->setModule(new CopyModule([ 'src' => '~/.ssh', 'dest' => '/home/' . $config['username'], 'owner' => $config['username'], 'group' => $config['username'], 'remoteSrc' => true, ])), (new Task())->setModule(new GitModule([ 'repo' => 'https://github.com/ohmyzsh/ohmyzsh.git', 'dest' => "/home/$config[username]/.oh-my-zsh", 'owner' => $config['username'], 'group' => $config['username'], ])), (new Task())->setModule(new CopyModule([ 'src' => "/home/$config[username]/.oh-my-zsh/templates/zshrc.zsh-template", 'dest' => "/home/$config[username]/.zshrc", 'owner' => $config['username'], 'group' => $config['username'], 'remoteSrc' => true, ])), # setup firewall (new Task())->setModule(new UfwModule([ 'rule' => 'allow', 'name' => 'OpenSSH', 'state' => State::ENABLED, ])), ]; } }