Vendor Galaxy Roles and Collections
Some checks failed
/ Ansible Lint (push) Failing after 5m45s
/ Ansible Lint (pull_request) Failing after 4m59s

This commit is contained in:
Stefan Bethke 2026-02-06 22:07:16 +01:00
commit 2aed20393f
223 changed files with 387444 additions and 2 deletions

View file

@ -0,0 +1,20 @@
debops-playbooks - Set of Ansible playbooks for DebOps Project
Copyright (C) 2013-2017 Maciej Delmanowski <drybjed@gmail.com>
Copyright (C) 2015-2017 Robin Schneider <ypid@riseup.net>
Copyright (C) 2014-2017 DebOps <https://debops.org/>
SPDX-License-Identifier: GPL-3.0-only
This repository is part of DebOps.
DebOps 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.
DebOps 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 DebOps. If not, see https://www.gnu.org/licenses/.

View file

@ -0,0 +1,202 @@
---
# Copyright (C) 2019-2020 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2019-2020 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
# This playbook can be used to bootstrap new Debian/Ubuntu host to be used with
# LDAP environment. It will automatically enable LDAP support and prepare
# secure access to the LDAP directory, including PAM/NSS and SSH key lookups.
#
# The configuration applied by this playbook is minimal, just enough to be able
# to login via SSH using information gathered from LDAP. You should apply the
# DebOps 'common.yml' playbook on a host afterwards to complete the initial
# configuration, for example firewall/TCP Wrappers setup.
#
# Note that an alternative is provided by bootstrap-sss which relies on the
# sssd daemon rather than the nslcd/nscd daemons.
#
# Usage:
# To connect directly as root, run:
#
# debops bootstrap-ldap -u root -k --limit host
#
# To connect as normal user and switch to sudo, run:
#
# debops bootstrap-ldap --become --limit host
- name: Bootstrap Python support on a host
collections: [ 'debops.debops', 'debops.roles01',
'debops.roles02', 'debops.roles03' ]
hosts: [ 'debops_all_hosts', 'debops_service_bootstrap' ]
strategy: linear
gather_facts: False
become: True
tasks:
- name: Initialize Ansible support via raw tasks
ansible.builtin.import_role:
name: 'python'
tasks_from: 'main_raw'
tags: [ 'role::python_raw', 'skip::python_raw', 'role::python' ]
- name: Bootstrap APT configuration on a host
collections: [ 'debops.debops', 'debops.roles01',
'debops.roles02', 'debops.roles03' ]
hosts: [ 'debops_all_hosts', 'debops_service_bootstrap' ]
become: True
environment: '{{ inventory__environment | d({})
| combine(inventory__group_environment | d({}))
| combine(inventory__host_environment | d({})) }}'
roles:
- role: apt_proxy
tags: [ 'role::apt_proxy', 'skip::apt_proxy' ]
- role: apt
tags: [ 'role::apt', 'skip::apt' ]
- name: Apply core configuration
import_playbook: 'service/core.yml'
- name: Bootstrap host for Ansible management with LDAP
collections: [ 'debops.debops', 'debops.roles01',
'debops.roles02', 'debops.roles03' ]
hosts: [ 'debops_all_hosts', 'debops_service_bootstrap' ]
become: True
environment: '{{ inventory__environment | d({})
| combine(inventory__group_environment | d({}))
| combine(inventory__host_environment | d({})) }}'
vars:
# Automatically enable LDAP support on new hosts
ldap__enabled: True
pre_tasks:
- name: Prepare pki environment
ansible.builtin.import_role:
name: 'pki'
tasks_from: 'main_env'
tags: [ 'role::pki', 'role::pki:secret', 'role::secret' ]
- name: Prepare sshd environment
ansible.builtin.import_role:
name: 'sshd'
tasks_from: 'main_env'
tags: [ 'role::sshd', 'role::ldap' ]
roles:
- role: resolved
tags: [ 'role::resolved', 'skip::resolved' ]
- role: python
tags: [ 'role::python', 'skip::python', 'role::netbase', 'role::ldap' ]
python__dependent_packages3:
- '{{ netbase__python__dependent_packages3 }}'
- '{{ ldap__python__dependent_packages3 }}'
python__dependent_packages2:
- '{{ netbase__python__dependent_packages2 }}'
- '{{ ldap__python__dependent_packages2 }}'
- role: netbase
tags: [ 'role::netbase', 'skip::netbase' ]
- role: secret
tags: [ 'role::secret', 'role::pki', 'role::pki:secret' ]
secret_directories:
- '{{ pki_env_secret_directories }}'
- role: fhs
tags: [ 'role::fhs', 'skip::fhs' ]
- role: apt_preferences
tags: [ 'role::apt_preferences', 'skip::apt_preferences' ]
apt_preferences__dependent_list:
- '{{ etckeeper__apt_preferences__dependent_list }}'
- '{{ yadm__apt_preferences__dependent_list }}'
- role: etckeeper
tags: [ 'role::etckeeper', 'skip::etckeeper' ]
- role: cron
tags: [ 'role::cron', 'skip::cron' ]
- role: atd
tags: [ 'role::atd', 'skip::atd' ]
- role: dhparam
tags: [ 'role::dhparam', 'skip::dhparam' ]
- role: pki
tags: [ 'role::pki', 'skip::pki' ]
- role: machine
tags: [ 'role::machine', 'skip::machine' ]
# LDAP client initialization should be done separately to prepare local
# facts for other roles to use in configuration.
- role: ldap
tags: [ 'role::ldap', 'skip::ldap' ]
- role: ldap
tags: [ 'role::ldap', 'skip::ldap' ]
ldap__dependent_tasks:
- '{{ nslcd__ldap__dependent_tasks }}'
- '{{ sudo__ldap__dependent_tasks }}'
- '{{ sshd__ldap__dependent_tasks }}'
- role: nslcd
tags: [ 'role::nslcd', 'skip::nslcd' ]
when: (ansible_local.ldap.posix_enabled | d()) | bool
- role: nscd
tags: [ 'role::nscd', 'skip::nscd' ]
when: (ansible_local.ldap.posix_enabled | d()) | bool
- role: keyring
tags: [ 'role::keyring', 'skip::keyring', 'role::yadm' ]
keyring__dependent_gpg_keys:
- '{{ yadm__keyring__dependent_gpg_keys }}'
- role: yadm
tags: [ 'role::yadm', 'skip::yadm' ]
- role: sudo
tags: [ 'role::sudo', 'skip::sudo', 'role::system_groups' ]
sudo__dependent_sudoers:
- '{{ sshd__sudo__dependent_sudoers }}'
# The 'sudo' APT package modifies '/etc/nsswitch.conf' by itself, running
# this role after 'debops.sudo' role skips additional changes done in the
# configuration later on.
- role: nsswitch
tags: [ 'role::nsswitch', 'skip::nsswitch' ]
nsswitch__dependent_services:
- '{{ nslcd__nsswitch__dependent_services }}'
- role: libuser
tags: [ 'role::libuser', 'skip::libuser' ]
- role: system_groups
tags: [ 'role::system_groups', 'skip::system_groups' ]
- role: system_users
tags: [ 'role::system_users', 'skip::system_users' ]
- role: pam_access
tags: [ 'role::pam_access', 'skip::pam_access' ]
pam_access__dependent_rules:
- '{{ sshd__pam_access__dependent_rules }}'
- role: sshd
tags: [ 'role::sshd', 'skip::sshd' ]

