fwilhe2 / system-automation

System Automation powered by Ansible™
MIT License
3 stars 0 forks source link
ansible ansible-playbook developer-tools infrastructure-as-code linux

// SPDX-FileCopyrightText: Florian Wilhelm // SPDX-License-Identifier: MIT

= system-automation :experimental: yes ifdef::env-github[] :status: :outfilesuffix: .adoc :!toc-title: :caution-caption: :fire: :important-caption: :exclamation: :note-caption: :paperclip: :tip-caption: :bulb: :warning-caption: :warning: endif::[]

image::https://github.com/fwilhe2/system-automation/workflows/CI/badge.svg[CI Job] image::https://api.reuse.software/badge/github.com/fwilhe2/system-automation[REUSE status]

https://api.reuse.software/info/github.com/fwilhe2/system-automation[REUSE status]

System Automation powered by Ansible™

== Project Layout

This project contains multiple playbooks:

== 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

https://github.com/lima-vm/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_LIMADISTRO ./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.

=== Copyright Notice

This project ships the following 3rd party software:

https://github.com/green-leader/ansible-role-codium[ansible-role-codium] (roles/greenleader.codium):: Copyright © Sion Fandrick under the MIT License

https://github.com/iesplin/ansible-role-vscode[ansible-role-vscode] (roles/iesplin.vscode):: Copyright © iesplin under the MIT License

https://github.com/gantsign/ansible-role-visual-studio-code-extensions[ansible-role-visual-studio-code-extensions] (library/codium-extensions):: Copyright © John Freeman GantSign Ltd. Company No. 06109112 (registered in England) under the MIT License

https://git.sr.ht/~gotmax23/ansible-collection-epel[Ansible collection - gotmax23.epel] (roles/gotmax23.epel*):: Copyright © 2022 Maxwell G (@gotmax23) under the MIT License

https://github.com/lima-vm/lima[lima - linux virtual machines] (lima_*yaml):: Based on examples by Akihiro Suda and https://github.com/lima-vm/lima/graphs/contributors[the lima contributors] under the Apache-2.0 license

== References