Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/wikioasis/salt/llms.txt

Use this file to discover all available pages before exploring further.

The base state is the foundation applied to every minion in the WikiOasis fleet. It performs three small but critical bootstrap tasks: setting the system timezone, writing a clean sources.list pointing at the configured Debian mirror, and enforcing a minimal apt configuration that suppresses recommended and suggested package installation. Because these settings are prerequisites for all subsequent states, the base state runs first — before any role-specific configuration.

Pillar keys

KeyDefaultDescription
timezoneEtc/UTCTimezone string passed to timezone.system
apt:mirrordeb.debian.orgHostname of the Debian apt mirror
Both keys are optional. If absent from the pillar, Salt uses the defaults shown above.

What it configures

Timezone

Sets the OS timezone using Salt’s timezone.system state, defaulting to Etc/UTC.

Apt sources.list

Writes /etc/apt/sources.list from a Jinja template, enabling main contrib non-free non-free-firmware components across the base, updates, and security suites.

Apt config

Writes /etc/apt/apt.conf to disable installation of recommended and suggested packages system-wide.

State file

# salt/base/init.sls
{%- set apt_mirror = salt['pillar.get']('apt:mirror', 'deb.debian.org') %}
{%- set codename = grains['oscodename'] %}

set_timezone:
  timezone.system:
    - name: {{ salt['pillar.get']('timezone', 'Etc/UTC') }}

/etc/apt/sources.list:
  file.managed:
    - user: root
    - group: root
    - mode: '0644'
    - contents: |
        deb http://{{ apt_mirror }}/debian {{ codename }} main contrib non-free non-free-firmware
        deb http://{{ apt_mirror }}/debian {{ codename }}-updates main contrib non-free non-free-firmware
        deb http://security.debian.org/debian-security {{ codename }}-security main contrib non-free non-free-firmware

apt_update:
  cmd.run:
    - name: apt-get update -qq
    - onchanges:
      - file: /etc/apt/sources.list

/etc/apt/apt.conf:
  file.managed:
    - user: root
    - group: root
    - mode: '0644'
    - contents: |
        APT::Install-Recommends "0";
        APT::Install-Suggests "0";

Rendered sources.list

The oscodename grain is resolved at apply time from the minion’s OS, so the same state works across all current Debian releases. A typical rendered /etc/apt/sources.list for a Debian 12 (bookworm) host using the default mirror looks like:
deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
To use a local or regional mirror, set apt:mirror in the relevant pillar. For example, to use the UK mirror set apt:mirror: ftp.uk.debian.org.

Application scope

The base state is assigned to the '*' glob in top.sls, meaning it is applied to every minion on every highstate run. To apply it in isolation:
salt '*' state.apply base
The apt_update step uses onchanges, so apt-get update only runs when sources.list actually changes — not on every Salt run.

Build docs developers (and LLMs) love