Skip to content

Commit

Permalink
Add new role, 'debops.nixos'
Browse files Browse the repository at this point in the history
  • Loading branch information
drybjed committed Sep 26, 2024
1 parent 8811240 commit 0b01093
Show file tree
Hide file tree
Showing 18 changed files with 1,244 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1733,6 +1733,9 @@ stages:
JANE_DIFF_PATTERN: '.*/roles/nginx/.*'
JANE_LOG_PATTERN: '\[nginx\]'

# `nixos role` is not testable on a Debian VM, so it is not currently tested in
# the CI pipeline.

'nodejs role':
<<: *test_role_1st_deps
needs:
Expand Down
7 changes: 7 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ You can read information about required changes between releases in the
Added
~~~~~

New DebOps roles
''''''''''''''''

- The :ref:`debops.nixos` role with its corresponding playbook can be used to
manage NixOS-based hosts. The role is not included in the main
:file:`site.yml` playbook, which is focused on Debian/Ubuntu hosts.

:ref:`debops.dovecot` role
''''''''''''''''''''''''''

Expand Down
30 changes: 30 additions & 0 deletions ansible/playbooks/nixos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
# Copyright (C) 2024 Maciej Delmanowski <[email protected]>
# Copyright (C) 2024 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-or-later

# This playbook is not included in the DebOps main playbooks meant for
# Debian/Ubuntu hosts and is meant to be used as standalone against NixOS
# hosts. See the 'debops.nixos' role documentation for details.
#
# Usage examples:
# debops run nixos
# debops check nixos
# debops run nixos -l <host> --diff


- name: Manage NixOS hosts using DebOps
collections: [ 'debops.debops' ]
hosts: [ 'debops_nixos_hosts' ]
become: True

environment: '{{ inventory__environment | d({})
| combine(inventory__group_environment | d({}))
| combine(inventory__host_environment | d({})) }}'

tasks:

- name: Configure NixOS system
ansible.builtin.import_role:
name: 'debops.debops.nixos'
tags: [ 'role::nixos', 'skip::nixos' ]
17 changes: 17 additions & 0 deletions ansible/roles/nixos/COPYRIGHT
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
debops.nixos - Manage NixOS system configuration using Ansible

Copyright (C) 2024 Maciej Delmanowski <[email protected]>
Copyright (C) 2024 DebOps <https://debops.org/>
SPDX-License-Identifier: GPL-3.0-or-later

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3, as
published by the Free Software Foundation.

This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see https://www.gnu.org/licenses/
Loading

0 comments on commit 0b01093

Please sign in to comment.