commit ebec1869cc7f53d41c9a053e5275467a755fa9a6 Author: Mark Hoekveen Date: Wed Jan 1 14:19:13 2025 +0100 initial commit diff --git a/ansible.cfg b/ansible.cfg new file mode 100644 index 0000000..e731516 --- /dev/null +++ b/ansible.cfg @@ -0,0 +1,37 @@ +[defaults] +inventory=inventory.yml +host_key_checking=False +editor=vim +nocows=1 + +# (string) Path to the Python interpreter to be used for module execution on remote targets, or an automatic discovery mode. Supported discovery modes are ``auto`` (the default), ``auto_silent``, ``auto_legacy``, and ``auto_legacy_silent``. All discovery modes employ a lookup table to use the included system Python (on distributions known to include one), falling back to a fixed ordered list of well-known Python interpreter locations if a platform-specific default is not available. The fallback behavior will issue a warning that the interpreter should be set explicitly (since interpreters installed later may change which one is used). This warning behavior can be disabled by setting ``auto_silent`` or ``auto_legacy_silent``. The value of ``auto_legacy`` provides all the same behavior, but for backward-compatibility with older Ansible releases that always defaulted to ``/usr/bin/python``, will use that interpreter if present. +interpreter_python=auto_silent + +# (path) Option for connections using a certificate or key file to authenticate, rather than an agent or passwords, you can set the default value here to avoid re-specifying ``--private-key`` with every invocation. +;private_key_file= + +[privilege_escalation] +# (boolean) Display an agnostic become prompt instead of displaying a prompt containing the command line supplied become method. +;agnostic_become_prompt=True + +# (boolean) When ``False``(default), Ansible will skip using become if the remote user is the same as the become user, as this is normally a redundant operation. In other words root sudo to root. +# If ``True``, this forces Ansible to use the become plugin anyways as there are cases in which this is needed. +;become_allow_same_user=False + +# (boolean) Toggles the use of privilege escalation, allowing you to 'become' another user after login. +;become=False + +# (boolean) Toggle to prompt for privilege escalation password. +;become_ask_pass=False + +# (string) executable to use for privilege escalation, otherwise Ansible will depend on PATH. +;become_exe= + +# (string) Flags to pass to the privilege escalation executable. +;become_flags= + +# (string) Privilege escalation method to use when `become` is enabled. +;become_method=sudo + +# (string) The user your login/remote user 'becomes' when using privilege escalation, most systems will use 'root' when no user is specified. +;become_user=root diff --git a/checklist.md b/checklist.md new file mode 100644 index 0000000..e0676a4 --- /dev/null +++ b/checklist.md @@ -0,0 +1,17 @@ +# Aurbis install checklist + +## all hosts +* System upgrade +* Basic packages installed (might differ per distro): + * sudo + * vim + * curl + * git + * man + * python(3) +* Kitty terminfo +* User can sudo without password +* root user disabled +* zsh installed +* scripts repo installed +* enable WoL diff --git a/group_vars/arch.yml b/group_vars/arch.yml new file mode 100644 index 0000000..eb835d2 --- /dev/null +++ b/group_vars/arch.yml @@ -0,0 +1,7 @@ +common_packages: + - sudo + - curl + - tmux + - wget + - btop + - python diff --git a/group_vars/debian.yml b/group_vars/debian.yml new file mode 100644 index 0000000..3c59fa4 --- /dev/null +++ b/group_vars/debian.yml @@ -0,0 +1,9 @@ +common_packages: + - vim + - tmux + - python3 + - python3-pip + - sudo + - btop + - kitty-terminfo +host_packages: diff --git a/host_vars/talos.yml b/host_vars/talos.yml new file mode 100644 index 0000000..5c6ff9b --- /dev/null +++ b/host_vars/talos.yml @@ -0,0 +1,2 @@ +host_packages: + - ffmpeg diff --git a/inventory.yml b/inventory.yml new file mode 100644 index 0000000..772d1e6 --- /dev/null +++ b/inventory.yml @@ -0,0 +1,33 @@ +rpi: + hosts: + vaermina: + azura: + kynareth: + nocturnal: +x86: + hosts: + talos: + meridia: + dibella: +debian: + hosts: + vaermina: + talos: + nocturnal: +arch: + hosts: + azura: + kynareth: + meridia: + dibella: +home: + hosts: + azura: + vaermina: + kynareth: + nocturnal: + talos: +cloud: + hosts: + meridia: + dibella: diff --git a/playbook.yml b/playbook.yml new file mode 100644 index 0000000..bda1d0e --- /dev/null +++ b/playbook.yml @@ -0,0 +1,21 @@ +- name: Provision all hosts + hosts: all + become: true + tasks: + - name: >- + Allow mark to passwordless sudo all commands. + (First run should be with --ask-become-pass) + community.general.sudoers: + name: mark-sudo + state: present + user: mark + commands: ALL + - name: Set hostname + hostname: + name: "{{ inventory_hostname }}" + - name: Update debian + include_tasks: tasks/update_debian.yml + when: ansible_os_family == "Debian" + - name: Update arch + include_tasks: tasks/update_arch.yml + when: ansible_os_family == "Archlinux" diff --git a/tasks/update_arch.yml b/tasks/update_arch.yml new file mode 100644 index 0000000..c07af42 --- /dev/null +++ b/tasks/update_arch.yml @@ -0,0 +1,16 @@ +- name: System update + pacman: + update_cache: yes + upgrade: yes +- name: Install common packages + pacman: + name: "{{ common_packages }}" + when: + - common_packages is defined + - common_packages is truthy +- name: Install host-specific packages + pacman: + name: "{{ host_packages }}" + when: + - host_packages is defined + - host_packages is truthy diff --git a/tasks/update_debian.yml b/tasks/update_debian.yml new file mode 100644 index 0000000..3a881d4 --- /dev/null +++ b/tasks/update_debian.yml @@ -0,0 +1,18 @@ +- name: System update + apt: + update_cache: yes + upgrade: dist +- name: Install common packages + apt: + name: "{{ common_packages }}" + state: present + when: + - common_packages is defined + - common_packages is truthy +- name: Install host-specific packages + apt: + name: "{{ host_packages }}" + state: present + when: + - host_packages is defined + - host_packages is truthy