View file

@ -0,0 +1,200 @@
---
# Copyright (C) 2019-2020 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2021 David Härdeman <david@hardeman.nu>
# Copyright (C) 2019-2021 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
# This playbook can be used to bootstrap new Debian/Ubuntu host to be used with
# LDAP environment. It will automatically enable LDAP support and prepare
# secure access to the LDAP directory, including PAM/NSS and SSH key lookups.
#
# The configuration applied by this playbook is minimal, just enough to be able
# to login via SSH using information gathered from LDAP. You should apply the
# DebOps 'common.yml' playbook on a host afterwards to complete the initial
# configuration, for example firewall/TCP Wrappers setup.
#
# Note that this playbook is an alternative to the bootstrap-ldap playbook,
# which sets up the target system with nslcd/nscd integration, whereas this
# playbook instead relies on sssd (but should otherwise be identical).
#
# Usage:
# To connect directly as root, run:
#
# debops bootstrap-sss -u root -k --limit host
#
# To connect as normal user and switch to sudo, run:
#
# debops bootstrap-sss --become --limit host
- name: Bootstrap Python support on a host
collections: [ 'debops.debops', 'debops.roles01',
'debops.roles02', 'debops.roles03' ]
hosts: [ 'debops_all_hosts', 'debops_service_bootstrap' ]
strategy: linear
gather_facts: False
become: True
tasks:
- name: Initialize Ansible support via raw tasks
ansible.builtin.import_role:
name: 'python'
tasks_from: 'main_raw'
tags: [ 'role::python_raw', 'skip::python_raw', 'role::python' ]
- name: Bootstrap APT configuration on a host
collections: [ 'debops.debops', 'debops.roles01',
'debops.roles02', 'debops.roles03' ]
hosts: [ 'debops_all_hosts', 'debops_service_bootstrap' ]
become: True
environment: '{{ inventory__environment | d({})
| combine(inventory__group_environment | d({}))
| combine(inventory__host_environment | d({})) }}'
roles:
- role: apt_proxy
tags: [ 'role::apt_proxy', 'skip::apt_proxy' ]
- role: apt
tags: [ 'role::apt', 'skip::apt' ]
- name: Apply core configuration
import_playbook: 'service/core.yml'
- name: Bootstrap host for Ansible management with LDAP
collections: [ 'debops.debops', 'debops.roles01',
'debops.roles02', 'debops.roles03' ]
hosts: [ 'debops_all_hosts', 'debops_service_bootstrap' ]
become: True
environment: '{{ inventory__environment | d({})
| combine(inventory__group_environment | d({}))
| combine(inventory__host_environment | d({})) }}'
vars:
# Automatically enable LDAP support on new hosts
ldap__enabled: True
pre_tasks:
- name: Prepare pki environment
ansible.builtin.import_role:
name: 'pki'
tasks_from: 'main_env'
tags: [ 'role::pki', 'role::pki:secret', 'role::secret' ]
- name: Prepare sshd environment
ansible.builtin.import_role:
name: 'sshd'
tasks_from: 'main_env'
tags: [ 'role::sshd', 'role::ldap' ]
roles:
- role: resolved
tags: [ 'role::resolved', 'skip::resolved' ]
- role: python
tags: [ 'role::python', 'skip::python', 'role::netbase', 'role::ldap' ]
python__dependent_packages3:
- '{{ netbase__python__dependent_packages3 }}'
- '{{ ldap__python__dependent_packages3 }}'
python__dependent_packages2:
- '{{ netbase__python__dependent_packages2 }}'
- '{{ ldap__python__dependent_packages2 }}'
- role: netbase
tags: [ 'role::netbase', 'skip::netbase' ]
- role: secret
tags: [ 'role::secret', 'role::pki', 'role::pki:secret' ]
secret_directories:
- '{{ pki_env_secret_directories }}'
- role: fhs
tags: [ 'role::fhs', 'skip::fhs' ]
- role: apt_preferences
tags: [ 'role::apt_preferences', 'skip::apt_preferences' ]
apt_preferences__dependent_list:
- '{{ etckeeper__apt_preferences__dependent_list }}'
- '{{ yadm__apt_preferences__dependent_list }}'
- role: etckeeper
tags: [ 'role::etckeeper', 'skip::etckeeper' ]
- role: cron
tags: [ 'role::cron', 'skip::cron' ]
- role: atd
tags: [ 'role::atd', 'skip::atd' ]
- role: dhparam
tags: [ 'role::dhparam', 'skip::dhparam' ]
- role: pki
tags: [ 'role::pki', 'skip::pki' ]
- role: machine
tags: [ 'role::machine', 'skip::machine' ]
# LDAP client initialization should be done separately to prepare local
# facts for other roles to use in configuration.
- role: ldap
tags: [ 'role::ldap', 'skip::ldap' ]
- role: ldap
tags: [ 'role::ldap', 'skip::ldap' ]
ldap__dependent_tasks:
- '{{ sudo__ldap__dependent_tasks }}'
- '{{ sshd__ldap__dependent_tasks }}'
- '{{ sssd__ldap__dependent_tasks }}'
- role: sssd
tags: [ 'role::sssd', 'skip::sssd' ]
when: ansible_local.ldap.posix_enabled | d() | bool
- role: keyring
tags: [ 'role::keyring', 'skip::keyring', 'role::yadm' ]
keyring__dependent_gpg_keys:
- '{{ yadm__keyring__dependent_gpg_keys }}'
- role: yadm
tags: [ 'role::yadm', 'skip::yadm' ]
- role: sudo
tags: [ 'role::sudo', 'skip::sudo', 'role::system_groups' ]
sudo__dependent_sudoers:
- '{{ sshd__sudo__dependent_sudoers }}'
# The 'sudo' APT package modifies '/etc/nsswitch.conf' by itself, running
# this role after 'debops.sudo' role skips additional changes done in the
# configuration later on.
- role: nsswitch
tags: [ 'role::nsswitch', 'skip::nsswitch' ]
nsswitch__dependent_services:
- '{{ sssd__nsswitch__dependent_services }}'
- role: libuser
tags: [ 'role::libuser', 'skip::libuser' ]
- role: system_groups
tags: [ 'role::system_groups', 'skip::system_groups' ]
- role: system_users
tags: [ 'role::system_users', 'skip::system_users' ]
- role: pam_access
tags: [ 'role::pam_access', 'skip::pam_access' ]
pam_access__dependent_rules:
- '{{ sshd__pam_access__dependent_rules }}'
- role: sshd
tags: [ 'role::sshd', 'skip::sshd' ]

