Initial commit
This commit is contained in:
commit
488864d29e
34 changed files with 2266 additions and 0 deletions
31
.editorconfig
Normal file
31
.editorconfig
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
# This file is the top-most EditorConfig file
|
||||||
|
root = true
|
||||||
|
|
||||||
|
# All Files
|
||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
end_of_line = lf
|
||||||
|
indent_style = tab
|
||||||
|
indent_size = 4
|
||||||
|
insert_final_newline = true
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
|
||||||
|
#########################
|
||||||
|
# File Extension Settings
|
||||||
|
#########################
|
||||||
|
|
||||||
|
# YAML Files
|
||||||
|
[*.{yml,yaml,log.config.j2,yaml.j2}]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
[group_vars/mash_servers]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
# Markdown Files
|
||||||
|
#
|
||||||
|
# Two spaces at the end of a line in Markdown mean "new line",
|
||||||
|
# so trimming trailing whitespace for such files can cause breakage.
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
7
.gitignore
vendored
Normal file
7
.gitignore
vendored
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
/inventory/*
|
||||||
|
!/inventory/.gitkeep
|
||||||
|
!/inventory/host_vars/.gitkeep
|
||||||
|
|
||||||
|
# ignore roles pulled by ansible-galaxy
|
||||||
|
/roles/galaxy/*
|
||||||
|
!/roles/galaxy/.gitkeep
|
5
CHANGELOG.md
Normal file
5
CHANGELOG.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# 2023-03-15
|
||||||
|
|
||||||
|
## Initial release
|
||||||
|
|
||||||
|
This is the initial release of this playbook.
|
661
LICENSE
Normal file
661
LICENSE
Normal file
|
@ -0,0 +1,661 @@
|
||||||
|
GNU AFFERO GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 19 November 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
Preamble
|
||||||
|
|
||||||
|
The GNU Affero General Public License is a free, copyleft license for
|
||||||
|
software and other kinds of works, specifically designed to ensure
|
||||||
|
cooperation with the community in the case of network server software.
|
||||||
|
|
||||||
|
The licenses for most software and other practical works are designed
|
||||||
|
to take away your freedom to share and change the works. By contrast,
|
||||||
|
our General Public Licenses are intended to guarantee your freedom to
|
||||||
|
share and change all versions of a program--to make sure it remains free
|
||||||
|
software for all its users.
|
||||||
|
|
||||||
|
When we speak of free software, we are referring to freedom, not
|
||||||
|
price. Our General Public Licenses are designed to make sure that you
|
||||||
|
have the freedom to distribute copies of free software (and charge for
|
||||||
|
them if you wish), that you receive source code or can get it if you
|
||||||
|
want it, that you can change the software or use pieces of it in new
|
||||||
|
free programs, and that you know you can do these things.
|
||||||
|
|
||||||
|
Developers that use our General Public Licenses protect your rights
|
||||||
|
with two steps: (1) assert copyright on the software, and (2) offer
|
||||||
|
you this License which gives you legal permission to copy, distribute
|
||||||
|
and/or modify the software.
|
||||||
|
|
||||||
|
A secondary benefit of defending all users' freedom is that
|
||||||
|
improvements made in alternate versions of the program, if they
|
||||||
|
receive widespread use, become available for other developers to
|
||||||
|
incorporate. Many developers of free software are heartened and
|
||||||
|
encouraged by the resulting cooperation. However, in the case of
|
||||||
|
software used on network servers, this result may fail to come about.
|
||||||
|
The GNU General Public License permits making a modified version and
|
||||||
|
letting the public access it on a server without ever releasing its
|
||||||
|
source code to the public.
|
||||||
|
|
||||||
|
The GNU Affero General Public License is designed specifically to
|
||||||
|
ensure that, in such cases, the modified source code becomes available
|
||||||
|
to the community. It requires the operator of a network server to
|
||||||
|
provide the source code of the modified version running there to the
|
||||||
|
users of that server. Therefore, public use of a modified version, on
|
||||||
|
a publicly accessible server, gives the public access to the source
|
||||||
|
code of the modified version.
|
||||||
|
|
||||||
|
An older license, called the Affero General Public License and
|
||||||
|
published by Affero, was designed to accomplish similar goals. This is
|
||||||
|
a different license, not a version of the Affero GPL, but Affero has
|
||||||
|
released a new version of the Affero GPL which permits relicensing under
|
||||||
|
this license.
|
||||||
|
|
||||||
|
The precise terms and conditions for copying, distribution and
|
||||||
|
modification follow.
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
0. Definitions.
|
||||||
|
|
||||||
|
"This License" refers to version 3 of the GNU Affero General Public License.
|
||||||
|
|
||||||
|
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||||
|
works, such as semiconductor masks.
|
||||||
|
|
||||||
|
"The Program" refers to any copyrightable work licensed under this
|
||||||
|
License. Each licensee is addressed as "you". "Licensees" and
|
||||||
|
"recipients" may be individuals or organizations.
|
||||||
|
|
||||||
|
To "modify" a work means to copy from or adapt all or part of the work
|
||||||
|
in a fashion requiring copyright permission, other than the making of an
|
||||||
|
exact copy. The resulting work is called a "modified version" of the
|
||||||
|
earlier work or a work "based on" the earlier work.
|
||||||
|
|
||||||
|
A "covered work" means either the unmodified Program or a work based
|
||||||
|
on the Program.
|
||||||
|
|
||||||
|
To "propagate" a work means to do anything with it that, without
|
||||||
|
permission, would make you directly or secondarily liable for
|
||||||
|
infringement under applicable copyright law, except executing it on a
|
||||||
|
computer or modifying a private copy. Propagation includes copying,
|
||||||
|
distribution (with or without modification), making available to the
|
||||||
|
public, and in some countries other activities as well.
|
||||||
|
|
||||||
|
To "convey" a work means any kind of propagation that enables other
|
||||||
|
parties to make or receive copies. Mere interaction with a user through
|
||||||
|
a computer network, with no transfer of a copy, is not conveying.
|
||||||
|
|
||||||
|
An interactive user interface displays "Appropriate Legal Notices"
|
||||||
|
to the extent that it includes a convenient and prominently visible
|
||||||
|
feature that (1) displays an appropriate copyright notice, and (2)
|
||||||
|
tells the user that there is no warranty for the work (except to the
|
||||||
|
extent that warranties are provided), that licensees may convey the
|
||||||
|
work under this License, and how to view a copy of this License. If
|
||||||
|
the interface presents a list of user commands or options, such as a
|
||||||
|
menu, a prominent item in the list meets this criterion.
|
||||||
|
|
||||||
|
1. Source Code.
|
||||||
|
|
||||||
|
The "source code" for a work means the preferred form of the work
|
||||||
|
for making modifications to it. "Object code" means any non-source
|
||||||
|
form of a work.
|
||||||
|
|
||||||
|
A "Standard Interface" means an interface that either is an official
|
||||||
|
standard defined by a recognized standards body, or, in the case of
|
||||||
|
interfaces specified for a particular programming language, one that
|
||||||
|
is widely used among developers working in that language.
|
||||||
|
|
||||||
|
The "System Libraries" of an executable work include anything, other
|
||||||
|
than the work as a whole, that (a) is included in the normal form of
|
||||||
|
packaging a Major Component, but which is not part of that Major
|
||||||
|
Component, and (b) serves only to enable use of the work with that
|
||||||
|
Major Component, or to implement a Standard Interface for which an
|
||||||
|
implementation is available to the public in source code form. A
|
||||||
|
"Major Component", in this context, means a major essential component
|
||||||
|
(kernel, window system, and so on) of the specific operating system
|
||||||
|
(if any) on which the executable work runs, or a compiler used to
|
||||||
|
produce the work, or an object code interpreter used to run it.
|
||||||
|
|
||||||
|
The "Corresponding Source" for a work in object code form means all
|
||||||
|
the source code needed to generate, install, and (for an executable
|
||||||
|
work) run the object code and to modify the work, including scripts to
|
||||||
|
control those activities. However, it does not include the work's
|
||||||
|
System Libraries, or general-purpose tools or generally available free
|
||||||
|
programs which are used unmodified in performing those activities but
|
||||||
|
which are not part of the work. For example, Corresponding Source
|
||||||
|
includes interface definition files associated with source files for
|
||||||
|
the work, and the source code for shared libraries and dynamically
|
||||||
|
linked subprograms that the work is specifically designed to require,
|
||||||
|
such as by intimate data communication or control flow between those
|
||||||
|
subprograms and other parts of the work.
|
||||||
|
|
||||||
|
The Corresponding Source need not include anything that users
|
||||||
|
can regenerate automatically from other parts of the Corresponding
|
||||||
|
Source.
|
||||||
|
|
||||||
|
The Corresponding Source for a work in source code form is that
|
||||||
|
same work.
|
||||||
|
|
||||||
|
2. Basic Permissions.
|
||||||
|
|
||||||
|
All rights granted under this License are granted for the term of
|
||||||
|
copyright on the Program, and are irrevocable provided the stated
|
||||||
|
conditions are met. This License explicitly affirms your unlimited
|
||||||
|
permission to run the unmodified Program. The output from running a
|
||||||
|
covered work is covered by this License only if the output, given its
|
||||||
|
content, constitutes a covered work. This License acknowledges your
|
||||||
|
rights of fair use or other equivalent, as provided by copyright law.
|
||||||
|
|
||||||
|
You may make, run and propagate covered works that you do not
|
||||||
|
convey, without conditions so long as your license otherwise remains
|
||||||
|
in force. You may convey covered works to others for the sole purpose
|
||||||
|
of having them make modifications exclusively for you, or provide you
|
||||||
|
with facilities for running those works, provided that you comply with
|
||||||
|
the terms of this License in conveying all material for which you do
|
||||||
|
not control copyright. Those thus making or running the covered works
|
||||||
|
for you must do so exclusively on your behalf, under your direction
|
||||||
|
and control, on terms that prohibit them from making any copies of
|
||||||
|
your copyrighted material outside their relationship with you.
|
||||||
|
|
||||||
|
Conveying under any other circumstances is permitted solely under
|
||||||
|
the conditions stated below. Sublicensing is not allowed; section 10
|
||||||
|
makes it unnecessary.
|
||||||
|
|
||||||
|
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||||
|
|
||||||
|
No covered work shall be deemed part of an effective technological
|
||||||
|
measure under any applicable law fulfilling obligations under article
|
||||||
|
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||||
|
similar laws prohibiting or restricting circumvention of such
|
||||||
|
measures.
|
||||||
|
|
||||||
|
When you convey a covered work, you waive any legal power to forbid
|
||||||
|
circumvention of technological measures to the extent such circumvention
|
||||||
|
is effected by exercising rights under this License with respect to
|
||||||
|
the covered work, and you disclaim any intention to limit operation or
|
||||||
|
modification of the work as a means of enforcing, against the work's
|
||||||
|
users, your or third parties' legal rights to forbid circumvention of
|
||||||
|
technological measures.
|
||||||
|
|
||||||
|
4. Conveying Verbatim Copies.
|
||||||
|
|
||||||
|
You may convey verbatim copies of the Program's source code as you
|
||||||
|
receive it, in any medium, provided that you conspicuously and
|
||||||
|
appropriately publish on each copy an appropriate copyright notice;
|
||||||
|
keep intact all notices stating that this License and any
|
||||||
|
non-permissive terms added in accord with section 7 apply to the code;
|
||||||
|
keep intact all notices of the absence of any warranty; and give all
|
||||||
|
recipients a copy of this License along with the Program.
|
||||||
|
|
||||||
|
You may charge any price or no price for each copy that you convey,
|
||||||
|
and you may offer support or warranty protection for a fee.
|
||||||
|
|
||||||
|
5. Conveying Modified Source Versions.
|
||||||
|
|
||||||
|
You may convey a work based on the Program, or the modifications to
|
||||||
|
produce it from the Program, in the form of source code under the
|
||||||
|
terms of section 4, provided that you also meet all of these conditions:
|
||||||
|
|
||||||
|
a) The work must carry prominent notices stating that you modified
|
||||||
|
it, and giving a relevant date.
|
||||||
|
|
||||||
|
b) The work must carry prominent notices stating that it is
|
||||||
|
released under this License and any conditions added under section
|
||||||
|
7. This requirement modifies the requirement in section 4 to
|
||||||
|
"keep intact all notices".
|
||||||
|
|
||||||
|
c) You must license the entire work, as a whole, under this
|
||||||
|
License to anyone who comes into possession of a copy. This
|
||||||
|
License will therefore apply, along with any applicable section 7
|
||||||
|
additional terms, to the whole of the work, and all its parts,
|
||||||
|
regardless of how they are packaged. This License gives no
|
||||||
|
permission to license the work in any other way, but it does not
|
||||||
|
invalidate such permission if you have separately received it.
|
||||||
|
|
||||||
|
d) If the work has interactive user interfaces, each must display
|
||||||
|
Appropriate Legal Notices; however, if the Program has interactive
|
||||||
|
interfaces that do not display Appropriate Legal Notices, your
|
||||||
|
work need not make them do so.
|
||||||
|
|
||||||
|
A compilation of a covered work with other separate and independent
|
||||||
|
works, which are not by their nature extensions of the covered work,
|
||||||
|
and which are not combined with it such as to form a larger program,
|
||||||
|
in or on a volume of a storage or distribution medium, is called an
|
||||||
|
"aggregate" if the compilation and its resulting copyright are not
|
||||||
|
used to limit the access or legal rights of the compilation's users
|
||||||
|
beyond what the individual works permit. Inclusion of a covered work
|
||||||
|
in an aggregate does not cause this License to apply to the other
|
||||||
|
parts of the aggregate.
|
||||||
|
|
||||||
|
6. Conveying Non-Source Forms.
|
||||||
|
|
||||||
|
You may convey a covered work in object code form under the terms
|
||||||
|
of sections 4 and 5, provided that you also convey the
|
||||||
|
machine-readable Corresponding Source under the terms of this License,
|
||||||
|
in one of these ways:
|
||||||
|
|
||||||
|
a) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by the
|
||||||
|
Corresponding Source fixed on a durable physical medium
|
||||||
|
customarily used for software interchange.
|
||||||
|
|
||||||
|
b) Convey the object code in, or embodied in, a physical product
|
||||||
|
(including a physical distribution medium), accompanied by a
|
||||||
|
written offer, valid for at least three years and valid for as
|
||||||
|
long as you offer spare parts or customer support for that product
|
||||||
|
model, to give anyone who possesses the object code either (1) a
|
||||||
|
copy of the Corresponding Source for all the software in the
|
||||||
|
product that is covered by this License, on a durable physical
|
||||||
|
medium customarily used for software interchange, for a price no
|
||||||
|
more than your reasonable cost of physically performing this
|
||||||
|
conveying of source, or (2) access to copy the
|
||||||
|
Corresponding Source from a network server at no charge.
|
||||||
|
|
||||||
|
c) Convey individual copies of the object code with a copy of the
|
||||||
|
written offer to provide the Corresponding Source. This
|
||||||
|
alternative is allowed only occasionally and noncommercially, and
|
||||||
|
only if you received the object code with such an offer, in accord
|
||||||
|
with subsection 6b.
|
||||||
|
|
||||||
|
d) Convey the object code by offering access from a designated
|
||||||
|
place (gratis or for a charge), and offer equivalent access to the
|
||||||
|
Corresponding Source in the same way through the same place at no
|
||||||
|
further charge. You need not require recipients to copy the
|
||||||
|
Corresponding Source along with the object code. If the place to
|
||||||
|
copy the object code is a network server, the Corresponding Source
|
||||||
|
may be on a different server (operated by you or a third party)
|
||||||
|
that supports equivalent copying facilities, provided you maintain
|
||||||
|
clear directions next to the object code saying where to find the
|
||||||
|
Corresponding Source. Regardless of what server hosts the
|
||||||
|
Corresponding Source, you remain obligated to ensure that it is
|
||||||
|
available for as long as needed to satisfy these requirements.
|
||||||
|
|
||||||
|
e) Convey the object code using peer-to-peer transmission, provided
|
||||||
|
you inform other peers where the object code and Corresponding
|
||||||
|
Source of the work are being offered to the general public at no
|
||||||
|
charge under subsection 6d.
|
||||||
|
|
||||||
|
A separable portion of the object code, whose source code is excluded
|
||||||
|
from the Corresponding Source as a System Library, need not be
|
||||||
|
included in conveying the object code work.
|
||||||
|
|
||||||
|
A "User Product" is either (1) a "consumer product", which means any
|
||||||
|
tangible personal property which is normally used for personal, family,
|
||||||
|
or household purposes, or (2) anything designed or sold for incorporation
|
||||||
|
into a dwelling. In determining whether a product is a consumer product,
|
||||||
|
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||||
|
product received by a particular user, "normally used" refers to a
|
||||||
|
typical or common use of that class of product, regardless of the status
|
||||||
|
of the particular user or of the way in which the particular user
|
||||||
|
actually uses, or expects or is expected to use, the product. A product
|
||||||
|
is a consumer product regardless of whether the product has substantial
|
||||||
|
commercial, industrial or non-consumer uses, unless such uses represent
|
||||||
|
the only significant mode of use of the product.
|
||||||
|
|
||||||
|
"Installation Information" for a User Product means any methods,
|
||||||
|
procedures, authorization keys, or other information required to install
|
||||||
|
and execute modified versions of a covered work in that User Product from
|
||||||
|
a modified version of its Corresponding Source. The information must
|
||||||
|
suffice to ensure that the continued functioning of the modified object
|
||||||
|
code is in no case prevented or interfered with solely because
|
||||||
|
modification has been made.
|
||||||
|
|
||||||
|
If you convey an object code work under this section in, or with, or
|
||||||
|
specifically for use in, a User Product, and the conveying occurs as
|
||||||
|
part of a transaction in which the right of possession and use of the
|
||||||
|
User Product is transferred to the recipient in perpetuity or for a
|
||||||
|
fixed term (regardless of how the transaction is characterized), the
|
||||||
|
Corresponding Source conveyed under this section must be accompanied
|
||||||
|
by the Installation Information. But this requirement does not apply
|
||||||
|
if neither you nor any third party retains the ability to install
|
||||||
|
modified object code on the User Product (for example, the work has
|
||||||
|
been installed in ROM).
|
||||||
|
|
||||||
|
The requirement to provide Installation Information does not include a
|
||||||
|
requirement to continue to provide support service, warranty, or updates
|
||||||
|
for a work that has been modified or installed by the recipient, or for
|
||||||
|
the User Product in which it has been modified or installed. Access to a
|
||||||
|
network may be denied when the modification itself materially and
|
||||||
|
adversely affects the operation of the network or violates the rules and
|
||||||
|
protocols for communication across the network.
|
||||||
|
|
||||||
|
Corresponding Source conveyed, and Installation Information provided,
|
||||||
|
in accord with this section must be in a format that is publicly
|
||||||
|
documented (and with an implementation available to the public in
|
||||||
|
source code form), and must require no special password or key for
|
||||||
|
unpacking, reading or copying.
|
||||||
|
|
||||||
|
7. Additional Terms.
|
||||||
|
|
||||||
|
"Additional permissions" are terms that supplement the terms of this
|
||||||
|
License by making exceptions from one or more of its conditions.
|
||||||
|
Additional permissions that are applicable to the entire Program shall
|
||||||
|
be treated as though they were included in this License, to the extent
|
||||||
|
that they are valid under applicable law. If additional permissions
|
||||||
|
apply only to part of the Program, that part may be used separately
|
||||||
|
under those permissions, but the entire Program remains governed by
|
||||||
|
this License without regard to the additional permissions.
|
||||||
|
|
||||||
|
When you convey a copy of a covered work, you may at your option
|
||||||
|
remove any additional permissions from that copy, or from any part of
|
||||||
|
it. (Additional permissions may be written to require their own
|
||||||
|
removal in certain cases when you modify the work.) You may place
|
||||||
|
additional permissions on material, added by you to a covered work,
|
||||||
|
for which you have or can give appropriate copyright permission.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, for material you
|
||||||
|
add to a covered work, you may (if authorized by the copyright holders of
|
||||||
|
that material) supplement the terms of this License with terms:
|
||||||
|
|
||||||
|
a) Disclaiming warranty or limiting liability differently from the
|
||||||
|
terms of sections 15 and 16 of this License; or
|
||||||
|
|
||||||
|
b) Requiring preservation of specified reasonable legal notices or
|
||||||
|
author attributions in that material or in the Appropriate Legal
|
||||||
|
Notices displayed by works containing it; or
|
||||||
|
|
||||||
|
c) Prohibiting misrepresentation of the origin of that material, or
|
||||||
|
requiring that modified versions of such material be marked in
|
||||||
|
reasonable ways as different from the original version; or
|
||||||
|
|
||||||
|
d) Limiting the use for publicity purposes of names of licensors or
|
||||||
|
authors of the material; or
|
||||||
|
|
||||||
|
e) Declining to grant rights under trademark law for use of some
|
||||||
|
trade names, trademarks, or service marks; or
|
||||||
|
|
||||||
|
f) Requiring indemnification of licensors and authors of that
|
||||||
|
material by anyone who conveys the material (or modified versions of
|
||||||
|
it) with contractual assumptions of liability to the recipient, for
|
||||||
|
any liability that these contractual assumptions directly impose on
|
||||||
|
those licensors and authors.
|
||||||
|
|
||||||
|
All other non-permissive additional terms are considered "further
|
||||||
|
restrictions" within the meaning of section 10. If the Program as you
|
||||||
|
received it, or any part of it, contains a notice stating that it is
|
||||||
|
governed by this License along with a term that is a further
|
||||||
|
restriction, you may remove that term. If a license document contains
|
||||||
|
a further restriction but permits relicensing or conveying under this
|
||||||
|
License, you may add to a covered work material governed by the terms
|
||||||
|
of that license document, provided that the further restriction does
|
||||||
|
not survive such relicensing or conveying.
|
||||||
|
|
||||||
|
If you add terms to a covered work in accord with this section, you
|
||||||
|
must place, in the relevant source files, a statement of the
|
||||||
|
additional terms that apply to those files, or a notice indicating
|
||||||
|
where to find the applicable terms.
|
||||||
|
|
||||||
|
Additional terms, permissive or non-permissive, may be stated in the
|
||||||
|
form of a separately written license, or stated as exceptions;
|
||||||
|
the above requirements apply either way.
|
||||||
|
|
||||||
|
8. Termination.
|
||||||
|
|
||||||
|
You may not propagate or modify a covered work except as expressly
|
||||||
|
provided under this License. Any attempt otherwise to propagate or
|
||||||
|
modify it is void, and will automatically terminate your rights under
|
||||||
|
this License (including any patent licenses granted under the third
|
||||||
|
paragraph of section 11).
|
||||||
|
|
||||||
|
However, if you cease all violation of this License, then your
|
||||||
|
license from a particular copyright holder is reinstated (a)
|
||||||
|
provisionally, unless and until the copyright holder explicitly and
|
||||||
|
finally terminates your license, and (b) permanently, if the copyright
|
||||||
|
holder fails to notify you of the violation by some reasonable means
|
||||||
|
prior to 60 days after the cessation.
|
||||||
|
|
||||||
|
Moreover, your license from a particular copyright holder is
|
||||||
|
reinstated permanently if the copyright holder notifies you of the
|
||||||
|
violation by some reasonable means, this is the first time you have
|
||||||
|
received notice of violation of this License (for any work) from that
|
||||||
|
copyright holder, and you cure the violation prior to 30 days after
|
||||||
|
your receipt of the notice.
|
||||||
|
|
||||||
|
Termination of your rights under this section does not terminate the
|
||||||
|
licenses of parties who have received copies or rights from you under
|
||||||
|
this License. If your rights have been terminated and not permanently
|
||||||
|
reinstated, you do not qualify to receive new licenses for the same
|
||||||
|
material under section 10.
|
||||||
|
|
||||||
|
9. Acceptance Not Required for Having Copies.
|
||||||
|
|
||||||
|
You are not required to accept this License in order to receive or
|
||||||
|
run a copy of the Program. Ancillary propagation of a covered work
|
||||||
|
occurring solely as a consequence of using peer-to-peer transmission
|
||||||
|
to receive a copy likewise does not require acceptance. However,
|
||||||
|
nothing other than this License grants you permission to propagate or
|
||||||
|
modify any covered work. These actions infringe copyright if you do
|
||||||
|
not accept this License. Therefore, by modifying or propagating a
|
||||||
|
covered work, you indicate your acceptance of this License to do so.
|
||||||
|
|
||||||
|
10. Automatic Licensing of Downstream Recipients.
|
||||||
|
|
||||||
|
Each time you convey a covered work, the recipient automatically
|
||||||
|
receives a license from the original licensors, to run, modify and
|
||||||
|
propagate that work, subject to this License. You are not responsible
|
||||||
|
for enforcing compliance by third parties with this License.
|
||||||
|
|
||||||
|
An "entity transaction" is a transaction transferring control of an
|
||||||
|
organization, or substantially all assets of one, or subdividing an
|
||||||
|
organization, or merging organizations. If propagation of a covered
|
||||||
|
work results from an entity transaction, each party to that
|
||||||
|
transaction who receives a copy of the work also receives whatever
|
||||||
|
licenses to the work the party's predecessor in interest had or could
|
||||||
|
give under the previous paragraph, plus a right to possession of the
|
||||||
|
Corresponding Source of the work from the predecessor in interest, if
|
||||||
|
the predecessor has it or can get it with reasonable efforts.
|
||||||
|
|
||||||
|
You may not impose any further restrictions on the exercise of the
|
||||||
|
rights granted or affirmed under this License. For example, you may
|
||||||
|
not impose a license fee, royalty, or other charge for exercise of
|
||||||
|
rights granted under this License, and you may not initiate litigation
|
||||||
|
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||||
|
any patent claim is infringed by making, using, selling, offering for
|
||||||
|
sale, or importing the Program or any portion of it.
|
||||||
|
|
||||||
|
11. Patents.
|
||||||
|
|
||||||
|
A "contributor" is a copyright holder who authorizes use under this
|
||||||
|
License of the Program or a work on which the Program is based. The
|
||||||
|
work thus licensed is called the contributor's "contributor version".
|
||||||
|
|
||||||
|
A contributor's "essential patent claims" are all patent claims
|
||||||
|
owned or controlled by the contributor, whether already acquired or
|
||||||
|
hereafter acquired, that would be infringed by some manner, permitted
|
||||||
|
by this License, of making, using, or selling its contributor version,
|
||||||
|
but do not include claims that would be infringed only as a
|
||||||
|
consequence of further modification of the contributor version. For
|
||||||
|
purposes of this definition, "control" includes the right to grant
|
||||||
|
patent sublicenses in a manner consistent with the requirements of
|
||||||
|
this License.
|
||||||
|
|
||||||
|
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||||
|
patent license under the contributor's essential patent claims, to
|
||||||
|
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||||
|
propagate the contents of its contributor version.
|
||||||
|
|
||||||
|
In the following three paragraphs, a "patent license" is any express
|
||||||
|
agreement or commitment, however denominated, not to enforce a patent
|
||||||
|
(such as an express permission to practice a patent or covenant not to
|
||||||
|
sue for patent infringement). To "grant" such a patent license to a
|
||||||
|
party means to make such an agreement or commitment not to enforce a
|
||||||
|
patent against the party.
|
||||||
|
|
||||||
|
If you convey a covered work, knowingly relying on a patent license,
|
||||||
|
and the Corresponding Source of the work is not available for anyone
|
||||||
|
to copy, free of charge and under the terms of this License, through a
|
||||||
|
publicly available network server or other readily accessible means,
|
||||||
|
then you must either (1) cause the Corresponding Source to be so
|
||||||
|
available, or (2) arrange to deprive yourself of the benefit of the
|
||||||
|
patent license for this particular work, or (3) arrange, in a manner
|
||||||
|
consistent with the requirements of this License, to extend the patent
|
||||||
|
license to downstream recipients. "Knowingly relying" means you have
|
||||||
|
actual knowledge that, but for the patent license, your conveying the
|
||||||
|
covered work in a country, or your recipient's use of the covered work
|
||||||
|
in a country, would infringe one or more identifiable patents in that
|
||||||
|
country that you have reason to believe are valid.
|
||||||
|
|
||||||
|
If, pursuant to or in connection with a single transaction or
|
||||||
|
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||||
|
covered work, and grant a patent license to some of the parties
|
||||||
|
receiving the covered work authorizing them to use, propagate, modify
|
||||||
|
or convey a specific copy of the covered work, then the patent license
|
||||||
|
you grant is automatically extended to all recipients of the covered
|
||||||
|
work and works based on it.
|
||||||
|
|
||||||
|
A patent license is "discriminatory" if it does not include within
|
||||||
|
the scope of its coverage, prohibits the exercise of, or is
|
||||||
|
conditioned on the non-exercise of one or more of the rights that are
|
||||||
|
specifically granted under this License. You may not convey a covered
|
||||||
|
work if you are a party to an arrangement with a third party that is
|
||||||
|
in the business of distributing software, under which you make payment
|
||||||
|
to the third party based on the extent of your activity of conveying
|
||||||
|
the work, and under which the third party grants, to any of the
|
||||||
|
parties who would receive the covered work from you, a discriminatory
|
||||||
|
patent license (a) in connection with copies of the covered work
|
||||||
|
conveyed by you (or copies made from those copies), or (b) primarily
|
||||||
|
for and in connection with specific products or compilations that
|
||||||
|
contain the covered work, unless you entered into that arrangement,
|
||||||
|
or that patent license was granted, prior to 28 March 2007.
|
||||||
|
|
||||||
|
Nothing in this License shall be construed as excluding or limiting
|
||||||
|
any implied license or other defenses to infringement that may
|
||||||
|
otherwise be available to you under applicable patent law.
|
||||||
|
|
||||||
|
12. No Surrender of Others' Freedom.
|
||||||
|
|
||||||
|
If conditions are imposed on you (whether by court order, agreement or
|
||||||
|
otherwise) that contradict the conditions of this License, they do not
|
||||||
|
excuse you from the conditions of this License. If you cannot convey a
|
||||||
|
covered work so as to satisfy simultaneously your obligations under this
|
||||||
|
License and any other pertinent obligations, then as a consequence you may
|
||||||
|
not convey it at all. For example, if you agree to terms that obligate you
|
||||||
|
to collect a royalty for further conveying from those to whom you convey
|
||||||
|
the Program, the only way you could satisfy both those terms and this
|
||||||
|
License would be to refrain entirely from conveying the Program.
|
||||||
|
|
||||||
|
13. Remote Network Interaction; Use with the GNU General Public License.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, if you modify the
|
||||||
|
Program, your modified version must prominently offer all users
|
||||||
|
interacting with it remotely through a computer network (if your version
|
||||||
|
supports such interaction) an opportunity to receive the Corresponding
|
||||||
|
Source of your version by providing access to the Corresponding Source
|
||||||
|
from a network server at no charge, through some standard or customary
|
||||||
|
means of facilitating copying of software. This Corresponding Source
|
||||||
|
shall include the Corresponding Source for any work covered by version 3
|
||||||
|
of the GNU General Public License that is incorporated pursuant to the
|
||||||
|
following paragraph.
|
||||||
|
|
||||||
|
Notwithstanding any other provision of this License, you have
|
||||||
|
permission to link or combine any covered work with a work licensed
|
||||||
|
under version 3 of the GNU General Public License into a single
|
||||||
|
combined work, and to convey the resulting work. The terms of this
|
||||||
|
License will continue to apply to the part which is the covered work,
|
||||||
|
but the work with which it is combined will remain governed by version
|
||||||
|
3 of the GNU General Public License.
|
||||||
|
|
||||||
|
14. Revised Versions of this License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions of
|
||||||
|
the GNU Affero General Public License from time to time. Such new versions
|
||||||
|
will be similar in spirit to the present version, but may differ in detail to
|
||||||
|
address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Program specifies that a certain numbered version of the GNU Affero General
|
||||||
|
Public License "or any later version" applies to it, you have the
|
||||||
|
option of following the terms and conditions either of that numbered
|
||||||
|
version or of any later version published by the Free Software
|
||||||
|
Foundation. If the Program does not specify a version number of the
|
||||||
|
GNU Affero General Public License, you may choose any version ever published
|
||||||
|
by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Program specifies that a proxy can decide which future
|
||||||
|
versions of the GNU Affero General Public License can be used, that proxy's
|
||||||
|
public statement of acceptance of a version permanently authorizes you
|
||||||
|
to choose that version for the Program.
|
||||||
|
|
||||||
|
Later license versions may give you additional or different
|
||||||
|
permissions. However, no additional obligations are imposed on any
|
||||||
|
author or copyright holder as a result of your choosing to follow a
|
||||||
|
later version.
|
||||||
|
|
||||||
|
15. Disclaimer of Warranty.
|
||||||
|
|
||||||
|
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||||
|
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||||
|
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||||
|
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||||
|
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||||
|
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||||
|
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||||
|
|
||||||
|
16. Limitation of Liability.
|
||||||
|
|
||||||
|
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||||
|
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||||
|
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||||
|
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||||
|
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||||
|
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||||
|
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||||
|
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||||
|
SUCH DAMAGES.
|
||||||
|
|
||||||
|
17. Interpretation of Sections 15 and 16.
|
||||||
|
|
||||||
|
If the disclaimer of warranty and limitation of liability provided
|
||||||
|
above cannot be given local legal effect according to their terms,
|
||||||
|
reviewing courts shall apply local law that most closely approximates
|
||||||
|
an absolute waiver of all civil liability in connection with the
|
||||||
|
Program, unless a warranty or assumption of liability accompanies a
|
||||||
|
copy of the Program in return for a fee.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
How to Apply These Terms to Your New Programs
|
||||||
|
|
||||||
|
If you develop a new program, and you want it to be of the greatest
|
||||||
|
possible use to the public, the best way to achieve this is to make it
|
||||||
|
free software which everyone can redistribute and change under these terms.
|
||||||
|
|
||||||
|
To do so, attach the following notices to the program. It is safest
|
||||||
|
to attach them to the start of each source file to most effectively
|
||||||
|
state the exclusion of warranty; and each file should have at least
|
||||||
|
the "copyright" line and a pointer to where the full notice is found.
|
||||||
|
|
||||||
|
<one line to give the program's name and a brief idea of what it does.>
|
||||||
|
Copyright (C) <year> <name of author>
|
||||||
|
|
||||||
|
This program is free software: you can redistribute it and/or modify
|
||||||
|
it under the terms of the GNU Affero General Public License as published
|
||||||
|
by the Free Software Foundation, either version 3 of the License, or
|
||||||
|
(at your option) any later version.
|
||||||
|
|
||||||
|
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 Affero General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Affero General Public License
|
||||||
|
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
Also add information on how to contact you by electronic and paper mail.
|
||||||
|
|
||||||
|
If your software can interact with users remotely through a computer
|
||||||
|
network, you should also make sure that it provides a way for users to
|
||||||
|
get its source. For example, if your program is a web application, its
|
||||||
|
interface could display a "Source" link that leads users to an archive
|
||||||
|
of the code. There are many ways you could offer source, and different
|
||||||
|
solutions will be better for different programs; see section 13 for the
|
||||||
|
specific requirements.
|
||||||
|
|
||||||
|
You should also get your employer (if you work as a programmer) or school,
|
||||||
|
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||||
|
For more information on this, and how to apply and follow the GNU AGPL, see
|
||||||
|
<https://www.gnu.org/licenses/>.
|
84
README.md
Normal file
84
README.md
Normal file
|
@ -0,0 +1,84 @@
|
||||||
|
# Mother-of-All-Self-Hosting Ansible playbook
|
||||||
|
|
||||||
|
**MASH** (**M**other-of-**A**ll-**S**elf-**H**osting) is an [Ansible](https://www.ansible.com/) playbook that helps you self-host services as [Docker](https://www.docker.com/) containers on your own server.
|
||||||
|
|
||||||
|
By running services in containers, we can have a predictable and up-to-date setup, across multiple supported distros and CPU architectures.
|
||||||
|
|
||||||
|
This project is fairly new and only supports a few [services](docs/services/README.md) so far, but will grow to support self-hosting a large number of [FOSS](https://en.wikipedia.org/wiki/Free_and_open-source_software) pieces of software.
|
||||||
|
|
||||||
|
|
||||||
|
## Supported services
|
||||||
|
|
||||||
|
See the [full list of supported services here](docs/services/README.md).
|
||||||
|
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
To configure and install service on your own server, follow the [README in the docs/ directory](docs/README.md).
|
||||||
|
|
||||||
|
|
||||||
|
## Changes
|
||||||
|
|
||||||
|
This playbook evolves over time, sometimes with backward-incompatible changes.
|
||||||
|
|
||||||
|
When updating the playbook, refer to [the changelog](CHANGELOG.md) to catch up with what's new.
|
||||||
|
|
||||||
|
|
||||||
|
## Support
|
||||||
|
|
||||||
|
- Matrix room: [#mash-playbook:devture.com](https://matrix.to/#/#mash-playbook:devture.com). To join Matrix, [use a public server](https://app.element.io) like `matrix.org` or self-host Matrix yourself using the related [matrix-docker-ansible-deploy](https://github.com/spantaleev/matrix-docker-ansible-deploy) Ansible playbook
|
||||||
|
|
||||||
|
- GitHub issues: [mother-of-all-self-hosting/mash-playbook/issues](https://github.com/mother-of-all-self-hosting/mash-playbook/issues)
|
||||||
|
|
||||||
|
|
||||||
|
## Related projects
|
||||||
|
|
||||||
|
You may also be interested in these other Ansible playbooks:
|
||||||
|
|
||||||
|
- [gitea-docker-ansible-deploy](https://github.com/spantaleev/gitea-docker-ansible-deploy) - for deploying a [Gitea](https://gitea.io/) git version-control server - this playbook will soon be merged into `mash-playbook`
|
||||||
|
|
||||||
|
- [nextcloud-docker-ansible-deploy](https://github.com/spantaleev/nextcloud-docker-ansible-deploy) - for deploying a [Nextcloud](https://nextcloud.com/) server - this playbook will soon be merged into `mash-playbook`
|
||||||
|
|
||||||
|
- [matrix-docker-ansible-deploy](https://github.com/spantaleev/matrix-docker-ansible-deploy) - for deploying a fully-featured [Matrix](https://matrix.org) homeserver
|
||||||
|
|
||||||
|
- [peertube-docker-ansible-deploy](https://github.com/spantaleev/peertube-docker-ansible-deploy) - for deploying a [PeerTube](https://joinpeertube.org/) video-platform server - this playbook will soon be merged into `mash-playbook`
|
||||||
|
|
||||||
|
- [vaultwarden-docker-ansible-deploy](https://github.com/spantaleev/vaultwarden-docker-ansible-deploy) - for deploying a [Vaultwarden](https://github.com/dani-garcia/vaultwarden) password manager server (unofficial [Bitwarden](https://bitwarden.com/) compatible server) - this playbook will soon be merged into `mash-playbook`
|
||||||
|
|
||||||
|
The [Matrix](https://matrix.org) playbook ([matrix-docker-ansible-deploy](https://github.com/spantaleev/matrix-docker-ansible-deploy)) will remain independent, because the Matrix ecosystem is incredibly large - lots of bots, bridges and other pieces of software. It deserves its own dedicated playbook.
|
||||||
|
|
||||||
|
All other playbooks are for smaller pieces and will be moved into into this playbook for ease of maintenance and all [reasons explained below](#why-create-such-a-mega-playbook).
|
||||||
|
|
||||||
|
|
||||||
|
## Why create such a mega playbook?
|
||||||
|
|
||||||
|
All our [Related](#related-projects) Ansible playbooks re-use roles (for Postgres, Traefik, etc.), but are still hard to maintain and there's a lot of duplication of effort.
|
||||||
|
|
||||||
|
Most of these playbooks host services which require a Postgres database, a Traefik reverse-proxy, a backup solution, etc. All of them need to come with documentation, etc.
|
||||||
|
All these things need to be created and kept up-to-date in each and every playbook.
|
||||||
|
|
||||||
|
Having to use a dedicated Ansible playbook for each and every piece of software means that you have to juggle many playbooks and make sure they don't conflict with one another when installing services on the same server. All [Related](#related-projects) playbooks interoperate nicely, but still require at least a bit of manual configuration to achieve this interoperability.
|
||||||
|
|
||||||
|
Using specialized Ansible playbooks also means that trying out new software is difficult. Despite the playbooks being similar (which eases the learning curve), each one is still a new git repository you need to clone and maintain, etc.
|
||||||
|
|
||||||
|
Furthermore, not all pieces of software are large enough to justify having their own dedicated Ansible playbook. They have no home, so no one uses them.
|
||||||
|
|
||||||
|
We're finding the need for a playbook which combines all of this into one, so that:
|
||||||
|
|
||||||
|
- you don't need to juggle multiple Ansible playbooks
|
||||||
|
- you can try out various services easily - a few lines of extra configuration and you're ready to go
|
||||||
|
- small pieces of software (like [Miniflux](https://miniflux.app/), powered by the [miniflux](https://gitlab.com/etke.cc/roles/miniflux) Ansible role) which don't have their own playbook can finally find a home
|
||||||
|
- you can use a single playbook with the quality you know and trust
|
||||||
|
- shared services (like Postgres) are maintained in one single place
|
||||||
|
- backups are made easy, because everything lives together (same base data path, same Postgres instance)
|
||||||
|
|
||||||
|
Having one large playbook with all services does not necessarily mean you need to host everything on the same server though. Feel free to use as many servers as you see fit. While containers provide some level of isolation, it's still better to not put all your eggs in one basket and create a single point of failure.
|
||||||
|
|
||||||
|
|
||||||
|
## What's with the name?
|
||||||
|
|
||||||
|
Our goal is to create a large Ansible playbook which can be your all-in-one-toolkit for self-hosting services in a clean and reliable way.
|
||||||
|
|
||||||
|
We like the MASH acronym, and [mashing](https://en.wikipedia.org/wiki/Mashing) is popular in the alcohol brewing industry. The result of all that mash is an enjoyable (at least by some) product.
|
||||||
|
|
||||||
|
Then, there's mixing and mashing stuff, which is also what this Ansible playbook is all about - you can mix and mash various pieces of software to create the self-hosted stack of your dreams!
|
19
docs/README.md
Normal file
19
docs/README.md
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
# Table of Contents
|
||||||
|
|
||||||
|
- [Prerequisites](prerequisites.md) - go here to a guided installation using this Ansible playbook
|
||||||
|
|
||||||
|
- [Getting this playbook's source code](getting-the-playbook.md)
|
||||||
|
|
||||||
|
- [Configuring the playbook](configuring-playbook.md)
|
||||||
|
|
||||||
|
- [Installing](installing.md)
|
||||||
|
|
||||||
|
- [Importing an existing Postgres database (from another installation)](services/postgres.md#importing) (optional)
|
||||||
|
|
||||||
|
- [Maintenance / upgrading services](maintenance-upgrading-services.md)
|
||||||
|
|
||||||
|
- [Maintenance / PostgreSQL](services/postgres.md#maintenance)
|
||||||
|
|
||||||
|
- [Maintenance and Troubleshooting](maintenance-and-troubleshooting.md)
|
||||||
|
|
||||||
|
- [Uninstalling](uninstalling.md)
|
18
docs/alternative-architectures.md
Normal file
18
docs/alternative-architectures.md
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
# Alternative architectures
|
||||||
|
|
||||||
|
As stated in the [Prerequisites](prerequisites.md), currently only `amd64` (`x86_64`) is fully supported.
|
||||||
|
|
||||||
|
The playbook automatically determines the target server's architecture (the `mash_playbook_architecture` variable) to be one of the following:
|
||||||
|
|
||||||
|
- `amd64` (`x86_64`)
|
||||||
|
- `arm32`
|
||||||
|
- `arm64`
|
||||||
|
|
||||||
|
Some tools and container images can be built on the host or other measures can be used to install on that architecture.
|
||||||
|
|
||||||
|
|
||||||
|
## Implementation details
|
||||||
|
|
||||||
|
For `amd64`, prebuilt container images are used for all components.
|
||||||
|
|
||||||
|
For other architecture (`arm64`, `arm32`), components which have a prebuilt image make use of it. If the component is not available for the specific architecture, [self-building](self-building.md) will be used. Not all components support self-building though, so your mileage may vary.
|
20
docs/configuring-playbook.md
Normal file
20
docs/configuring-playbook.md
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# Configuring the Ansible playbook
|
||||||
|
|
||||||
|
To configure the playbook, you need to have done the following things:
|
||||||
|
|
||||||
|
- have a server where services services will run
|
||||||
|
- [retrieved the playbook's source code](getting-the-playbook.md) to your computer
|
||||||
|
|
||||||
|
You can then follow these steps inside the playbook directory:
|
||||||
|
|
||||||
|
1. create a directory to hold your configuration (`mkdir inventory/host_vars/<your-domain>`)
|
||||||
|
|
||||||
|
2. copy the sample configuration file (`cp examples/vars.yml inventory/host_vars/<your-domain>/vars.yml`)
|
||||||
|
|
||||||
|
3. edit the configuration file (`inventory/host_vars/<your-domain>/vars.yml`) to your liking. You should [enable one or more services](services/README.md) in your `vars.yml` file. You may also take a look at the various `roles/**/ROLE_NAME_HERE/defaults/main.yml` files and see if there's something you'd like to copy over and override in your `vars.yml` configuration file.
|
||||||
|
|
||||||
|
4. copy the sample inventory hosts file (`cp examples/hosts inventory/hosts`)
|
||||||
|
|
||||||
|
5. edit the inventory hosts file (`inventory/hosts`) to your liking
|
||||||
|
|
||||||
|
When you're done with all the configuration you'd like to do, continue with [Installing](installing.md).
|
41
docs/getting-the-playbook.md
Normal file
41
docs/getting-the-playbook.md
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
# Getting the playbook
|
||||||
|
|
||||||
|
This Ansible playbook is meant to be executed on your own computer (not on the server).
|
||||||
|
|
||||||
|
In special cases (if your computer cannot run Ansible, etc.) you may put the playbook on the server as well.
|
||||||
|
|
||||||
|
You can retrieve the playbook's source code by:
|
||||||
|
|
||||||
|
- [Using git to get the playbook](#using-git-to-get-the-playbook) (recommended)
|
||||||
|
|
||||||
|
- [Downloading the playbook as a ZIP archive](#downloading-the-playbook-as-a-zip-archive) (not recommended)
|
||||||
|
|
||||||
|
|
||||||
|
## Using git to get the playbook
|
||||||
|
|
||||||
|
We recommend using the [git](https://git-scm.com/) tool to get the playbook's source code, because it lets you easily keep up to date in the future when [Maintaining services](maintenance-upgrading-services.md).
|
||||||
|
|
||||||
|
Once you've installed git on your computer, you can go to any directory of your choosing and run the following command to retrieve the playbook's source code:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/mother-of-all-self-hosting/mash-playbook.git
|
||||||
|
```
|
||||||
|
|
||||||
|
This will create a new `mash-playbook` directory.
|
||||||
|
You're supposed to execute all other installation commands inside that directory.
|
||||||
|
|
||||||
|
|
||||||
|
## Downloading the playbook as a ZIP archive
|
||||||
|
|
||||||
|
Alternatively, you can download the playbook as a ZIP archive.
|
||||||
|
This is not recommended, as it's not easy to keep up to date with future updates. We suggest you [use git](#using-git-to-get-the-playbook) instead.
|
||||||
|
|
||||||
|
The latest version is always at the following URL: https://github.com/mother-of-all-self-hosting/mash-playbook/archive/master.zip
|
||||||
|
|
||||||
|
You can extract this archive anywhere. You'll get a directory called `mash-playbook-master`.
|
||||||
|
You're supposed to execute all other installation commands inside that directory.
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------------
|
||||||
|
|
||||||
|
No matter which method you've used to download the playbook, you can proceed by [Configuring the playbook](configuring-playbook.md).
|
96
docs/installing.md
Normal file
96
docs/installing.md
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
# Installing
|
||||||
|
|
||||||
|
If you've [configured the playbook](configuring-playbook.md) and have prepared the required domains (DNS records) depending on the services you've enabled, you can start the installation procedure.
|
||||||
|
|
||||||
|
**Before installing** and each time you update the playbook in the future, you will need to update the Ansible roles in this playbook by running `just roles`. `just roles` is a shortcut (a `roles` target defined in [`justfile`](../justfile) and executed by the [`just`](https://github.com/casey/just) utility) which ultimately runs [ansible-galaxy](https://docs.ansible.com/ansible/latest/cli/ansible-galaxy.html) to download Ansible roles. If you don't have `just`, you can also manually run the `roles` commands seen in the `justfile`.
|
||||||
|
|
||||||
|
|
||||||
|
## Playbook tags introduction
|
||||||
|
|
||||||
|
The Ansible playbook's tasks are tagged, so that certain parts of the Ansible playbook can be run without running all other tasks.
|
||||||
|
|
||||||
|
The general command syntax is: `ansible-playbook -i inventory/hosts setup.yml --tags=COMMA_SEPARATED_TAGS_GO_HERE`
|
||||||
|
|
||||||
|
Here are some playbook tags that you should be familiar with:
|
||||||
|
|
||||||
|
- `setup-all` - runs all setup tasks (installation and uninstallation) for all components, but does not start/restart services
|
||||||
|
|
||||||
|
- `install-all` - like `setup-all`, but skips uninstallation tasks. Useful for maintaining your setup quickly when its components remain unchanged. If you adjust your `vars.yml` to remove components, you'd need to run `setup-all` though, or these components will still remain installed
|
||||||
|
|
||||||
|
- `setup-SERVICE` (e.g. `setup-miniflux`) - runs the setup tasks only for a given role ([Miniflux](services/miniflux.md) in this example), but does not start/restart services. You can discover these additional tags in each role (`roles/**/tasks/main.yml`). Running per-component setup tasks is **not recommended**, as components sometimes depend on each other and running just the setup tasks for a given component may not be enough. For example, for setting up the [Miniflux](services/miniflux.md) service, in addition to the `setup-miniflux` tag, changes to the database are also necessary (the `setup-postgres` tag).
|
||||||
|
|
||||||
|
- `install-SERVICE` (e.g. `install-miniflux`) - like `setup-SERVICE`, but skips uninstallation tasks. See `install-all` above for additional information.
|
||||||
|
|
||||||
|
- `start` - starts all systemd services and makes them start automatically in the future
|
||||||
|
|
||||||
|
- `stop` - stops all systemd services
|
||||||
|
|
||||||
|
`setup-*` tags and `install-*` tags **do not start services** automatically, because you may wish to do things before starting services, such as importing a database dump, restoring data from another server, etc.
|
||||||
|
|
||||||
|
|
||||||
|
## 1. Installing services
|
||||||
|
|
||||||
|
If you **don't** use SSH keys for authentication, but rather a regular password, you may need to add `--ask-pass` to the all Ansible commands
|
||||||
|
|
||||||
|
If you **do** use SSH keys for authentication, **and** use a non-root user to *become* root (sudo), you may need to add `-K` (`--ask-become-pass`) to all Ansible commands
|
||||||
|
|
||||||
|
There 2 ways to start the installation process - depending on whether you're [Installing a brand new server (without importing data)](#installing-a-brand-new-server-without-importing-data) or [Installing a server into which you'll import old data](#installing-a-server-into-which-youll-import-old-data).
|
||||||
|
|
||||||
|
|
||||||
|
### Installing a brand new server (without importing data)
|
||||||
|
|
||||||
|
If this is **a brand new** server and you **won't be importing old data into it**, run all these tags:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
ansible-playbook -i inventory/hosts setup.yml --tags=install-all,start
|
||||||
|
```
|
||||||
|
|
||||||
|
This will do a full installation and start all services.
|
||||||
|
|
||||||
|
Proceed to [Maintaining your setup in the future](#2-maintaining-your-setup-in-the-future) and [Finalize the installation](#3-finalize-the-installation)
|
||||||
|
|
||||||
|
|
||||||
|
### Installing a server into which you'll import old data
|
||||||
|
|
||||||
|
If you will be importing data into your newly created server, install it, but **do not** start its services just yet.
|
||||||
|
Starting its services or messing with its database now will affect your data import later on.
|
||||||
|
|
||||||
|
To do the installation **without** starting services, run only the `install-all` tag:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
ansible-playbook -i inventory/hosts setup.yml --tags=install-all
|
||||||
|
```
|
||||||
|
|
||||||
|
When this command completes, services won't be running yet.
|
||||||
|
|
||||||
|
You can now:
|
||||||
|
|
||||||
|
- [Importing an existing Postgres database (from another installation)](services/postgres.md#importing) (optional)
|
||||||
|
|
||||||
|
.. and then proceed to starting all services:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
ansible-playbook -i inventory/hosts setup.yml --tags=start
|
||||||
|
```
|
||||||
|
|
||||||
|
Proceed to [Maintaining your setup in the future](#2-maintaining-your-setup-in-the-future).
|
||||||
|
|
||||||
|
|
||||||
|
## 2. Maintaining your setup in the future
|
||||||
|
|
||||||
|
Feel free to **re-run the setup command any time** you think something is off with the server configuration. Ansible will take your configuration and update your server to match.
|
||||||
|
|
||||||
|
Note that if you remove components from `vars.yml`, or if we switch some component from being installed by default to not being installed by default anymore, you'd need to run the setup command with `--tags=setup-all` instead of `--tags=install-all`. See [Playbook tags introduction](#playbook-tags-introduction)
|
||||||
|
|
||||||
|
A way to invoke these `ansible-playbook` commands with less typing in the future is to use [just](https://github.com/casey/just) to run them: `just install-all` or `just setup-all`. See [our `justfile`](../justfile) for more information.
|
||||||
|
|
||||||
|
|
||||||
|
## 3. Things to do next
|
||||||
|
|
||||||
|
After you have started the services, you can:
|
||||||
|
|
||||||
|
- start using the configured services
|
||||||
|
- or set up additional services
|
||||||
|
- or learn how to [upgrade services when new versions are released](maintenance-upgrading-services.md)
|
||||||
|
- or come say Hi in our [Matrix](https://matrix.org) support room - [#mash-playbook:devture.com](https://matrix.to/#/#mash-playbook:devture.com). You might learn something or get to help someone else new to hosting services with this playbook.
|
||||||
|
- or help make this playbook better by contributing (code, documentation, or [coffee/beer](https://liberapay.com/mother-of-all-self-hosting/donate))
|
34
docs/maintenance-and-troubleshooting.md
Normal file
34
docs/maintenance-and-troubleshooting.md
Normal file
|
@ -0,0 +1,34 @@
|
||||||
|
# Maintenance and Troubleshooting
|
||||||
|
|
||||||
|
## How to see the current status of your services
|
||||||
|
|
||||||
|
You can check the status of your services by using `systemctl status`. Example:
|
||||||
|
```
|
||||||
|
sudo systemctl status mash-miniflux
|
||||||
|
|
||||||
|
● mash-miniflux.service - Miniflux (mash-miniflux)
|
||||||
|
Loaded: loaded (/etc/systemd/system/mash-miniflux.service; enabled; vendor preset: disabled)
|
||||||
|
Active: active (running) since Tue 2023-03-14 17:41:59 EET; 15h ago
|
||||||
|
```
|
||||||
|
|
||||||
|
You can see the logs by using journalctl. Example:
|
||||||
|
```
|
||||||
|
sudo journalctl -fu mash-miniflux
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
## Increasing logging
|
||||||
|
|
||||||
|
Various Ansible roles for various services supported by this playbook support a `*_log_level` variable or some debug mode which you can enable in your configuration and get extended logs.
|
||||||
|
|
||||||
|
[Re-run the playbook](installing.md) after making such configuration changes.
|
||||||
|
|
||||||
|
|
||||||
|
## Remove unused Docker data
|
||||||
|
|
||||||
|
You can free some disk space from Docker by running `docker system prune -a` on the server.
|
||||||
|
|
||||||
|
|
||||||
|
## Postgres
|
||||||
|
|
||||||
|
See the dedicated [PostgreSQL Maintenance](services/postgres.md#maintenance) documentation page.
|
15
docs/maintenance-upgrading-services.md
Normal file
15
docs/maintenance-upgrading-services.md
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# Upgrading services
|
||||||
|
|
||||||
|
This playbook not only installs various services for you, but can also upgrade them as new versions are made available.
|
||||||
|
|
||||||
|
To upgrade services:
|
||||||
|
|
||||||
|
- update your playbook directory (`git pull`), so you'd obtain everything new we've done
|
||||||
|
|
||||||
|
- take a look at [the changelog](../CHANGELOG.md) to see if there have been any backward-incompatible changes that you need to take care of
|
||||||
|
|
||||||
|
- download the upstream Ansible roles used by the playbook by running `just roles`
|
||||||
|
|
||||||
|
- re-run the [playbook setup](installing.md) and restart all services: `just setup-all`
|
||||||
|
|
||||||
|
**Note**: major version upgrades to the internal PostgreSQL database are not done automatically. To upgrade it, refer to the [upgrading PostgreSQL guide](services/postgres.md#upgrading-postgresql).
|
37
docs/prerequisites.md
Normal file
37
docs/prerequisites.md
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
# Prerequisites
|
||||||
|
|
||||||
|
To install services using this Ansible playbook, you need:
|
||||||
|
|
||||||
|
- (Recommended) An **x86-64** (`amd64`) or **arm64** server running one of these operating systems:
|
||||||
|
- **RedHat**-based distros (7 or newer)
|
||||||
|
- **Debian** (10/Buster or newer)
|
||||||
|
- **Ubuntu** (18.04 or newer, although [20.04 may be problematic](ansible.md#supported-ansible-versions))
|
||||||
|
- **Archlinux**
|
||||||
|
|
||||||
|
Generally, newer is better. We only strive to support released stable versions of distributions, not betas or pre-releases. This playbook can take over your whole server or co-exist with other services that you have there.
|
||||||
|
|
||||||
|
This playbook somewhat supports running on non-`amd64` architectures like ARM. See [Alternative Architectures](alternative-architectures.md).
|
||||||
|
|
||||||
|
If your distro runs within an [LXC container](https://linuxcontainers.org/), you may hit [this issue](https://github.com/spantaleev/matrix-docker-ansible-deploy/issues/703). It can be worked around, if absolutely necessary, but we suggest that you avoid running from within an LXC container.
|
||||||
|
|
||||||
|
- `root` access to your server (or a user capable of elevating to `root` via `sudo`).
|
||||||
|
|
||||||
|
- [Python](https://www.python.org/) being installed on the server. Most distributions install Python by default, but some don't (e.g. Ubuntu 18.04) and require manual installation (something like `apt-get install python3`). On some distros, Ansible may incorrectly [detect the Python version](https://docs.ansible.com/ansible/latest/reference_appendices/interpreter_discovery.html) (2 vs 3) and you may need to explicitly specify the interpreter path in `inventory/hosts` during installation (e.g. `ansible_python_interpreter=/usr/bin/python3`)
|
||||||
|
|
||||||
|
- The [Ansible](http://ansible.com/) program being installed on your own computer. It's used to run this playbook and configures your server for you. Take a look at [our guide about Ansible](ansible.md) for more information, as well as [version requirements](ansible.md#supported-ansible-versions) and alternative ways to run Ansible.
|
||||||
|
|
||||||
|
- the [passlib](https://passlib.readthedocs.io/en/stable/index.html) Python library installed on the computer you run Ansible. On most distros, you need to install some `python-passlib` or `py3-passlib` package, etc.
|
||||||
|
|
||||||
|
- [`git`](https://git-scm.com/) is the recommended way to download the playbook to your computer. `git` may also be required on the server if you will be [self-building](self-building.md) components.
|
||||||
|
|
||||||
|
- [`just`](https://github.com/casey/just) for running `just roles`, etc. (see [`justfile`](../justfile)), although you can also run these commands manually
|
||||||
|
|
||||||
|
- at least one domain name you can use
|
||||||
|
|
||||||
|
- Some TCP/UDP ports open. This playbook (actually [Docker itself](https://docs.docker.com/network/iptables/)) configures the server's internal firewall for you. In most cases, you don't need to do anything special. But **if your server is running behind another firewall**, you'd need to open these ports:
|
||||||
|
|
||||||
|
- `80/tcp`: HTTP webserver
|
||||||
|
- `443/tcp`: HTTPS webserver
|
||||||
|
- potentially some other ports, depending on the services that you enable in the **configuring the playbook** step (later on). Consult each service's documentation page in `docs/` for that.
|
||||||
|
|
||||||
|
When ready to proceed, continue with [Configuring DNS](configuring-dns.md).
|
15
docs/self-building.md
Normal file
15
docs/self-building.md
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
# Self-building
|
||||||
|
|
||||||
|
**Caution: self-building does not have to be used on its own. See the [Alternative Architectures](alternative-architectures.md) page.**
|
||||||
|
|
||||||
|
The playbook supports self-building of various components, which don't have a container image for your architecture. For `amd64`, self-building is not required.
|
||||||
|
|
||||||
|
For other architectures (e.g. `arm32`, `arm64`), ready-made container images are used when available. If there's no ready-made image for a specific component and said component supports self-building, an image will be built on the host. Building images like this takes more time and resources (some build tools need to get installed by the playbook to assist building).
|
||||||
|
|
||||||
|
To make use of self-building, you don't need to do anything. If a component has an image for the specified architecture, the playbook will use it directly. If not, it will build the image on the server itself.
|
||||||
|
|
||||||
|
Note that **not all components support self-building yet**.
|
||||||
|
|
||||||
|
Adding self-building support to other roles is welcome. Feel free to contribute!
|
||||||
|
|
||||||
|
If you'd like **to force self-building** even if an image is available for your architecture, look into the `*_self_build` variables provided by individual roles.
|
22
docs/services/README.md
Normal file
22
docs/services/README.md
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
# Support services
|
||||||
|
|
||||||
|
| Name | Description | Documentation |
|
||||||
|
| ------------------------------ | ------------------------------------- | ------------- |
|
||||||
|
| [Docker](https://www.docker.com/) | Open-source software for deploying containerized applications | [Link](docker.md) |
|
||||||
|
| [Miniflux](https://miniflux.app/) | Minimalist and opinionated feed reader. | [Link](miniflux.md) |
|
||||||
|
| [PostgreSQL](https://www.postgresql.org) | A powerful, open source object-relational database system | [Link](postgres.md) |
|
||||||
|
| [Radicale](https://miniflux.app/) | A Free and Open-Source CalDAV and CardDAV Server (solution for hosting contacts and calendars) | [Link](radicale.md) |
|
||||||
|
| [Traefik](https://doc.traefik.io/traefik/) | A container-aware reverse-proxy server | [Link](traefik.md) |
|
||||||
|
| [Uptime-kuma](https://uptime.kuma.pet/) | A fancy self-hosted monitoring tool | [Link](uptime-kuma.md) |
|
||||||
|
|
||||||
|
|
||||||
|
## Coming soon
|
||||||
|
|
||||||
|
| Name | Description |
|
||||||
|
| ------------------------------ | ------------------------------------- |
|
||||||
|
| [Gitea](https://gitea.io/), by absorbing [gitea-docker-ansible-deploy](https://github.com/spantaleev/gitea-docker-ansible-deploy) | git version-control server |
|
||||||
|
| [Nextcloud](https://nextcloud.com/), by absorbing [nextcloud-docker-ansible-deploy](https://github.com/spantaleev/nextcloud-docker-ansible-deploy) | Groupware server (Files, Contacts, Calendaring, etc.) |
|
||||||
|
| [PeerTube](https://joinpeertube.org/), by absorbing [peertube-docker-ansible-deploy](https://github.com/spantaleev/peertube-docker-ansible-deploy) | A video-platform server |
|
||||||
|
| [Vaultwarden](https://github.com/dani-garcia/vaultwarden), by absorbing [vaultwarden-docker-ansible-deploy](https://github.com/spantaleev/vaultwarden-docker-ansible-deploy) | A password manager server (unofficial [Bitwarden](https://bitwarden.com/) compatible server) |
|
||||||
|
| [Garage](https://garagehq.deuxfleurs.fr/), by absorbing [garage-docker-ansible-deploy](https://github.com/moan0s/garage-docker-ansible-deploy) | Open-source distributed object storage service tailored for self-hosting |
|
||||||
|
| [Prometheus](https://prometheus.io/)| Monitoring system and time series database |
|
5
docs/services/docker.md
Normal file
5
docs/services/docker.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# Docker
|
||||||
|
|
||||||
|
This playbook installs [Docker](https://www.docker.com/) by default, because all services require it.
|
||||||
|
|
||||||
|
To disable Docker installation (and install Docker yourself in another way), use: `mash_playbook_docker_installation_enabled: false`
|
49
docs/services/miniflux.md
Normal file
49
docs/services/miniflux.md
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
# Miniflux
|
||||||
|
|
||||||
|
[Miniflux](https://miniflux.app/) is a minimalist and opinionated feed reader.
|
||||||
|
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
|
||||||
|
This service requires the following other services:
|
||||||
|
|
||||||
|
- a [Postgres](postgres.md) database
|
||||||
|
- a [Traefik](traefik.md) reverse-proxy server
|
||||||
|
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
To enable this service, add the following configuration to your `vars.yml` file and re-run the [installation](../installing.md) process:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# miniflux #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
miniflux_enabled: true
|
||||||
|
|
||||||
|
miniflux_hostname: mash.example.com
|
||||||
|
miniflux_path_prefix: /miniflux
|
||||||
|
|
||||||
|
miniflux_admin_login: your-username-here
|
||||||
|
miniflux_admin_password: a-strong-password-here
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# /miniflux #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
```
|
||||||
|
|
||||||
|
In the example configuration above, we configure the service to be hosted at `https://mash.example.com/miniflux`.
|
||||||
|
|
||||||
|
You can remove the `miniflux_path_prefix` variable definition, to make it default to `/`, so that the service is served at `https://mash.example.com/`.
|
||||||
|
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
After installation, you can log in with your administrator login (`miniflux_admin_login`) and password (`miniflux_admin_password`).
|
||||||
|
|
||||||
|
You can create additional users (admin-privileged or not) after logging in.
|
218
docs/services/postgres.md
Normal file
218
docs/services/postgres.md
Normal file
|
@ -0,0 +1,218 @@
|
||||||
|
# Postgres
|
||||||
|
|
||||||
|
[PostgreSQL](https://www.postgresql.org) is a powerful, open source object-relational database system with over 35 years of active development that has earned it a strong reputation for reliability, feature robustness, and performance.
|
||||||
|
|
||||||
|
Many of the services installed by this playbook require a Postgres database.
|
||||||
|
|
||||||
|
Enabling the Postgres database service will automatically wire all other services to use it.
|
||||||
|
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
To enable this service, add the following configuration to your `vars.yml` file and re-run the [installation](../installing.md) process:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# devture-postgres #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
devture_postgres_enabled: true
|
||||||
|
|
||||||
|
# Put a strong password below, generated with `pwgen -s 64 1` or in another way
|
||||||
|
devture_postgres_connection_password: ''
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# /devture-postgres #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
```
|
||||||
|
|
||||||
|
## Importing
|
||||||
|
|
||||||
|
### Importing an existing Postgres database from another installation (optional)
|
||||||
|
|
||||||
|
Follow this section if you'd like to import your database from a previous installation.
|
||||||
|
|
||||||
|
### Prerequisites
|
||||||
|
|
||||||
|
The playbook supports importing Postgres dump files in **text** (e.g. `pg_dump > dump.sql`) or **gzipped** formats (e.g. `pg_dump | gzip -c > dump.sql.gz`).
|
||||||
|
|
||||||
|
Importing multiple databases (as dumped by `pg_dumpall`) is also supported.
|
||||||
|
|
||||||
|
Before doing the actual import, **you need to upload your Postgres dump file to the server** (any path is okay).
|
||||||
|
|
||||||
|
|
||||||
|
### Importing
|
||||||
|
|
||||||
|
To import, run this command (make sure to replace `<server-path-to-postgres-dump.sql>` with a file path on your server):
|
||||||
|
|
||||||
|
```sh
|
||||||
|
ansible-playbook -i inventory/hosts setup.yml \
|
||||||
|
--extra-vars='server_path_postgres_dump=<server-path-to-postgres-dump.sql> postgres_default_import_database=main' \
|
||||||
|
--tags=import-postgres
|
||||||
|
```
|
||||||
|
|
||||||
|
**Notes**:
|
||||||
|
|
||||||
|
- `<server-path-to-postgres-dump.sql>` must be a file path to a Postgres dump file on the server (not on your local machine!)
|
||||||
|
- `postgres_default_import_database` defaults to `main`, which is useful for importing multiple databases (for dumps made with `pg_dumpall`). If you're importing a single database (e.g. `miniflux`), consider changing `postgres_default_import_database` accordingly
|
||||||
|
|
||||||
|
|
||||||
|
## Maintenance
|
||||||
|
|
||||||
|
This section shows you how to perform various maintenance tasks related to the Postgres database server used by various components of this playbook.
|
||||||
|
|
||||||
|
Table of contents:
|
||||||
|
|
||||||
|
- [Getting a database terminal](#getting-a-database-terminal), for when you wish to execute SQL queries
|
||||||
|
|
||||||
|
- [Vacuuming PostgreSQL](#vacuuming-postgresql), for when you wish to run a Postgres [VACUUM](https://www.postgresql.org/docs/current/sql-vacuum.html) (optimizing disk space)
|
||||||
|
|
||||||
|
- [Backing up PostgreSQL](#backing-up-postgresql), for when you wish to make a backup
|
||||||
|
|
||||||
|
- [Upgrading PostgreSQL](#upgrading-postgresql), for upgrading to new major versions of PostgreSQL. Such **manual upgrades are sometimes required**.
|
||||||
|
|
||||||
|
- [Tuning PostgreSQL](#tuning-postgresql) to make it run faster
|
||||||
|
|
||||||
|
### Getting a database terminal
|
||||||
|
|
||||||
|
You can use the `/mash/postgres/bin/cli` tool to get interactive terminal access ([psql](https://www.postgresql.org/docs/15/app-psql.html)) to the PostgreSQL server.
|
||||||
|
|
||||||
|
By default, this tool puts you in the `main` database, which contains nothing.
|
||||||
|
|
||||||
|
To see the available databases, run `\list` (or just `\l`).
|
||||||
|
|
||||||
|
To change to another database (for example `miniflux`), run `\connect miniflux` (or just `\c miniflux`).
|
||||||
|
|
||||||
|
You can then proceed to write queries. Example: `SELECT COUNT(*) FROM users;`
|
||||||
|
|
||||||
|
**Be careful**. Modifying the database directly (especially as services are running) is dangerous and may lead to irreversible database corruption.
|
||||||
|
When in doubt, consider [making a backup](#backing-up-postgresql).
|
||||||
|
|
||||||
|
|
||||||
|
### Vacuuming PostgreSQL
|
||||||
|
|
||||||
|
Deleting lots data from Postgres does not make it release disk space, until you perform a `VACUUM` operation.
|
||||||
|
|
||||||
|
To perform a `FULL` Postgres [VACUUM](https://www.postgresql.org/docs/current/sql-vacuum.html), run the playbook with `--tags=run-postgres-vacuum`.
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
ansible-playbook -i inventory/hosts setup.yml --tags=run-postgres-vacuum,start
|
||||||
|
```
|
||||||
|
|
||||||
|
**Note**: this will automatically stop Synapse temporarily and restart it later. You'll also need plenty of available disk space in your Postgres data directory (usually `/mash/postgres/data`).
|
||||||
|
|
||||||
|
|
||||||
|
### Backing up PostgreSQL
|
||||||
|
|
||||||
|
To automatically make Postgres database backups on a fixed schedule, see [Setting up postgres backup](configuring-playbook-postgres-backup.md).
|
||||||
|
|
||||||
|
To make a one off back up of the current PostgreSQL database, make sure it's running and then execute a command like this on the server:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
/usr/bin/docker exec \
|
||||||
|
--env-file=/mash/postgres/env-postgres-psql \
|
||||||
|
mash-postgres \
|
||||||
|
/usr/local/bin/pg_dumpall -h mash-postgres \
|
||||||
|
| gzip -c \
|
||||||
|
> /mash/postgres.sql.gz
|
||||||
|
```
|
||||||
|
|
||||||
|
Restoring a backup made this way can be done by [importing it](#importing).
|
||||||
|
|
||||||
|
|
||||||
|
### Upgrading PostgreSQL
|
||||||
|
|
||||||
|
Once this playbook installs Postgres for you, it attempts to preserve the Postgres version it starts with.
|
||||||
|
This is because newer Postgres versions cannot start with data generated by older Postgres versions.
|
||||||
|
|
||||||
|
Upgrades must be performed manually.
|
||||||
|
|
||||||
|
This playbook can upgrade your existing Postgres setup with the following command:
|
||||||
|
|
||||||
|
```sh
|
||||||
|
ansible-playbook -i inventory/hosts setup.yml --tags=upgrade-postgres
|
||||||
|
```
|
||||||
|
|
||||||
|
**The old Postgres data directory is backed up** automatically, by renaming it to `/mash/postgres/data-auto-upgrade-backup`.
|
||||||
|
To rename to a different path, pass some extra flags to the command above, like this: `--extra-vars="postgres_auto_upgrade_backup_data_path=/another/disk/mash-postgres-before-upgrade"`
|
||||||
|
|
||||||
|
The auto-upgrade-backup directory stays around forever, until you **manually decide to delete it**.
|
||||||
|
|
||||||
|
As part of the upgrade, the database is dumped to `/tmp`, an upgraded and empty Postgres server is started, and then the dump is restored into the new server.
|
||||||
|
To use a different directory for the dump, pass some extra flags to the command above, like this: `--extra-vars="postgres_dump_dir=/directory/to/dump/here"`
|
||||||
|
|
||||||
|
To save disk space in `/tmp`, the dump file is gzipped on the fly at the expense of CPU usage.
|
||||||
|
If you have plenty of space in `/tmp` and would rather avoid gzipping, you can explicitly pass a dump filename which doesn't end in `.gz`.
|
||||||
|
Example: `--extra-vars="postgres_dump_name=mash-postgres-dump.sql"`
|
||||||
|
|
||||||
|
**All databases, roles, etc. on the Postgres server are migrated**.
|
||||||
|
|
||||||
|
|
||||||
|
### Tuning PostgreSQL
|
||||||
|
|
||||||
|
PostgreSQL can be tuned to make it run faster. This is done by passing extra arguments to Postgres with the `devture_postgres_process_extra_arguments` variable. You should use a website like https://pgtune.leopard.in.ua/ or information from https://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server to determine what Postgres settings you should change.
|
||||||
|
|
||||||
|
**Note**: the configuration generator at https://pgtune.leopard.in.ua/ adds spaces around the `=` sign, which is invalid. You'll need to remove it manually (`max_connections = 300` -> `max_connections=300`)
|
||||||
|
|
||||||
|
#### Here are some examples:
|
||||||
|
|
||||||
|
These are not recommended values and they may not work well for you. This is just to give you an idea of some of the options that can be set. If you are an experienced PostgreSQL admin feel free to update this documentation with better examples.
|
||||||
|
|
||||||
|
Here is an example config for a small 2 core server with 4GB of RAM and SSD storage:
|
||||||
|
```
|
||||||
|
devture_postgres_process_extra_arguments: [
|
||||||
|
"-c shared_buffers=128MB",
|
||||||
|
"-c effective_cache_size=2304MB",
|
||||||
|
"-c effective_io_concurrency=100",
|
||||||
|
"-c random_page_cost=2.0",
|
||||||
|
"-c min_wal_size=500MB",
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
Here is an example config for a 4 core server with 8GB of RAM on a Virtual Private Server (VPS); the paramters have been configured using https://pgtune.leopard.in.ua with the following setup: PostgreSQL version 12, OS Type: Linux, DB Type: Mixed type of application, Data Storage: SSD storage:
|
||||||
|
```
|
||||||
|
devture_postgres_process_extra_arguments: [
|
||||||
|
"-c max_connections=100",
|
||||||
|
"-c shared_buffers=2GB",
|
||||||
|
"-c effective_cache_size=6GB",
|
||||||
|
"-c maintenance_work_mem=512MB",
|
||||||
|
"-c checkpoint_completion_target=0.9",
|
||||||
|
"-c wal_buffers=16MB",
|
||||||
|
"-c default_statistics_target=100",
|
||||||
|
"-c random_page_cost=1.1",
|
||||||
|
"-c effective_io_concurrency=200",
|
||||||
|
"-c work_mem=5242kB",
|
||||||
|
"-c min_wal_size=1GB",
|
||||||
|
"-c max_wal_size=4GB",
|
||||||
|
"-c max_worker_processes=4",
|
||||||
|
"-c max_parallel_workers_per_gather=2",
|
||||||
|
"-c max_parallel_workers=4",
|
||||||
|
"-c max_parallel_maintenance_workers=2",
|
||||||
|
]
|
||||||
|
```
|
||||||
|
|
||||||
|
Here is an example config for a large 6 core server with 24GB of RAM:
|
||||||
|
```
|
||||||
|
devture_postgres_process_extra_arguments: [
|
||||||
|
"-c max_connections=40",
|
||||||
|
"-c shared_buffers=1536MB",
|
||||||
|
"-c checkpoint_completion_target=0.7",
|
||||||
|
"-c wal_buffers=16MB",
|
||||||
|
"-c default_statistics_target=100",
|
||||||
|
"-c random_page_cost=1.1",
|
||||||
|
"-c effective_io_concurrency=100",
|
||||||
|
"-c work_mem=2621kB",
|
||||||
|
"-c min_wal_size=1GB",
|
||||||
|
"-c max_wal_size=4GB",
|
||||||
|
"-c max_worker_processes=6",
|
||||||
|
"-c max_parallel_workers_per_gather=3",
|
||||||
|
"-c max_parallel_workers=6",
|
||||||
|
"-c max_parallel_maintenance_workers=3",
|
||||||
|
]
|
||||||
|
```
|
51
docs/services/radicale.md
Normal file
51
docs/services/radicale.md
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
# Radicale
|
||||||
|
|
||||||
|
[Radicale](https://radicale.org/) is a Free and Open-Source CalDAV and CardDAV Server (solution for hosting contacts and calendars).
|
||||||
|
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
|
||||||
|
This service requires the following other services:
|
||||||
|
|
||||||
|
- a [Traefik](traefik.md) reverse-proxy server
|
||||||
|
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
To enable this service, add the following configuration to your `vars.yml` file and re-run the [installation](../installing.md) process:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# radicale #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
radicale_enabled: true
|
||||||
|
|
||||||
|
radicale_hostname: mash.example.com
|
||||||
|
radicale_path_prefix: /radicale
|
||||||
|
|
||||||
|
radicale_credentials:
|
||||||
|
- username: someone
|
||||||
|
password: secret-password
|
||||||
|
- username: another
|
||||||
|
password: more-secret-password
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# /radicale #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
```
|
||||||
|
|
||||||
|
In the example configuration above, we configure the service to be hosted at `https://mash.example.com/radicale`.
|
||||||
|
|
||||||
|
You can remove the `radicale_path_prefix` variable definition, to make it default to `/`, so that the service is served at `https://mash.example.com/`.
|
||||||
|
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
After installation, you can log in with your credentials (see the `radicale_credentials` configuration variable).
|
||||||
|
|
||||||
|
Creating new users requires changing the `radicale_credentials` variable and [re-running the playbook](../installing.md). You can rebuild only this service quickly by running: `just install-service radicale`.
|
33
docs/services/traefik.md
Normal file
33
docs/services/traefik.md
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
# Traefik
|
||||||
|
|
||||||
|
[Traefik](https://doc.traefik.io/traefik/) is a container-aware reverse-proxy server.
|
||||||
|
|
||||||
|
Many of the services installed by this playbook need to be exposed to the web (HTTP/HTTPS). This is handled by Traefik.
|
||||||
|
|
||||||
|
Enabling the Traefik service will automatically wire all other services to use it.
|
||||||
|
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
To enable this service, add the following configuration to your `vars.yml` file and re-run the [installation](../installing.md) process:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# devture-traefik #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
mash_playbook_reverse_proxy_type: playbook-managed-traefik
|
||||||
|
|
||||||
|
# Or, if you'd like to install Traefik yourself:
|
||||||
|
#
|
||||||
|
# mash_playbook_reverse_proxy_type: other-traefik-container
|
||||||
|
# mash_playbook_reverse_proxyable_services_additional_network: traefik
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# /devture-traefik #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
```
|
41
docs/services/uptime-kuma.md
Normal file
41
docs/services/uptime-kuma.md
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
# Uptime-kuma
|
||||||
|
|
||||||
|
[Uptime-kuma](https://uptime.kuma.pet/) is a fancy self-hosted monitoring tool.
|
||||||
|
|
||||||
|
|
||||||
|
## Dependencies
|
||||||
|
|
||||||
|
This service requires the following other services:
|
||||||
|
|
||||||
|
- a [Traefik](traefik.md) reverse-proxy server
|
||||||
|
|
||||||
|
|
||||||
|
## Configuration
|
||||||
|
|
||||||
|
To enable this service, add the following configuration to your `vars.yml` file and re-run the [installation](../installing.md) process:
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# uptime-kuma #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
uptime_kuma_enabled: true
|
||||||
|
|
||||||
|
uptime_kuma_hostname: mash.example.com
|
||||||
|
|
||||||
|
# For now, hosting uptime-kuma under a path is not supported.
|
||||||
|
# See: https://github.com/louislam/uptime-kuma/issues/147
|
||||||
|
# uptime_kuma_path_prefix: /uptime-kuma
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# /uptime-kuma #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
The first time you open the Uptime-kuma Web UI it will make you go through a setup wizard, which will set up your admin credentials.
|
17
docs/uninstalling.md
Normal file
17
docs/uninstalling.md
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# Uninstalling
|
||||||
|
|
||||||
|
**Warning**: If you have some trouble with your installation, you can just [re-run the playbook](installing.md) and it will try to set things up again. **Uninstalling and then installing anew rarely solves anything**.
|
||||||
|
|
||||||
|
To uninstall, run these commands (most are meant to be executed on the server itself):
|
||||||
|
|
||||||
|
- ensure all services are stopped: `just stop` (if you can't get Ansible working to run this command, you can run `systemctl stop 'mash-*'` manually on the server)
|
||||||
|
|
||||||
|
- delete the systemd `.service` and `.timer` files (`rm -f /etc/systemd/system/mash-*.{service,timer}`) and reload systemd (`systemctl daemon-reload`)
|
||||||
|
|
||||||
|
- delete some cached Docker images (`docker system prune -a`) or just delete them all (`docker rmi $(docker images -aq)`)
|
||||||
|
|
||||||
|
- uninstall Docker itself, if necessary
|
||||||
|
|
||||||
|
- delete the `/mash` directory (`rm -rf /mash`)
|
||||||
|
|
||||||
|
|
16
examples/hosts
Normal file
16
examples/hosts
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
# To connect using a non-root user (and elevate to root with sudo later),
|
||||||
|
# replace `ansible_ssh_user=root` with something like this: `ansible_ssh_user=username become=true become_user=root`
|
||||||
|
#
|
||||||
|
# For improved Ansible performance, SSH pipelining is enabled by default in `ansible.cfg`.
|
||||||
|
# If this causes SSH connection troubles, disable it by adding `ansible_ssh_pipelining=False`
|
||||||
|
# to the host line below or by adding `ansible_ssh_pipelining: False` to your variables file.
|
||||||
|
#
|
||||||
|
# If you're running this Ansible playbook on the same server as the one you're installing to,
|
||||||
|
# consider adding an additional `ansible_connection=local` argument to the host line below.
|
||||||
|
#
|
||||||
|
# Ansible may fail to discover which Python interpreter to use on the host for some distros (like Ubuntu 20.04).
|
||||||
|
# You may sometimes need to explicitly add the argument `ansible_python_interpreter=/usr/bin/python3`
|
||||||
|
# to the host line below.
|
||||||
|
|
||||||
|
[mash_servers]
|
||||||
|
<your-domain> ansible_host=<your-server's external IP address> ansible_ssh_user=root
|
165
examples/vars.yml
Normal file
165
examples/vars.yml
Normal file
|
@ -0,0 +1,165 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
# Below is an example which installs a few services on the host, in different configuration.
|
||||||
|
# You should tweak this example as you see fit and enable the services that you need.
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# Playbook #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
# Put a strong secret below, generated with `pwgen -s 64 1` or in another way
|
||||||
|
# Various other secrets will be derived from this secret automatically.
|
||||||
|
mash_playbook_generic_secret_key: ''
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# /Playbook #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# Docker #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
# Docker is installed by default.
|
||||||
|
#
|
||||||
|
# To disable Docker installation (in case you'd be installing Docker in another way),
|
||||||
|
# uncomment the line below:
|
||||||
|
# mash_playbook_docker_installation_enabled: false
|
||||||
|
|
||||||
|
# Docker SDK for Python is installed by default.
|
||||||
|
#
|
||||||
|
# To disable Docker SDK for Python installation (in case you'd be installing the SDK in another way),
|
||||||
|
# uncomment the line below:
|
||||||
|
# devture_docker_sdk_for_python_installation_enabled: false
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# /Docker #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# com.devture.ansible.role.timesync #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
# To ensure the server's clock is synchronized (using systemd-timesyncd/ntpd),
|
||||||
|
# we enable the timesync service.
|
||||||
|
|
||||||
|
devture_timesync_installation_enabled: true
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# /com.devture.ansible.role.timesync #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# devture-traefik #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
# Most services require a reverse-proxy, so we enable Traefik here.
|
||||||
|
#
|
||||||
|
# Learn more about the Traefik service in docs/services/traefik.md
|
||||||
|
|
||||||
|
mash_playbook_reverse_proxy_type: playbook-managed-traefik
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# /devture-traefik #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# devture-postgres #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
# Most services require a Postgres database, so we enable Postgres here.
|
||||||
|
#
|
||||||
|
# Learn more about the Postgres service in docs/services/postgres.md
|
||||||
|
|
||||||
|
devture_postgres_enabled: true
|
||||||
|
|
||||||
|
# Put a strong password below, generated with `pwgen -s 64 1` or in another way
|
||||||
|
devture_postgres_connection_password: ''
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# /devture-postgres #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# miniflux #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
# Learn more about the Miniflux service in docs/services/miniflux.md
|
||||||
|
#
|
||||||
|
# This service is only here as an example. If you don't wish to use the
|
||||||
|
# Miniflux service, remove the whole section.
|
||||||
|
|
||||||
|
miniflux_enabled: true
|
||||||
|
|
||||||
|
miniflux_hostname: mash.example.com
|
||||||
|
miniflux_path_prefix: /miniflux
|
||||||
|
|
||||||
|
miniflux_admin_login: your-username-here
|
||||||
|
miniflux_admin_password: a-strong-password-here
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# /miniflux #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# uptime-kuma #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
# Learn more about the Uptime-kuma service in docs/services/uptime-kuma.md
|
||||||
|
#
|
||||||
|
# This service is only here as an example. If you don't wish to use the
|
||||||
|
# Uptime-kuma service, remove the whole section.
|
||||||
|
|
||||||
|
uptime_kuma_enabled: true
|
||||||
|
|
||||||
|
uptime_kuma_hostname: uptime-kuma.example.com
|
||||||
|
|
||||||
|
# For now, hosting uptime-kuma under a path is not supported.
|
||||||
|
# See: https://github.com/louislam/uptime-kuma/issues/147
|
||||||
|
# uptime_kuma_path_prefix: /uptime-kuma
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# /uptime-kuma #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
|
||||||
|
# You can add additional services here, as you see fit.
|
||||||
|
# To discover new services and configuration, see docs/services/README.md
|
293
group_vars/mash_servers
Normal file
293
group_vars/mash_servers
Normal file
|
@ -0,0 +1,293 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# com.devture.ansible.role.systemd_service_manager #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
devture_systemd_service_manager_services_list_auto: |
|
||||||
|
{{
|
||||||
|
([{'name': (devture_postgres_identifier + '.service'), 'priority': 500, 'groups': ['mash', 'postgres']}] if devture_postgres_enabled else [])
|
||||||
|
+
|
||||||
|
([{'name': (devture_container_socket_proxy_identifier + '.service'), 'priority': 2900, 'groups': ['mash', 'reverse-proxies', 'container-socket-proxy']}] if devture_container_socket_proxy_enabled else [])
|
||||||
|
+
|
||||||
|
([{'name': (devture_traefik_identifier + '.service'), 'priority': 3000, 'groups': ['mash', 'traefik', 'reverse-proxies']}] if devture_traefik_enabled else [])
|
||||||
|
+
|
||||||
|
([{'name': (miniflux_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'miniflux']}] if miniflux_enabled else [])
|
||||||
|
+
|
||||||
|
([{'name': (radicale_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'radicale']}] if radicale_enabled else [])
|
||||||
|
+
|
||||||
|
([{'name': (uptime_kuma_identifier + '.service'), 'priority': 2000, 'groups': ['mash', 'uptime-kuma']}] if uptime_kuma_enabled else [])
|
||||||
|
}}
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# /com.devture.ansible.role.systemd_service_manager #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# com.devture.ansible.role.postgres #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
devture_postgres_enabled: false
|
||||||
|
|
||||||
|
devture_postgres_identifier: mash-postgres
|
||||||
|
|
||||||
|
devture_postgres_architecture: "{{ mash_playbook_architecture }}"
|
||||||
|
|
||||||
|
devture_postgres_base_path: "{{ mash_playbook_base_path }}/postgres"
|
||||||
|
|
||||||
|
devture_postgres_uid: "{{ mash_playbook_uid }}"
|
||||||
|
devture_postgres_gid: "{{ mash_playbook_gid }}"
|
||||||
|
|
||||||
|
devture_postgres_systemd_services_to_stop_for_maintenance_list: |
|
||||||
|
{{
|
||||||
|
([(miniflux_identifier + '.service')] if miniflux_enabled else [])
|
||||||
|
}}
|
||||||
|
|
||||||
|
devture_postgres_managed_databases_auto: |
|
||||||
|
{{
|
||||||
|
([{
|
||||||
|
'name': miniflux_database_name,
|
||||||
|
'username': miniflux_database_username,
|
||||||
|
'password': miniflux_database_password,
|
||||||
|
}] if miniflux_enabled else [])
|
||||||
|
}}
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# /com.devture.ansible.role.postgres #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# com.devture.ansible.role.playbook_state_preserver #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
# To completely disable this feature, use `devture_playbook_state_preserver_enabled: false`.
|
||||||
|
|
||||||
|
devture_playbook_state_preserver_uid: "{{ mash_playbook_uid }}"
|
||||||
|
devture_playbook_state_preserver_gid: "{{ mash_playbook_gid }}"
|
||||||
|
|
||||||
|
devture_playbook_state_preserver_vars_preservation_dst: "{{ mash_playbook_base_path }}/vars.yml"
|
||||||
|
|
||||||
|
devture_playbook_state_preserver_commit_hash_preservation_dst: "{{ mash_playbook_base_path }}/git_hash.yml"
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# /com.devture.ansible.role.playbook_state_preserver #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# com.devture.ansible.role.container_socket_proxy #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
devture_container_socket_proxy_enabled: "{{ devture_traefik_enabled }}"
|
||||||
|
|
||||||
|
devture_container_socket_proxy_identifier: mash-container-socket-proxy
|
||||||
|
|
||||||
|
devture_container_socket_proxy_base_path: "{{ mash_playbook_base_path }}/container-socket-proxy"
|
||||||
|
|
||||||
|
devture_container_socket_proxy_uid: "{{ mash_playbook_uid }}"
|
||||||
|
devture_container_socket_proxy_gid: "{{ mash_playbook_gid }}"
|
||||||
|
|
||||||
|
# Traefik requires read access to the containers APIs to do its job
|
||||||
|
devture_container_socket_proxy_api_containers_enabled: true
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# /com.devture.ansible.role.container_socket_proxy #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# com.devture.ansible.role.traefik #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
devture_traefik_enabled: "{{ mash_playbook_reverse_proxy_type == 'playbook-managed-traefik' }}"
|
||||||
|
|
||||||
|
devture_traefik_identifier: mash-traefik
|
||||||
|
|
||||||
|
devture_traefik_base_path: "{{ mash_playbook_base_path }}/traefik"
|
||||||
|
|
||||||
|
devture_traefik_uid: "{{ mash_playbook_uid }}"
|
||||||
|
devture_traefik_gid: "{{ mash_playbook_gid }}"
|
||||||
|
|
||||||
|
devture_traefik_config_providers_docker_endpoint: "{{ devture_container_socket_proxy_endpoint if devture_container_socket_proxy_enabled else 'unix:///var/run/docker.sock' }}"
|
||||||
|
|
||||||
|
devture_traefik_container_additional_networks: |
|
||||||
|
{{
|
||||||
|
([devture_container_socket_proxy_container_network] if devture_container_socket_proxy_enabled else [])
|
||||||
|
}}
|
||||||
|
|
||||||
|
devture_traefik_systemd_required_services_list: |
|
||||||
|
{{
|
||||||
|
(['docker.service'])
|
||||||
|
+
|
||||||
|
([devture_container_socket_proxy_identifier + '.service'] if devture_container_socket_proxy_enabled else [])
|
||||||
|
}}
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# /com.devture.ansible.role.traefik #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# com.devture.ansible.role.docker_sdk_for_python #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
# To completely disable installing the Docker SDK for Python, use `devture_docker_sdk_for_python_installation_enabled: false`.
|
||||||
|
|
||||||
|
devture_docker_sdk_for_python_installation_enabled: true
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# /com.devture.ansible.role.docker_sdk_for_python #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# com.devture.ansible.role.timesync #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
# To completely disable installing systemd-timesyncd/ntpd, use `devture_timesync_installation_enabled: false`.
|
||||||
|
|
||||||
|
devture_timesync_installation_enabled: false
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# /com.devture.ansible.role.timesync #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# etke/miniflux #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
miniflux_enabled: false
|
||||||
|
|
||||||
|
miniflux_identifier: mash-miniflux
|
||||||
|
|
||||||
|
miniflux_base_path: "{{ mash_playbook_base_path }}/miniflux"
|
||||||
|
|
||||||
|
miniflux_uid: "{{ mash_playbook_uid }}"
|
||||||
|
miniflux_gid: "{{ mash_playbook_gid }}"
|
||||||
|
|
||||||
|
miniflux_container_additional_networks: |
|
||||||
|
{{
|
||||||
|
([mash_playbook_reverse_proxyable_services_additional_network] if mash_playbook_reverse_proxyable_services_additional_network else [])
|
||||||
|
+
|
||||||
|
([devture_postgres_container_network] if devture_postgres_enabled and miniflux_database_hostname == devture_postgres_identifier and devture_postgres_container_network != miniflux_container_network else [])
|
||||||
|
}}
|
||||||
|
|
||||||
|
miniflux_container_labels_traefik_enabled: "{{ mash_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}"
|
||||||
|
miniflux_container_labels_traefik_docker_network: "{{ mash_playbook_reverse_proxyable_services_additional_network }}"
|
||||||
|
miniflux_container_labels_traefik_entrypoints: "{{ devture_traefik_entrypoint_primary }}"
|
||||||
|
miniflux_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certResolver_primary }}"
|
||||||
|
|
||||||
|
miniflux_database_hostname: "{{ devture_postgres_connection_hostname if devture_postgres_enabled else '' }}"
|
||||||
|
miniflux_database_password: "{{ '%s' | format(mash_playbook_generic_secret_key) | password_hash('sha512', 'miniflux.db', rounds=655555) | to_uuid }}"
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# /etke/miniflux #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# etke/radicale #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
radicale_enabled: false
|
||||||
|
|
||||||
|
radicale_identifier: mash-radicale
|
||||||
|
|
||||||
|
radicale_base_path: "{{ mash_playbook_base_path }}/radicale"
|
||||||
|
|
||||||
|
radicale_uid: "{{ mash_playbook_uid }}"
|
||||||
|
radicale_gid: "{{ mash_playbook_gid }}"
|
||||||
|
|
||||||
|
radicale_container_additional_networks: |
|
||||||
|
{{
|
||||||
|
([mash_playbook_reverse_proxyable_services_additional_network] if mash_playbook_reverse_proxyable_services_additional_network else [])
|
||||||
|
}}
|
||||||
|
|
||||||
|
radicale_container_labels_traefik_enabled: "{{ mash_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}"
|
||||||
|
radicale_container_labels_traefik_docker_network: "{{ mash_playbook_reverse_proxyable_services_additional_network }}"
|
||||||
|
radicale_container_labels_traefik_entrypoints: "{{ devture_traefik_entrypoint_primary }}"
|
||||||
|
radicale_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certResolver_primary }}"
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# /etke/radicale #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# etke/uptime_kuma #
|
||||||
|
# #
|
||||||
|
########################################################################
|
||||||
|
|
||||||
|
uptime_kuma_enabled: false
|
||||||
|
|
||||||
|
uptime_kuma_identifier: mash-uptime-kuma
|
||||||
|
|
||||||
|
uptime_kuma_base_path: "{{ mash_playbook_base_path }}/uptime-kuma"
|
||||||
|
|
||||||
|
uptime_kuma_uid: "{{ mash_playbook_uid }}"
|
||||||
|
uptime_kuma_gid: "{{ mash_playbook_gid }}"
|
||||||
|
|
||||||
|
uptime_kuma_container_additional_networks: |
|
||||||
|
{{
|
||||||
|
([mash_playbook_reverse_proxyable_services_additional_network] if mash_playbook_reverse_proxyable_services_additional_network else [])
|
||||||
|
}}
|
||||||
|
|
||||||
|
uptime_kuma_container_labels_traefik_enabled: "{{ mash_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}"
|
||||||
|
uptime_kuma_container_labels_traefik_docker_network: "{{ mash_playbook_reverse_proxyable_services_additional_network }}"
|
||||||
|
uptime_kuma_container_labels_traefik_entrypoints: "{{ devture_traefik_entrypoint_primary }}"
|
||||||
|
uptime_kuma_container_labels_traefik_tls_certResolver: "{{ devture_traefik_certResolver_primary }}"
|
||||||
|
|
||||||
|
########################################################################
|
||||||
|
# #
|
||||||
|
# /etke/uptime_kuma #
|
||||||
|
# #
|
||||||
|
########################################################################
|
0
inventory/.gitkeep
Normal file
0
inventory/.gitkeep
Normal file
44
justfile
Normal file
44
justfile
Normal file
|
@ -0,0 +1,44 @@
|
||||||
|
# Shows help
|
||||||
|
default:
|
||||||
|
@just --list --justfile {{ justfile() }}
|
||||||
|
|
||||||
|
# Pulls external Ansible roles
|
||||||
|
roles:
|
||||||
|
rm -rf roles/galaxy
|
||||||
|
ansible-galaxy install -r requirements.yml -p roles/galaxy/ --force
|
||||||
|
|
||||||
|
# Runs ansible-lint against all roles in the playbook
|
||||||
|
lint:
|
||||||
|
ansible-lint
|
||||||
|
|
||||||
|
# Runs the playbook with --tags=install-all,start and optional arguments
|
||||||
|
install-all *extra_args: (run-tags "install-all,start" extra_args)
|
||||||
|
|
||||||
|
# Runs installation tasks for a single service
|
||||||
|
install-service service:
|
||||||
|
just --justfile {{ justfile() }} run --tags=install-{{ service }},start-group --extra-vars=group={{ service }}
|
||||||
|
|
||||||
|
# Runs the playbook with --tags=setup-all,start and optional arguments
|
||||||
|
setup-all *extra_args: (run-tags "setup-all,start" extra_args)
|
||||||
|
|
||||||
|
# Runs the playbook with the given list of arguments
|
||||||
|
run +extra_args:
|
||||||
|
time ansible-playbook -i inventory/hosts setup.yml {{ extra_args }}
|
||||||
|
|
||||||
|
# Runs the playbook with the given list of comma-separated tags and optional arguments
|
||||||
|
run-tags tags *extra_args:
|
||||||
|
just --justfile {{ justfile() }} run --tags={{ tags }} {{ extra_args }}
|
||||||
|
|
||||||
|
# Starts all services
|
||||||
|
start-all *extra_args: (run-tags "start-all" extra_args)
|
||||||
|
|
||||||
|
# Starts a specific service group
|
||||||
|
start-group group *extra_args:
|
||||||
|
@just --justfile {{ justfile() }} run-tags start-group --extra-vars="group={{ group }}" {{ extra_args }}
|
||||||
|
|
||||||
|
# Stops all services
|
||||||
|
stop-all *extra_args: (run-tags "stop-all" extra_args)
|
||||||
|
|
||||||
|
# Stops a specific service group
|
||||||
|
stop-group group *extra_args:
|
||||||
|
@just --justfile {{ justfile() }} run-tags stop-group --extra-vars="group={{ group }}" {{ extra_args }}
|
43
requirements.yml
Normal file
43
requirements.yml
Normal file
|
@ -0,0 +1,43 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- src: geerlingguy.docker
|
||||||
|
version: 6.1.0
|
||||||
|
|
||||||
|
- src: git+https://github.com/devture/com.devture.ansible.role.docker_sdk_for_python.git
|
||||||
|
version: 129c8590e106b83e6f4c259649a613c6279e937a
|
||||||
|
|
||||||
|
- src: git+https://github.com/devture/com.devture.ansible.role.playbook_help.git
|
||||||
|
version: c1f40e82b4d6b072b6f0e885239322bdaaaf554f
|
||||||
|
|
||||||
|
- src: git+https://github.com/devture/com.devture.ansible.role.systemd_docker_base.git
|
||||||
|
version: 327d2e17f5189ac2480d6012f58cf64a2b46efba
|
||||||
|
|
||||||
|
- src: git+https://github.com/devture/com.devture.ansible.role.timesync.git
|
||||||
|
version: 3d5bb2976815958cdce3f368fa34fb51554f899b
|
||||||
|
|
||||||
|
- src: git+https://github.com/devture/com.devture.ansible.role.playbook_state_preserver.git
|
||||||
|
version: ff2fd42e1c1a9e28e3312bbd725395f9c2fc7f16
|
||||||
|
|
||||||
|
- src: git+https://github.com/devture/com.devture.ansible.role.postgres.git
|
||||||
|
version: a1bb78d194434b38005f3a9e623bfa4b2c06c7bc
|
||||||
|
|
||||||
|
- src: git+https://github.com/devture/com.devture.ansible.role.container_socket_proxy.git
|
||||||
|
version: v0.1.1-1
|
||||||
|
|
||||||
|
- src: git+https://github.com/devture/com.devture.ansible.role.traefik.git
|
||||||
|
version: v2.9.8-2
|
||||||
|
|
||||||
|
- src: git+https://github.com/devture/com.devture.ansible.role.systemd_service_manager.git
|
||||||
|
version: 6ccb88ac5fc27e1e70afcd48278ade4b564a9096
|
||||||
|
|
||||||
|
- src: git+https://github.com/devture/com.devture.ansible.role.playbook_runtime_messages.git
|
||||||
|
version: 9b4b088c62b528b73a9a7c93d3109b091dd42ec6
|
||||||
|
|
||||||
|
- src: git+https://gitlab.com/etke.cc/roles/miniflux.git
|
||||||
|
version: v2.0.42-1
|
||||||
|
|
||||||
|
- src: git+https://gitlab.com/etke.cc/roles/radicale.git
|
||||||
|
version: v3.1.8.1-1
|
||||||
|
|
||||||
|
- src: git+https://gitlab.com/etke.cc/roles/uptime_kuma.git
|
||||||
|
version: v1.20.2-1
|
59
roles/mash/playbook_base/defaults/main.yml
Normal file
59
roles/mash/playbook_base/defaults/main.yml
Normal file
|
@ -0,0 +1,59 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
mash_playbook_user_username: mash
|
||||||
|
mash_playbook_user_groupname: mash
|
||||||
|
|
||||||
|
# By default, the playbook creates the user (`mash_playbook_user_username`)
|
||||||
|
# and group (`mash_playbook_user_groupname`) with a random id.
|
||||||
|
# To use a specific user/group id, override these variables.
|
||||||
|
mash_playbook_uid: ~
|
||||||
|
mash_playbook_gid: ~
|
||||||
|
|
||||||
|
# A secret used as a base, for generating various other secrets.
|
||||||
|
# You can put any string here, but generating a strong one is preferred (e.g. `pwgen -s 64 1`).
|
||||||
|
mash_playbook_generic_secret_key: ''
|
||||||
|
|
||||||
|
# Controls the base path where all services will be installed
|
||||||
|
mash_playbook_base_path: /mash
|
||||||
|
mash_playbook_base_path_mode: "750"
|
||||||
|
|
||||||
|
# The architecture that your server runs.
|
||||||
|
# Recognized values by us are 'amd64', 'arm32' and 'arm64'.
|
||||||
|
# Not all architectures support all services, so your experience (on non-amd64) may vary.
|
||||||
|
mash_playbook_architecture: "{{ 'amd64' if ansible_architecture == 'x86_64' else ('arm64' if ansible_architecture == 'aarch64' else ('arm32' if ansible_architecture.startswith('armv') else '')) }}"
|
||||||
|
|
||||||
|
# Specifies the type of reverse-proxy used by the playbook.
|
||||||
|
#
|
||||||
|
# Changing this has an effect on whether a reverse-proxy is installed at all and what its type is,
|
||||||
|
# as well as how all other services are configured.
|
||||||
|
#
|
||||||
|
# Valid options and a description of their behavior:
|
||||||
|
#
|
||||||
|
# - `playbook-managed-traefik`
|
||||||
|
# - the playbook will run a managed Traefik instance (mash-traefik)
|
||||||
|
# - Traefik will do SSL termination, unless you disable it (e.g. `devture_traefik_config_entrypoint_web_secure_enabled: false`)
|
||||||
|
# - if SSL termination is enabled (as it is by default), you need to populate: `devture_traefik_config_certificatesResolvers_acme_email`
|
||||||
|
#
|
||||||
|
# - `other-traefik-container`
|
||||||
|
# - this playbook will not install Traefik
|
||||||
|
# - nevertheless, the playbook expects that you would install Traefik yourself via other means
|
||||||
|
# - you should make sure your Traefik configuration is compatible with what the playbook would have configured (web, web-secure entrypoints, etc.)
|
||||||
|
# - you need to set `mash_playbook_reverse_proxyable_services_additional_network` to the name of your Traefik network
|
||||||
|
#
|
||||||
|
# - `none`
|
||||||
|
# - no reverse-proxy will be installed
|
||||||
|
# - no port exposure will be done for any of the container services
|
||||||
|
# - it's up to you to expose the ports you want, etc.
|
||||||
|
mash_playbook_reverse_proxy_type: playbook-managed-traefik
|
||||||
|
|
||||||
|
# Controls whether to install Docker or not
|
||||||
|
# Also see `devture_docker_sdk_for_python_installation_enabled`.
|
||||||
|
mash_playbook_docker_installation_enabled: true
|
||||||
|
|
||||||
|
# Controls whether to attach Traefik labels to services.
|
||||||
|
# This is separate from `devture_traefik_enabled`, because you may wish to disable Traefik installation by the playbook,
|
||||||
|
# yet still use Traefik installed in another way.
|
||||||
|
mash_playbook_traefik_labels_enabled: "{{ mash_playbook_reverse_proxy_type in ['playbook-managed-traefik', 'other-traefik-container'] }}"
|
||||||
|
|
||||||
|
# Controls the additional network that reverse-proxyable services will be connected to.
|
||||||
|
mash_playbook_reverse_proxyable_services_additional_network: "{{ devture_traefik_container_network if devture_traefik_enabled else '' }}"
|
16
roles/mash/playbook_base/tasks/main.yml
Normal file
16
roles/mash/playbook_base/tasks/main.yml
Normal file
|
@ -0,0 +1,16 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
# This needs to always run, because it populates `mash_playbook_uid` and `mash_playbook_gid`,
|
||||||
|
# which are required by many other roles.
|
||||||
|
- block:
|
||||||
|
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_user.yml"
|
||||||
|
tags:
|
||||||
|
- always
|
||||||
|
|
||||||
|
- block:
|
||||||
|
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/validate_config.yml"
|
||||||
|
|
||||||
|
- ansible.builtin.include_tasks: "{{ role_path }}/tasks/setup_base_dir.yml"
|
||||||
|
tags:
|
||||||
|
- setup-all
|
||||||
|
- install-all
|
9
roles/mash/playbook_base/tasks/setup_base_dir.yml
Normal file
9
roles/mash/playbook_base/tasks/setup_base_dir.yml
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: Ensure mash base paths exists
|
||||||
|
ansible.builtin.file:
|
||||||
|
path: "{{ mash_playbook_base_path }}"
|
||||||
|
state: directory
|
||||||
|
mode: "{{ mash_playbook_base_path_mode }}"
|
||||||
|
owner: "{{ mash_playbook_uid }}"
|
||||||
|
group: "{{ mash_playbook_gid }}"
|
24
roles/mash/playbook_base/tasks/setup_user.yml
Normal file
24
roles/mash/playbook_base/tasks/setup_user.yml
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: Ensure mash group is created
|
||||||
|
ansible.builtin.group:
|
||||||
|
name: "{{ mash_playbook_user_groupname }}"
|
||||||
|
gid: "{{ omit if mash_playbook_gid is none else mash_playbook_gid }}"
|
||||||
|
state: present
|
||||||
|
register: mash_base_group_result
|
||||||
|
|
||||||
|
- name: Ensure mash user is created
|
||||||
|
ansible.builtin.user:
|
||||||
|
name: "{{ mash_playbook_user_username }}"
|
||||||
|
uid: "{{ omit if mash_playbook_uid is none else mash_playbook_uid }}"
|
||||||
|
state: present
|
||||||
|
group: "{{ mash_playbook_user_groupname }}"
|
||||||
|
home: "{{ mash_playbook_base_path }}"
|
||||||
|
create_home: false
|
||||||
|
system: true
|
||||||
|
register: mash_base_user_result
|
||||||
|
|
||||||
|
- name: Initialize mash_playbook_uid and mash_playbook_gid
|
||||||
|
ansible.builtin.set_fact:
|
||||||
|
mash_playbook_uid: "{{ mash_base_user_result.uid }}"
|
||||||
|
mash_playbook_gid: "{{ mash_base_group_result.gid }}"
|
14
roles/mash/playbook_base/tasks/validate_config.yml
Normal file
14
roles/mash/playbook_base/tasks/validate_config.yml
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
---
|
||||||
|
|
||||||
|
- name: Fail if required mash playbook settings not defined
|
||||||
|
fail:
|
||||||
|
msg: >-
|
||||||
|
You need to define a required configuration setting (`{{ item }}`) for using this role.
|
||||||
|
when: "vars[item] == ''"
|
||||||
|
with_items:
|
||||||
|
- mash_playbook_generic_secret_key
|
||||||
|
|
||||||
|
- name: Fail if mash_playbook_reverse_proxy_type is set incorrectly
|
||||||
|
ansible.builtin.fail:
|
||||||
|
msg: "Detected that variable mash_playbook_reverse_proxy_type (current value: `{{ mash_playbook_reverse_proxy_type }}`) appears to be set incorrectly. See roles/custom/mash_playbook_base/defaults/main.yml for valid choices."
|
||||||
|
when: mash_playbook_reverse_proxy_type not in ['playbook-managed-traefik', 'other-traefik-container', 'none']
|
64
setup.yml
Normal file
64
setup.yml
Normal file
|
@ -0,0 +1,64 @@
|
||||||
|
- name: "Set up a self-hosted server"
|
||||||
|
hosts: "{{ target if target is defined else 'mash_servers' }}"
|
||||||
|
become: true
|
||||||
|
|
||||||
|
roles:
|
||||||
|
# This role has no tasks at all
|
||||||
|
- role: galaxy/com.devture.ansible.role.playbook_help
|
||||||
|
|
||||||
|
# This role has no tasks at all
|
||||||
|
- role: galaxy/com.devture.ansible.role.systemd_docker_base
|
||||||
|
|
||||||
|
- when: mash_playbook_docker_installation_enabled | bool
|
||||||
|
role: galaxy/geerlingguy.docker
|
||||||
|
vars:
|
||||||
|
docker_install_compose: false
|
||||||
|
tags:
|
||||||
|
- setup-docker
|
||||||
|
- setup-all
|
||||||
|
- install-docker
|
||||||
|
- install-all
|
||||||
|
|
||||||
|
- when: devture_docker_sdk_for_python_installation_enabled | bool
|
||||||
|
role: galaxy/com.devture.ansible.role.docker_sdk_for_python
|
||||||
|
tags:
|
||||||
|
- setup-docker
|
||||||
|
- setup-all
|
||||||
|
- install-docker
|
||||||
|
- install-all
|
||||||
|
|
||||||
|
- when: devture_timesync_installation_enabled | bool
|
||||||
|
role: galaxy/com.devture.ansible.role.timesync
|
||||||
|
tags:
|
||||||
|
- setup-timesync
|
||||||
|
- setup-all
|
||||||
|
- install-timesync
|
||||||
|
- install-all
|
||||||
|
|
||||||
|
- role: mash/playbook_base
|
||||||
|
|
||||||
|
# This role exposes various tags (setup-postgres, setup-all, upgrade-postgres, import-postgres, etc.), so we don't tag it here.
|
||||||
|
- role: galaxy/com.devture.ansible.role.postgres
|
||||||
|
|
||||||
|
- role: galaxy/com.devture.ansible.role.container_socket_proxy
|
||||||
|
|
||||||
|
- role: galaxy/com.devture.ansible.role.traefik
|
||||||
|
|
||||||
|
- role: galaxy/miniflux
|
||||||
|
|
||||||
|
- role: galaxy/radicale
|
||||||
|
|
||||||
|
- role: galaxy/uptime_kuma
|
||||||
|
|
||||||
|
- when: devture_systemd_service_manager_enabled | bool
|
||||||
|
role: galaxy/com.devture.ansible.role.systemd_service_manager
|
||||||
|
|
||||||
|
# This is pretty much last, because we want it to better serve as a "last known good configuration".
|
||||||
|
# See: https://github.com/spantaleev/matrix-docker-ansible-deploy/pull/2217#issuecomment-1301487601
|
||||||
|
- when: devture_playbook_state_preserver_enabled | bool
|
||||||
|
role: galaxy/com.devture.ansible.role.playbook_state_preserver
|
||||||
|
tags:
|
||||||
|
- setup-all
|
||||||
|
- install-all
|
||||||
|
|
||||||
|
- role: galaxy/com.devture.ansible.role.playbook_runtime_messages
|
Loading…
Reference in a new issue