Skip to content
Permalink
Browse files

Merge branch 'master' into dovecot_updates

  • Loading branch information...
reixd committed Sep 9, 2019
2 parents 2dad413 + 7070f28 commit fce9783d1808da4b34b515a03258b88a8d398997
Showing 409 changed files with 9,015 additions and 3,109 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -1,7 +1,7 @@
# Set up an Ansible Controller with DebOps support as a Docker container
#
# Copyright (C) 2017 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2017 DebOps project https://debops.org/
# Copyright (C) 2017-2019 Maciej Delmanowski <drybjed@gmail.com>
# Copyright (C) 2017-2019 DebOps project https://debops.org/


# Basic usage:
@@ -10,40 +10,33 @@
# docker run --name <container> -h controller.example.org -i -t debops
#
# cd src/controller
# debops --skip-tags role::ferm,role::sysctl,role::sshd,role::root_account,role::etc_services
#
# These roles currently have issues when executed against a Docker container:
# - debops.etc_services - destroys '/etc/services' file
# - debops.ferm - cannot configure sysctl
# - debops.sshd - daemon cannot be restarted
# - debops.sysctl - cannot configure sysctl
# - debops.root_account - cannot reconfigure root account
# debops common --diff


FROM debian:stretch-slim
FROM debian:buster-slim

LABEL maintainer="Maciej Delmanowski <drybjed@gmail.com>" \
project="DebOps" homepage="https://debops.org/"

ENV DOCKER_ENVIRONMENT true