View file

@ -0,0 +1,113 @@
---
# Copyright (C) 2014-2020 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2015-2020 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
# This playbook can be used to bootstrap freshly installed minimal Debian
# system for Ansible management. The expected state the host:
# - host is already configured in Ansible inventory/hosts file;
# - local user has prepared SSH key pair in RSA format;
# - host has OpenSSH server installed;
#
# Modifications that will be made on the host:
# - playbook will install Python support with some essential software;
# - a system 'admins' group will be created for users who have administrator
# privileges (full sudo permissions);
# - a system administrator account will be created and added to the 'admins'
# group; If you are connecting directly as root, this account will be named
# after your local user account, otherwise it will be named after the user
# you are connecting as (option `-u` or ansible_ssh_user from some config- or
# inventory-file).
# - no passwords are set or modified on any account;
# - if set, playbook will configure hostname and domain on the host using
# 'inventory_hostname' and 'netbase__domain' variables;
#
# Usage:
# To connect directly as root, run:
#
# debops bootstrap -u root -k --limit host
#
# To connect as normal user and switch to sudo, run:
#
# debops bootstrap --become --limit host
- name: Bootstrap Python support on a host
collections: [ 'debops.debops', 'debops.roles01',
'debops.roles02', 'debops.roles03' ]
hosts: [ 'debops_all_hosts', 'debops_service_bootstrap' ]
strategy: linear
gather_facts: False
become: True
tasks:
- name: Initialize Ansible support via raw tasks
ansible.builtin.import_role:
name: 'python'
tasks_from: 'main_raw'
tags: [ 'role::python_raw', 'skip::python_raw', 'role::python' ]
- name: Bootstrap APT configuration on a host
collections: [ 'debops.debops', 'debops.roles01',
'debops.roles02', 'debops.roles03' ]
hosts: [ 'debops_all_hosts', 'debops_service_bootstrap' ]
become: True
environment: '{{ inventory__environment | d({})
| combine(inventory__group_environment | d({}))
| combine(inventory__host_environment | d({})) }}'
roles:
- role: apt_proxy
tags: [ 'role::apt_proxy', 'skip::apt_proxy' ]
- role: apt
tags: [ 'role::apt', 'skip::apt' ]
- name: Apply core configuration
import_playbook: 'service/core.yml'
- name: Bootstrap host for Ansible management
collections: [ 'debops.debops', 'debops.roles01',
'debops.roles02', 'debops.roles03' ]
hosts: [ 'debops_all_hosts', 'debops_service_bootstrap' ]
become: True
environment: '{{ inventory__environment | d({})
| combine(inventory__group_environment | d({}))
| combine(inventory__host_environment | d({})) }}'
roles:
- role: resolved
tags: [ 'role::resolved', 'skip::resolved' ]
- role: python
tags: [ 'role::python', 'skip::python', 'role::netbase' ]
python__dependent_packages3:
- '{{ netbase__python__dependent_packages3 }}'
python__dependent_packages2:
- '{{ netbase__python__dependent_packages2 }}'
- role: netbase
tags: [ 'role::netbase', 'skip::netbase' ]
- role: fhs
tags: [ 'role::fhs', 'skip::fhs' ]
- role: sudo
tags: [ 'role::sudo', 'skip::sudo', 'role::system_groups' ]
- role: libuser
tags: [ 'role::libuser', 'skip::libuser' ]
- role: system_groups
tags: [ 'role::system_groups', 'skip::system_groups' ]
- role: system_users
tags: [ 'role::system_users', 'skip::system_users' ]

View file

@ -0,0 +1,9 @@
---
# Copyright (C) 2023 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2023 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
# This is a stub playbook to allow execution of the common playbook directly,
# for backwards compatibility.
- name: Apply common configuration on hosts
import_playbook: 'layer/common.yml'

View file

@ -0,0 +1,19 @@
---
# Copyright (C) 2019-2023 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2019-2023 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
- name: Configure Filebeat service
import_playbook: '../service/filebeat.yml'
- name: Configure Metricbeat service
import_playbook: '../service/metricbeat.yml'
- name: Configure GitLab Runner service
import_playbook: '../service/gitlab_runner.yml'
- name: Configure Telegraf service
import_playbook: '../service/telegraf.yml'
- name: Configure Zabbix Agent
import_playbook: '../service/zabbix_agent.yml'

View file

@ -0,0 +1,67 @@
---
# Copyright (C) 2015-2023 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2015-2023 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
- name: Configure SKS Keyserver service
import_playbook: '../service/sks.yml'
- name: Configure iPXE service
import_playbook: '../service/ipxe.yml'
- name: Configure backup2l service
import_playbook: '../service/backup2l.yml'
- name: Configure rsnapshot service
import_playbook: '../service/rsnapshot.yml'
- name: Configure Mailman service
import_playbook: '../service/mailman.yml'
- name: Configure Miniflux service
import_playbook: '../service/miniflux.yml'
- name: Configure LibreNMS application
import_playbook: '../service/librenms.yml'
- name: Configure DokuWiki application
import_playbook: '../service/dokuwiki.yml'
- name: Configure NetBox application
import_playbook: '../service/netbox.yml'
- name: Configure Etherpad application
import_playbook: '../service/etherpad.yml'
- name: Configure Debian Preseed service
import_playbook: '../service/preseed.yml'
- name: Configure ownCloud/Nextcloud application
import_playbook: '../service/owncloud.yml'
- name: Configure phpMyAdmin application
import_playbook: '../service/phpmyadmin.yml'
- name: Configure phpIPAM application
import_playbook: '../service/phpipam.yml'
- name: Configure RStudio Server service
import_playbook: '../service/rstudio_server.yml'
- name: Configure GitLab Omnibus application
import_playbook: '../service/gitlab.yml'
- name: Configure Ansible tool
import_playbook: '../service/ansible.yml'
- name: Configure Ansible Controller environment
import_playbook: '../service/controller.yml'
- name: Configure Roundcube application
import_playbook: '../service/roundcube.yml'
- name: Configure IMAP Proxy service
import_playbook: '../service/imapproxy.yml'
- name: Configure Debconf-based application packages
import_playbook: '../service/debconf.yml'

