Skip to content

fwilhe2/system-automation

Repository files navigation

system-automation

CI Job
REUSE status

System Automation powered by Ansible™

Project Layout

This project contains multiple playbooks:

  • epel.yml: Helper to add the Extra Packages for Enterprise Linux repos

  • common.yml: Software and setup which does not require a graphical environment

  • minimal.yml: Subset of the common playbook to get a nice cli environment without too many packages

  • desktop.yml: Setup for desktop computers

  • vm-host.yml: Skips development tools, ment for hosts running dev

  • dev-env.yml: Skips virtualization tools, ment for guests running dev

Preparation

Preparation for Fedora
sudo dnf install -y ansible curl bash unzip
Preparation for *EL-like
sudo dnf install -y ansible-core curl bash unzip
Preparation for Ubuntu/Debian
sudo apt -y install ansible curl bash unzip
Preparation for Archlinux
sudo pacman --sync --refresh --noconfirm ansible curl bash unzip git

Kickstart (experimental)

If you don’t mind the curl | bash thing, you might try running the playbook directly via:

# Common playbook
curl https://raw.githubusercontent.com/fwilhe2/system-automation/main/bootstrap.sh | bash

# Minimal playbook
curl https://raw.githubusercontent.com/fwilhe2/system-automation/main/bootstrap-minimal.sh | bash

This requires ansible, curl, bash and unzip.

Setup (traditional)

Run common playbook
ansible-playbook --ask-become-pass --inventory inventory common.yml
Run desktop playbook
ansible-playbook --ask-become-pass --inventory inventory desktop.yml

Testing

Containerfile

Containerfiles are available for testing. They are run automatically via the CI workflow.

For running them locally, use:

Test on Debian
docker build --build-arg=VERSION=debian:testing -t system-automation-test-debian-latest --file test/container/Containerfile.dpkg .
docker run --tty --volume $PWD:/mnt system-automation-test-debian-latest
Test on Fedora
docker build --build-arg=VERSION=latest -t system-automation-test-fedora-latest --file test/container/Containerfile.fedora .
docker run --tty --volume $PWD:/mnt system-automation-test-fedora-latest

Lima

Lima is a tool written in go for running virtual machines.

Files in the root of this repo named like lima_*.yaml contain vm definitions for testing this repo.

Running the playbook in a vm using lima
# pick the one you need
export SYSAUTO_LIMA_DISTRO=debian
export SYSAUTO_LIMA_DISTRO=fedora
limactl create --name=system-automation-$SYSAUTO_LIMA_DISTRO ./lima_$SYSAUTO_LIMA_DISTRO.yaml
limactl start system-automation-$SYSAUTO_LIMA_DISTRO
limactl shell system-automation-$SYSAUTO_LIMA_DISTRO

# Inside the vm, no password needed for become, just press enter
./run.sh

limactl stop system-automation-$SYSAUTO_LIMA_DISTRO

License

Copyright © 2016-2023 Florian Wilhelm

Free use of this software is granted under the terms of the MIT License.

This project ships the following 3rd party software:

ansible-role-codium (roles/greenleader.codium)

Copyright © Sion Fandrick under the MIT License

ansible-role-vscode (roles/iesplin.vscode)

Copyright © iesplin under the MIT License

ansible-role-visual-studio-code-extensions (library/codium-extensions)

Copyright © John Freeman GantSign Ltd. Company No. 06109112 (registered in England) under the MIT License

Ansible collection - gotmax23.epel (roles/gotmax23.epel*)

Copyright © 2022 Maxwell G (@gotmax23) under the MIT License

lima - linux virtual machines (lima_*yaml)

Based on examples by Akihiro Suda and the lima contributors under the Apache-2.0 license