RUN apt-get -q update \
&& DEBIAN_FRONTEND=noninteractive apt-get \
--no-install-recommends -yq install \
iproute2 \
levee \
openssh-client \
python-apt \
python-dnspython \
python-future \
python-ldap \
python-pip \
python-wheel \
python-setuptools \
python3-apt \
python3-distro \
python3-dnspython \
python3-future \
python3-ldap \
python3-openssl \
python3-pip \
python3-wheel \
python3-setuptools \
procps \
sudo \
tree \
&& pip install \
&& pip3 install \
debops[ansible] \
&& echo "Cleaning up cache directories..." \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*.deb /root/.cache/*
@@ -58,6 +51,10 @@ RUN groupadd --system admins \
USER ansible
WORKDIR /home/ansible

# Docker does not set expected environment variables by default
# Ref: https://stackoverflow.com/questions/54411218/
ENV USER ansible

# Add contents of the DebOps monorepo to the container
COPY . .local/share/debops/debops

@@ -111,24 +111,32 @@ Ansible:

.. __: https://bitbucket.org/ecollins/passlib/wiki/Home

`pyOpenSSL`__
This is a Python wrapper for the OpenSSL library, available in the
``python-openssl`` package. It's a requirement for :ref:`debops.opendkim` and
other roles that generate X.509 certificates or private keys on the Ansible
Controller.

.. __: https://www.pyopenssl.org/

You can install them using your distribution packages on Debian or
Ubuntu by running the command:

.. code-block:: console

sudo apt install python-future python-ldap python-netaddr \
python-dnspython python-passlib
sudo apt install python3-future python3-ldap python3-netaddr \
python3-dnspython python3-passlib python3-openssl

The missing Python dependencies will be automatically installed with the
``ansible`` and ``debops`` Python packages, however some of them, like the
``python-ldap`` package, are distributed only as sources and require the build
``python3-ldap`` package, are distributed only as sources and require the build
environment to be available. On Debian or Ubuntu you can install the required
packages by running the command:

.. code-block:: console

sudo apt install build-essential python-dev libffi-dev libssl-dev \
libsasl2-dev libldap2-dev python-pip
sudo apt install build-essential python3-dev libffi-dev libssl-dev \
libsasl2-dev libldap2-dev python3-pip

Installation of DebOps with Ansible included
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -137,11 +145,11 @@ To install DebOps and Ansible on your user account, execute the command:

.. code-block:: console

pip install --user debops[ansible]
pip3 install --user debops[ansible]

The above command will install the ``debops`` Python package, as well as
``ansible`` Python package with optional dependencies used by DebOps roles.
They will be installed in the :file:`~/.local/lib/python2.7/site-packages/`
They will be installed in the :file:`~/.local/lib/python3.x/site-packages/`
directory, the scripts and other binaries will be installed in
:file:`~/.local/bin` directory which should be included in your ``$PATH``.

@@ -157,7 +165,7 @@ you can use the command:

.. code-block:: console

pip install --user debops
pip3 install --user debops

In this case you will have to install Ansible and other optional dependencies
required by DebOps separately.
@@ -218,6 +226,16 @@ Additional, useful software

.. __: https://en.wikipedia.org/wiki/EncFS

`git-crypt`__
You can use :command:`git-crypt` to transparently encrypt files in the
:file:`secret/` directory when committing to a Git repository. Unlike
``EncFS``, the files are not encrypted on your local hard disk, and the path
names are not encrypted at all. The excellent 'Using git-crypt' section on
the website or in the `man page`__ will get you started.

.. __: https://www.agwa.name/projects/git-crypt/
.. __: https://manpages.debian.org/git-crypt.1

``uuidgen``
This command is used to generate unique UUID strings for hosts which are then
stored as Ansible facts. On Debian, it's available in the ``uuid-runtime``
@@ -231,7 +249,7 @@ command:

.. code-block:: console

pip install --user --upgrade debops
pip3 install --user --upgrade debops


Installation in a :command:`virtualenv` Python environment
@@ -245,8 +263,8 @@ development packages:

.. code-block:: console

sudo apt install build-essential python-virtualenv virtualenv python-dev \
libffi-dev libssl-dev libsasl2-dev libldap2-dev python-pip
sudo apt install build-essential python3-virtualenv virtualenv python3-dev \
libffi-dev libssl-dev libsasl2-dev libldap2-dev python3-pip

After that, you can create a new Python :command:`virtualenv` environment in
a selected directory and "enter" it by executing the commands:
@@ -263,14 +281,14 @@ environment, you can run the command:

.. code-block:: console

pip install debops[ansible]
pip3 install debops[ansible]

Or, to install only DebOps without Ansible (for example, you want to use the
Ansible from outside of the environment), you can execute the command:

.. code-block:: console

pip install debops
pip3 install debops

To exit the current Python virtual environment, you can run the command:

@@ -289,7 +307,7 @@ command:

.. code-block:: console

pip install --upgrade debops
pip3 install --upgrade debops


Installation from Ansible Galaxy
@@ -349,8 +367,8 @@ Ansible Galaxy, you can run the command:
mazer install --force debops.debops


Installation of the DebOps development release
----------------------------------------------
Installation of the DebOps rolling release
------------------------------------------

The ``debops`` Python package includes a :command:`debops-update` script which
can be used to install the DebOps monorepo directly from GitHub, with the
@@ -18,16 +18,17 @@
# Maintainer: Maciej Delmanowski <drybjed@gmail.com>
pkgname=debops-git
_pkgname=debops
pkgver=1.0.0
pkgver=VERSION
pkgrel=1
pkgdesc="Your Debian-based data center in a box"
arch=('any')
url="https://github.com/debops/debops/"
license=('GPL3')
depends=('python' 'python-future' 'util-linux' 'encfs' 'gnupg')
depends=('python' 'python-distro' 'python-future' 'util-linux' 'encfs' 'gnupg')
optdepends=(
'ansible: required to run playbooks and roles'
'python-dnspython: required by Ansible "dig" module'
'python-pyopenssl: required by "openssl_*" Ansible modules'
'python-netaddr: required by Ansible "ipaddr" filter plugin'
'python-ldap: required by Ansible "ldap_*" modules'
'python-passlib: required by Ansible "password" lookup plugin')
@@ -43,14 +43,16 @@ page][debops-docs].
## Quick start

Start a Docker container which acts as an Ansible Controller host with DebOps
support, based on Debian Stretch:
support, based on Debian Buster:

docker run -it --rm debops/debops
cd src/controller ; debops common --diff

Or, create a Vagrant VM which acts as an Ansible Controller host:

git clone https://github.com/debops/debops
cd debops && vagrant up && vagrant ssh
cd src/controller ; debops common --diff

You can use configuration in the `src/controller` subdirectory to try out
DebOps against the container/VM, or create your own DebOps project directory

0 comments on commit fce9783

Please sign in to comment.
You can’t perform that action at this time.