View file

@ -0,0 +1,273 @@
---
# Copyright (C) 2013-2023 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2014-2023 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
- name: Security assertions
collections: [ 'debops.debops', 'debops.roles01',
'debops.roles02', 'debops.roles03' ]
hosts: [ 'all' ]
tags: [ 'play::security-assertions' ]
gather_facts: False
become: False
tasks:
- name: Check for Ansible version without known vulnerabilities
ansible.builtin.assert:
that:
- 'ansible_version.full is version_compare("2.1.5.0", ">=")'
- '((ansible_version.minor == 2) and
(ansible_version.full is version_compare("2.2.2.0", ">="))) or
(ansible_version.minor != 2)'
msg: |
VULNERABLE or unsupported Ansible version DETECTED, please update to
Ansible >= v2.1.5 or a newer Ansible release >= v2.2.2! To skip, add
"--skip-tags play::security-assertions" parameter. Check the
debops-playbook changelog for details. Exiting.
run_once: True
delegate_to: 'localhost'
- name: Prepare APT configuration on a host
collections: [ 'debops.debops', 'debops.roles01',
'debops.roles02', 'debops.roles03' ]
hosts: [ 'debops_all_hosts', '!debops_no_common' ]
become: True
environment: '{{ inventory__environment | d({})
| combine(inventory__group_environment | d({}))
| combine(inventory__host_environment | d({})) }}'
roles:
- role: apt_proxy
tags: [ 'role::apt_proxy', 'skip::apt_proxy' ]
- role: apt
tags: [ 'role::apt', 'skip::apt' ]
- name: Apply core configuration
import_playbook: '../service/core.yml'
- name: Common configuration for all hosts
collections: [ 'debops.debops', 'debops.roles01',
'debops.roles02', 'debops.roles03' ]
hosts: [ 'debops_all_hosts', '!debops_no_common' ]
gather_facts: True
become: True
environment: '{{ inventory__environment | d({})
| combine(inventory__group_environment | d({}))
| combine(inventory__host_environment | d({})) }}'
pre_tasks:
- name: Prepare nullmailer environment
ansible.builtin.import_role:
name: 'nullmailer'
tasks_from: 'main_env'
tags: [ 'role::nullmailer', 'role::ferm', 'role::tcpwrappers' ]
- name: Prepare pki environment
ansible.builtin.import_role:
name: 'pki'
tasks_from: 'main_env'
tags: [ 'role::pki', 'role::pki:secret', 'role::secret' ]
- name: Prepare sshd environment
ansible.builtin.import_role:
name: 'sshd'
tasks_from: 'main_env'
tags: [ 'role::sshd', 'role::ldap' ]
roles:
- role: debops_fact
tags: [ 'role::debops_fact', 'skip::debops_fact' ]
- role: environment
tags: [ 'role::environment', 'skip::environment' ]
- role: resolved
tags: [ 'role::resolved', 'skip::resolved' ]
- role: python
tags: [ 'role::python', 'skip::python', 'role::netbase', 'role::ldap' ]
python__dependent_packages3:
- '{{ netbase__python__dependent_packages3 }}'
- '{{ ldap__python__dependent_packages3 }}'
python__dependent_packages2:
- '{{ netbase__python__dependent_packages2 }}'
- '{{ ldap__python__dependent_packages2 }}'
- role: netbase
tags: [ 'role::netbase', 'skip::netbase' ]
- role: secret
tags: [ 'role::secret', 'role::pki', 'role::pki:secret' ]
secret_directories:
- '{{ pki_env_secret_directories }}'
- role: fhs
tags: [ 'role::fhs', 'skip::fhs' ]
- role: apt_preferences
tags: [ 'role::apt_preferences', 'skip::apt_preferences' ]
apt_preferences__dependent_list:
- '{{ etckeeper__apt_preferences__dependent_list }}'
- '{{ apt_install__apt_preferences__dependent_list }}'
- '{{ yadm__apt_preferences__dependent_list }}'
- role: tzdata
tags: [ 'role::tzdata', 'skip::tzdata' ]
- role: etckeeper
tags: [ 'role::etckeeper', 'skip::etckeeper' ]
- role: cron
tags: [ 'role::cron', 'skip::cron' ]
- role: atd
tags: [ 'role::atd', 'skip::atd' ]
- role: dhparam
tags: [ 'role::dhparam', 'skip::dhparam' ]
- role: pki
tags: [ 'role::pki', 'skip::pki' ]
- role: machine
tags: [ 'role::machine', 'skip::machine' ]
- role: lldpd
tags: [ 'role::lldpd', 'skip::lldpd' ]
# LDAP client initialization should be done separately to prepare local
# facts for other roles to use in configuration.
- role: ldap
tags: [ 'role::ldap', 'skip::ldap' ]
- role: ldap
tags: [ 'role::ldap', 'skip::ldap' ]
ldap__dependent_tasks:
- '{{ nullmailer__ldap__dependent_tasks }}'
- '{{ sudo__ldap__dependent_tasks }}'
- '{{ sshd__ldap__dependent_tasks }}'
- role: keyring
tags: [ 'role::keyring', 'skip::keyring', 'role::yadm' ]
keyring__dependent_gpg_keys:
- '{{ yadm__keyring__dependent_gpg_keys }}'
- role: yadm
tags: [ 'role::yadm', 'skip::yadm' ]
- role: sudo
tags: [ 'role::sudo', 'skip::sudo' ]
sudo__dependent_sudoers:
- '{{ sshd__sudo__dependent_sudoers }}'
# The 'sudo' APT package modifies '/etc/nsswitch.conf' by itself, running
# this role after 'debops.sudo' role skips additional changes done in the
# configuration later on.
- role: nsswitch
tags: [ 'role::nsswitch', 'skip::nsswitch' ]
- role: root_account
tags: [ 'role::root_account', 'skip::root_account' ]
- role: libuser
tags: [ 'role::libuser', 'skip::libuser' ]
- role: system_groups
tags: [ 'role::system_groups', 'skip::system_groups' ]
- role: system_users
tags: [ 'role::system_users', 'skip::system_users' ]
- role: pam_access
tags: [ 'role::pam_access', 'skip::pam_access' ]
pam_access__dependent_rules:
- '{{ sshd__pam_access__dependent_rules }}'
- role: apt_listchanges
tags: [ 'role::apt_listchanges', 'skip::apt_listchanges' ]
- role: apt_install
tags: [ 'role::apt_install', 'skip::apt_install' ]
- role: etc_services
tags: [ 'role::etc_services', 'skip::etc_services' ]
etc_services__dependent_list:
- '{{ resolved__etc_services__dependent_list }}'
- role: logrotate
tags: [ 'role::logrotate', 'skip::logrotate' ]
logrotate__dependent_config:
- '{{ rsyslog__logrotate__dependent_config }}'
- role: auth
tags: [ 'role::auth', 'skip::auth' ]
- role: users
tags: [ 'role::users', 'skip::users' ]
- role: mount
tags: [ 'role::mount', 'skip::mount' ]
- role: resources
tags: [ 'role::resources', 'skip::resources' ]
- role: ferm
tags: [ 'role::ferm', 'skip::ferm' ]
ferm__dependent_rules:
- '{{ nullmailer__ferm__dependent_rules }}'
- '{{ rsyslog__ferm__dependent_rules }}'
- '{{ sshd__ferm__dependent_rules }}'
- role: tcpwrappers
tags: [ 'role::tcpwrappers', 'skip::tcpwrappers' ]
tcpwrappers_dependent_allow:
- '{{ nullmailer__tcpwrappers__dependent_allow }}'
- '{{ sshd__tcpwrappers__dependent_allow }}'
- role: locales
tags: [ 'role::locales', 'skip::locales' ]
- role: proc_hidepid
tags: [ 'role::proc_hidepid', 'skip::proc_hidepid' ]
- role: console
tags: [ 'role::console', 'skip::console' ]
- role: sysctl
tags: [ 'role::sysctl', 'skip::sysctl' ]
- role: nullmailer
tags: [ 'role::nullmailer', 'skip::nullmailer' ]
- role: systemd
tags: [ 'role::systemd', 'skip::systemd' ]
- role: timesyncd
tags: [ 'role::timesyncd', 'skip::timesyncd' ]
- role: journald
tags: [ 'role::journald', 'skip::journald' ]
- role: rsyslog
tags: [ 'role::rsyslog', 'skip::rsyslog' ]
- role: unattended_upgrades
tags: [ 'role::unattended_upgrades', 'skip::unattended_upgrades' ]
- role: authorized_keys
tags: [ 'role::authorized_keys', 'skip::authorized_keys' ]
- role: sshd
tags: [ 'role::sshd', 'skip::sshd' ]
- role: apt_mark
tags: [ 'role::apt_mark', 'skip::apt_mark' ]

