diff options
| -rw-r--r-- | .github/workflows/ci.yml | 59 | ||||
| -rw-r--r-- | molecule/default/converge.yml | 2 | ||||
| -rw-r--r-- | roles/bootstrap/vars/ubuntu.yml | 2 |
3 files changed, 61 insertions, 2 deletions
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..0a00ba5 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,59 @@ +--- +name: "CI" +'on': ["push", "pull_request"] +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.x" + - name: Install dependencies + run: pip3 install yamllint ansible-lint + - name: Copy example files + run: | + # Use example files for testing instead of encrypted files + for f in host_vars/*.example; do mv "$f" "$(echo "$f" | sed s/\.example//)"; done + - name: Run + run: | + yamllint . + ansible-lint + + playbook: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + molecule_distro: + - distro: archlinux + platform: "linux/amd64" + - distro: ubuntu + platform: "linux/amd64" + - distro: raspberrypi + platform: "linux/arm64/v8" + steps: + - name: Add ARM support + run: | + sudo apt-get install -y qemu-user-static binfmt-support + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.x" + - name: Install dependencies + run: pip3 install ansible molecule molecule-plugins[docker] + - name: Copy example files + run: | + # Copy host_vars (from the .example files) + for f in host_vars/*.example; do cp "$f" "$(echo "$f" | sed s/\.example//)"; done + - name: Run + env: + PY_COLORS: 1 + ANSIBLE_FORCE_COLOR: 1 + run: >- + molecule --version && + ansible --version && + MOLECULE_COMMAND=${{ matrix.molecule_distro.command }} + MOLECULE_PLATFORM=${{ matrix.molecule_distro.platform }} + MOLECULE_DISTRO=${{ matrix.molecule_distro.distro }} + molecule test diff --git a/molecule/default/converge.yml b/molecule/default/converge.yml index 75790b7..3e3232a 100644 --- a/molecule/default/converge.yml +++ b/molecule/default/converge.yml @@ -35,7 +35,7 @@ dev: "{{ partition_disk }}p3" mount_path: "/mnt" partition_extras: [] - configure_playbook_dir: "../../../ansible-distro-configure" + # configure_playbook_dir: "../../../ansible-distro-configure" pre_tasks: - name: "Get test facts" diff --git a/roles/bootstrap/vars/ubuntu.yml b/roles/bootstrap/vars/ubuntu.yml index 1116087..d5816de 100644 --- a/roles/bootstrap/vars/ubuntu.yml +++ b/roles/bootstrap/vars/ubuntu.yml @@ -2,7 +2,7 @@ bootstrap_distro: name: "noble" # => Ubuntu 24.04 mirror_url: "http://archive.ubuntu.com/ubuntu/" - install_packages: + packages: - "linux-generic-hwe-24.04" - "systemd-boot" - "systemd-boot-efi" |