View file

@ -0,0 +1,28 @@
---
# Copyright (C) 2015-2023 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2015-2023 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
- name: Manage NodeJS environment
import_playbook: '../service/nodejs.yml'
- name: Manage Ruby environment
import_playbook: '../service/ruby.yml'
- name: Manage Go language environment
import_playbook: '../service/golang.yml'
- name: Manage Java environment
import_playbook: '../service/java.yml'
- name: Manage CRAN APT repositories
import_playbook: '../service/cran.yml'
- name: Manage PHP environment
import_playbook: '../service/php.yml'
- name: Manage fcgiwrap service
import_playbook: '../service/fcgiwrap.yml'
- name: Manage WordPress CLI tool
import_playbook: '../service/wpcli.yml'

View file

@ -0,0 +1,10 @@
---
# Copyright (C) 2015-2023 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2015-2023 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
- name: Configure Hardware RAID monitoring
import_playbook: '../service/hwraid.yml'
- name: Configure GRUB bootloader
import_playbook: '../service/grub.yml'

View file

@ -0,0 +1,43 @@
---
# Copyright (C) 2015-2023 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2015-2023 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
- name: Configure network interfaces via networkd
import_playbook: '../service/networkd.yml'
- name: Configure network interfaces via ifupdown
import_playbook: '../service/ifupdown.yml'
- name: Configure IPv6 Router Advertisement daemon
import_playbook: '../service/radvd.yml'
- name: Configure ISC DHCP daemon
import_playbook: '../service/dhcpd.yml'
- name: Configure NTP service
import_playbook: '../service/ntp.yml'
- name: Configure unbound service
import_playbook: '../service/unbound.yml'
- name: Configure DNSmasq service
import_playbook: '../service/dnsmasq.yml'
- name: Configure Tinc VPN service
import_playbook: '../service/tinc.yml'
- name: Configure ISC DHCP Relay service
import_playbook: '../service/dhcrelay.yml'
- name: Configure DHCP Probe service
import_playbook: '../service/dhcp_probe.yml'
- name: Configure SSL Tunnel service
import_playbook: '../service/stunnel.yml'
- name: Configure keepalived service
import_playbook: '../service/keepalived.yml'
- name: Configure Avahi service
import_playbook: '../service/avahi.yml'

View file

@ -0,0 +1,175 @@
---
# Copyright (C) 2015-2023 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2015-2023 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
- name: Configure /etc/aliases database
import_playbook: '../service/etc_aliases.yml'
- name: Configure etesync service
import_playbook: '../service/etesync.yml'
- name: Install HashiCorp applications
import_playbook: '../service/hashicorp.yml'
- name: Configure APT-Cacher-NG service
import_playbook: '../service/apt_cacher_ng.yml'
- name: Configure APT mirror service
import_playbook: '../service/apt_mirror.yml'
- name: Configure docker-gen service
import_playbook: '../service/docker_gen.yml'
- name: Configure gunicorn service
import_playbook: '../service/gunicorn.yml'
- name: Configure Postfix SMTP server
import_playbook: '../service/postfix.yml'
- name: Configure saslauthd service
import_playbook: '../service/saslauthd.yml'
- name: Configure Dovecot IMAP/POP3 server
import_playbook: '../service/dovecot.yml'
- name: Configure postscreen Postfix service
import_playbook: '../service/postscreen.yml'
- name: Configure Postwhite Postfix service
import_playbook: '../service/postwhite.yml'
- name: Manage Postfix service configuration
import_playbook: '../service/postconf.yml'
- name: Configure Postfix LDAP support
import_playbook: '../service/postldap.yml'
- name: Configure OpenDKIM service
import_playbook: '../service/opendkim.yml'
- name: Configure Apache webserver
import_playbook: '../service/apache.yml'
- name: Configure nginx webserver
import_playbook: '../service/nginx.yml'
- name: Configure Mosquitto service
import_playbook: '../service/mosquitto.yml'
- name: Configure SNMP daemon
import_playbook: '../service/snmpd.yml'
- name: Configure Monit service
import_playbook: '../service/monit.yml'
- name: Configure TFTP daemon
import_playbook: '../service/tftpd.yml'
- name: Configure Samba service
import_playbook: '../service/samba.yml'
- name: Configure TGT, userspace iSCSI client
import_playbook: '../service/tgt.yml'
- name: Configure MariaDB/MySQL database
import_playbook: '../service/mariadb_server.yml'
- name: Configure MariaDB/MySQL client
import_playbook: '../service/mariadb.yml'
- name: Configure PostgreSQL service
import_playbook: '../service/postgresql_server.yml'
- name: Configure PostgreSQL client
import_playbook: '../service/postgresql.yml'
- name: Configure Elastic APT repositories
import_playbook: '../service/elastic_co.yml'
- name: Configure Elasticsearch database
import_playbook: '../service/elasticsearch.yml'
- name: Configure Kibana service
import_playbook: '../service/kibana.yml'
- name: Configure InfluxData APT repositories
import_playbook: '../service/influxdata.yml'
- name: Configure InfluxDB database
import_playbook: '../service/influxdb_server.yml'
- name: Configure InfluxDB client
import_playbook: '../service/influxdb.yml'
- name: Configure Icinga 2 service
import_playbook: '../service/icinga.yml'
- name: Configure Icinga 2 database
import_playbook: '../service/icinga_db.yml'
- name: Configure Icinga 2 Web frontend
import_playbook: '../service/icinga_web.yml'
- name: Configure RabbitMQ service
import_playbook: '../service/rabbitmq_server.yml'
- name: Configure RabbitMQ management webconsole
import_playbook: '../service/rabbitmq_management.yml'
- name: Configure memcached service
import_playbook: '../service/memcached.yml'
- name: Configure Redis database
import_playbook: '../service/redis_server.yml'
- name: Configure Redis Sentinel service
import_playbook: '../service/redis_sentinel.yml'
- name: Configure MinIO service
import_playbook: '../service/minio.yml'
- name: Configure MinIO Client
import_playbook: '../service/mcli.yml'
- name: Configure Docker Registry service
import_playbook: '../service/docker_registry.yml'
- name: Configure reprepro APT repository
import_playbook: '../service/reprepro.yml'
- name: Configure SMS Gateway service
import_playbook: '../service/smstools.yml'
- name: Install Salt Master service
import_playbook: '../service/salt.yml'
- name: Configure Fail2ban service
import_playbook: '../service/fail2ban.yml'
- name: Configure Prosody XMPP server
import_playbook: '../service/prosody.yml'
- name: Configure FreeRADIUS service
import_playbook: '../service/freeradius.yml'
- name: Configure Tinyproxy service
import_playbook: '../service/tinyproxy.yml'
- name: Configure libuser library
import_playbook: '../service/libuser.yml'
- name: Configure MiniDLNA service
import_playbook: '../service/minidlna.yml'
- name: Configure PowerDNS service
import_playbook: '../service/pdns.yml'
- name: Configure BIND DNS server
import_playbook: '../service/bind.yml'
- name: Configure rspamd service
import_playbook: '../service/rspamd.yml'
- name: Configure OpenSearch database
import_playbook: '../service/opensearch.yml'

View file

@ -0,0 +1,64 @@
---
# Copyright (C) 2015-2023 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2015-2023 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
- name: Configure mount points
import_playbook: '../service/mount.yml'
- name: Configure network information database
import_playbook: '../service/netbase.yml'
- name: Configure sysnews service
import_playbook: '../service/sysnews.yml'
- name: Configure kernel modules
import_playbook: '../service/kmod.yml'
- name: Configure sysfs attributes
import_playbook: '../service/sysfs.yml'
- name: Configure swap files
import_playbook: '../service/swapfile.yml'
- name: Configure LVM subsystem
import_playbook: '../service/lvm.yml'
- name: Configure NFS server service
import_playbook: '../service/nfs_server.yml'
- name: Configure NFS client service
import_playbook: '../service/nfs.yml'
- name: Configure gitusers environment
import_playbook: '../service/gitusers.yml'
- name: Configure OpenLDAP service
import_playbook: '../service/slapd.yml'
- name: Configure nslcd service
import_playbook: '../service/nslcd.yml'
- name: Configure nscd service
import_playbook: '../service/nscd.yml'
- name: Configure sssd service
import_playbook: '../service/sssd.yml'
- name: Configure iSCSI devices
import_playbook: '../service/iscsi.yml'
- name: Configure cryptsetup subsystem
import_playbook: '../service/cryptsetup.yml'
- name: Configure QubesOS persistent paths
import_playbook: '../service/persistent_paths.yml'
- name: Configure external APT repositories
import_playbook: '../service/extrepo.yml'
- name: Configure NeuroDebian APT repository
import_playbook: '../service/neurodebian.yml'
- name: Configure dropbear SSH server in initramfs
import_playbook: '../service/dropbear_initramfs.yml'

View file

@ -0,0 +1,19 @@
---
# Copyright (C) 2023 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2023 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
- name: Configure system and service manager
import_playbook: '../service/systemd.yml'
- name: Configure system journal and log service
import_playbook: '../service/journald.yml'
- name: Configure network manager service
import_playbook: '../service/networkd.yml'
- name: Configure time synchronization service
import_playbook: '../service/timesyncd.yml'
- name: Configure system resolver
import_playbook: '../service/resolved.yml'

View file

@ -0,0 +1,22 @@
---
# Copyright (C) 2015-2023 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2015-2023 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
- name: Configure LXC service
import_playbook: '../service/lxc.yml'
- name: Configure LXD service
import_playbook: '../service/lxd.yml'
- name: Configure Docker Engine service
import_playbook: '../service/docker_server.yml'
- name: Configure libvirt daemon service
import_playbook: '../service/libvirtd.yml'
- name: Configure libvirt qemu support
import_playbook: '../service/libvirtd_qemu.yml'
- name: Configure libvirt client environment
import_playbook: '../service/libvirt.yml'

View file

@ -0,0 +1,75 @@
---
# Copyright (C) 2019 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2019 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
# DebOps uses the "to_uuid" Ansible filter to convert LDAP Distinguished Names
# to UUID strings that are safe to use in shell and store in the filesystem.
# This playbook can be used to convert Distinguished Names to UUID strings to
# help locate specific data about a particular Distinguished Name, for example
# a password stored in the 'secret/ldap/credentials/' directory or in the
# 'pass' database.
#
# To use this playbook, it is best to apply it against a specific host that is
# configured to use LDAP via the 'ldap' Ansible role. If that's not the case,
# the playbook will still work, however the resulting UUIDs might not be
# correct.
#
# Remember to specify Distinguished Name attributes separated by commas,
# without spaces between them. For example, don't use:
#
# uid=user, ou=People, dc=example, dc=org
#
# Specify the DN as:
#
# uid=user,ou=People,dc=example,dc=org
#
# Usage: debops ldap/get-uuid -l ldap-host
- name: Convert LDAP Distinguished Name to UUID
collections: [ 'debops.debops', 'debops.roles01',
'debops.roles02', 'debops.roles03' ]
hosts: [ 'all' ]
serial: '1'
gather_subset: [ '!all' ]
vars:
# LDAP base Distinguished Name
ldap_base_dn: '{{ ansible_local.ldap.base_dn
if (ansible_local.ldap.base_dn | d())
else (ansible_domain.split(".")
| map("regex_replace", "^(.*)$", "dc=\1")
| list) }}'
# Relative Distinguished Name of the LDAP object that contains the personal
# user accounts
ldap_people_rdn: '{{ ansible_local.ldap.people_rdn | d("ou=People") }}'
# Relative Distinguished Name of an user account to convert to an UUID
person_rdn: 'uid={{ person_uid.user_input }}'
# Distinguished Name of an LDAP object to convert to an UUID
object_dn: '{{ (([ person_rdn, ldap_people_rdn ] + ldap_base_dn) | join(","))
if person_uid.user_input | d()
else object_dn_string.user_input }}'
tasks:
- name: Get the UUID of an user account based on uid
ansible.builtin.pause:
prompt: 'uid (case-sensitive)'
register: person_uid
- name: Get the UUID of a Distinguished Name
ansible.builtin.pause:
prompt: 'dn (case-sensitive)'
register: object_dn_string
when: not person_uid.user_input | d()
- name: LDAP object information
ansible.builtin.debug:
msg: '{{ {"DN:": object_dn,
"UUID:": (object_dn | to_uuid)} }}'
when: object_dn | d()

View file

@ -0,0 +1,155 @@
---
# Copyright (C) 2019-2021 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2019-2021 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
- name: Initialize new LDAP directory
collections: [ 'debops.debops', 'debops.roles01',
'debops.roles02', 'debops.roles03' ]
hosts: [ 'debops_service_slapd' ]
become: True
environment: '{{ inventory__environment | d({})
| combine(inventory__group_environment | d({}))
| combine(inventory__host_environment | d({})) }}'
vars_prompt:
- name: 'admin_input_plaintext_password'
prompt: 'New password for your LDAP user account (enter=random)'
default: ''
private: True
- name: 'admin_use_password_store'
default: 'yes'
prompt: 'Use Password Store? (default=yes)'
vars:
# Username of the current Ansible user on the Ansible Controller
admin_user: '{{ lookup("env", "USER") }}'
# Information from the 'passwd' database for the current user on the
# Ansible Controller
admin_gecos: '{{ getent_passwd[admin_user][3] | d() }}'
# SSH public keys in the 'ssh-agent'
admin_sshkeys: '{{ lookup("pipe", "ssh-add -L | grep ^\\\(sk-\\\)\\\?ssh || cat ~/.ssh/*.pub || true").split("\n") }}'
# Plaintext administrator password. If no password has been provided,
# a random password will be generated and stored either in a file or
# in the Password Store on the Ansible Controller. If a password has
# been provided and the Password Store is not used, the password will
# not be stored.
admin_plaintext_password: '{{ admin_input_plaintext_password
if admin_input_plaintext_password | d()
else (lookup("password", "/dev/null length=32")
if admin_use_password_store | d(True) | bool
else
lookup("password",
secret + "/ldap/credentials/"
+ admin_dn | to_uuid
+ ".password length=32")) }}'
# This variable is used to store the administrator password in the Password
# Store on the Ansible Controller, if requested
admin_saved_password: '{{ lookup("passwordstore",
ldap__admin_passwordstore_path
+ "/" + admin_dn | to_uuid
+ " create=true overwrite=true userpass="
+ admin_plaintext_password) }}'
# The Relative Distinguished Name of the administrator account in the LDAP
# directory
admin_rdn: 'uid={{ admin_user }}'
# The Distinguished Name of the administrator account
admin_dn: '{{ ([ admin_rdn, ldap__people_rdn ] + ldap__base_dn) | join(",") }}'
# Override the check if the LDAP support is enabled on the host, we don't
# care at this point
ldap__enabled: True
# Override the check if the LDAP support is configured on the host, we
# don't care at this point
ldap__configured: True
# Run the 'ldap' role in dependent mode; don't configure anything related
# to LDAP on the host itself, perform only LDAP tasks
ldap__dependent_play: True
# Override the list of LDAP servers detected automatically by the role
ldap__servers: [ '{{ ansible_fqdn }}' ]
# Use the RootDN credential to access the LDAP directory directly via the
# superuser account
ldap__admin_binddn: '{{ ([ "cn=admin" ] + ldap__base_dn) | join(",") }}'
# Use the RootPW credential generated by the 'debops.slapd' role to
# authenticate to the LDAP directory
ldap__admin_bindpw: '{{ lookup("password", secret + "/slapd/credentials/"
+ ldap__admin_binddn | to_uuid
+ ".password").split()[0] }}'
ldap__dependent_tasks:
- name: 'Create personal account for {{ admin_user }}'
dn: '{{ [ admin_rdn, ldap__people_rdn ] + ldap__base_dn }}'
objectClass: [ 'inetOrgPerson', 'posixAccount', 'shadowAccount',
'posixGroup', 'posixGroupId', 'ldapPublicKey',
'authorizedServiceObject', 'hostObject' ]
attributes:
# inetOrgPerson attributes
commonName: '{{ admin_gecos.split(",")[0] if admin_gecos | d() else (admin_user | capitalize) }}'
givenName: '{{ (admin_gecos.split(",")[0].split()[0]) if (admin_gecos | d() and " " in admin_gecos) else (admin_user | capitalize) }}'
surname: '{{ (admin_gecos.split(",")[0].split()[1]) if (admin_gecos | d() and " " in admin_gecos) else "AdminUser" }}'
userPassword: '{{ admin_plaintext_password }}'
# POSIX attributes
uid: '{{ admin_rdn.split("=")[1] }}'
gid: '{{ admin_rdn.split("=")[1] }}'
uidNumber: '{{ ldap__groupid_max | int + 1 }}'
gidNumber: '{{ ldap__groupid_max | int + 1 }}'
homeDirectory: '{{ ldap__home + "/" + admin_user }}'
loginShell: '{{ ldap__shell }}'
# Other attributes
authorizedService: 'all'
host: 'posix:all'
sshPublicKey: '{{ admin_sshkeys }}'
- name: 'Add admin account to cn=LDAP Administrator role'
dn: '{{ [ "cn=LDAP Administrator", ldap__roles_rdn ] + ldap__base_dn }}'
attributes:
roleOccupant: '{{ admin_dn }}'
- name: 'Add admin account to cn=UNIX Administrators group'
dn: '{{ [ "cn=UNIX Administrators", ldap__groups_rdn ] + ldap__base_dn }}'
attributes:
member: '{{ admin_dn }}'
owner: '{{ admin_dn }}'
pre_tasks:
- name: Check local user information
ansible.builtin.getent:
database: 'passwd'
key: '{{ admin_user }}'
delegate_to: 'localhost'
become: False
failed_when: False
- name: Save admin credential in the password store
ansible.builtin.set_fact:
admin_stored_password: '{{ admin_saved_password }}'
when: admin_use_password_store | d(True) | bool
no_log: '{{ debops__no_log | d(True) }}'
delegate_to: 'localhost'
become: False
run_once: True
roles:
- role: 'ldap'
tags: [ 'role::ldap', 'skip::ldap' ]

View file

@ -0,0 +1,116 @@
---
# Copyright (C) 2019 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2019 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
# This playbook can be used to save the LDAP password in the password store
# (encrypted with user's GPG key). The password can then be used later by the
# 'ldap' role to perform LDAP tasks on behalf of the user.
#
# Check the documentation of the 'ldap' Ansible role for more details.
- name: Save personal credential in the password store
collections: [ 'debops.debops', 'debops.roles01',
'debops.roles02', 'debops.roles03' ]
hosts: [ 'debops_service_slapd' ]
environment: '{{ inventory__environment | d({})
| combine(inventory__group_environment | d({}))
| combine(inventory__host_environment | d({})) }}'
vars:
# Don't make any changes related to LDAP on the host against which this
# playbook is executed. The playbook relies on the role default variables
# (or their inventory overrides) to find the full DN of the user account.
ldap__enabled: False
# The username of the credential owner
person_rdn: 'uid={{ person_uid.user_input }}'
# The LDAP Distinguished Name of the credential owner
person_dn: '{{ object_dn.user_input
if object_dn.user_input | d()
else ((([ person_rdn, ldap__people_rdn ] + ldap__base_dn) | join(","))
if person_uid.user_input | d()
else "") }}'
# This variable defines the lookup plugin command that will be executed by
# the 'set_fact' task later on to trigger the 'passwordstore' lookup plugin
# to save the new password given by the user.
person_store_password: '{{ lookup("passwordstore", ldap__admin_passwordstore_path
+ "/" + (person_dn | to_uuid)
+ " create=true overwrite=true userpass="
+ person_password) }}'
pre_tasks:
- name: 'Specify username'
ansible.builtin.pause:
prompt: 'LDAP username (uid=%s,{{ ([ldap__people_rdn] + ldap__base_dn) | join(",") }})'
register: person_uid
delegate_to: 'localhost'
become: False
run_once: True
- name: 'Username not provided, specify DN'
ansible.builtin.pause:
prompt: 'LDAP Distinguished Name'
register: object_dn
when: person_uid is undefined or not person_uid.user_input | d()
delegate_to: 'localhost'
become: False
run_once: True
- name: Make sure that we have a Distinguished Name
ansible.builtin.assert:
that:
- person_dn | d()
fail_msg: 'No Distinguished Name provided, aborting'
success_msg: 'dn: {{ person_dn }} | UUID: {{ person_dn | to_uuid }}'
delegate_to: 'localhost'
become: False
run_once: True
- name: 'Specify password'
ansible.builtin.pause:
prompt: 'LDAP password [random]'
echo: False
register: person_plaintext_password
delegate_to: 'localhost'
become: False
run_once: True
- name: Generate random password if not specified
ansible.builtin.set_fact:
person_password: '{{ person_plaintext_password.user_input
if person_plaintext_password.user_input | d()
else lookup("password", "/dev/null length=42") }}'
delegate_to: 'localhost'
become: False
run_once: True
- name: Save credential in the password store
ansible.builtin.set_fact:
person_saved_password: '{{ person_store_password }}'
no_log: '{{ debops__no_log | d(True) }}'
delegate_to: 'localhost'
become: False
run_once: True
post_tasks:
- name: Display randomly generated password
ansible.builtin.debug:
msg: '{{ {"Distinguished Name": person_dn,
"UUID": (person_dn | to_uuid),
"Stored password": person_password} }}'
when: not person_plaintext_password.user_input | d()
delegate_to: 'localhost'
become: False
run_once: True
roles:
- role: 'ldap'
tags: [ 'role::ldap', 'skip::ldap' ]

View file

@ -0,0 +1,23 @@
---
# Copyright (C) 2020 Nicolas Quiniou-Briand <nqb@azyx.fr>
# Copyright (C) 2022 Julien Lecomte <julien@lecomte.at>
# Copyright (C) 2022 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
#
# This playbook will reboot all DebOps hosts (use with caution)
# if required, or if forced.
- name: Reboot DebOps hosts
hosts: [ 'debops_all_hosts' ]
become: True
gather_facts: False
environment: '{{ inventory__environment | d({})
| combine(inventory__group_environment | d({}))
| combine(inventory__host_environment | d({})) }}'
roles:
- role: reboot
tags: [ 'role::reboot', 'skip::reboot' ]

View file

@ -0,0 +1,29 @@
---
# Copyright (C) 2018 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2018 DebOps <https://debops.org/>
# SPDX-License-Identifier: GPL-3.0-only
- name: Install and configure Ansible
collections: [ 'debops.debops', 'debops.roles01',
'debops.roles02', 'debops.roles03' ]
hosts: [ 'debops_service_ansible' ]
become: True
environment: '{{ inventory__environment | d({})
| combine(inventory__group_environment | d({}))
| combine(inventory__host_environment | d({})) }}'
roles:
- role: keyring
tags: [ 'role::keyring', 'skip::keyring', 'role::ansible' ]
keyring__dependent_apt_keys:
- '{{ ansible__keyring__dependent_apt_keys }}'
- role: apt_preferences
tags: [ 'role::apt_preferences', 'skip::apt_preferences' ]
apt_preferences__dependent_list:
- '{{ ansible__apt_preferences__dependent_list }}'
- role: ansible
tags: [ 'role::ansible', 'skip::ansible' ]

Some files were not shown because too many files have changed in this diff Show more