mirror of
https://github.com/DO1JLR/ansible_playbook_servers.git
synced 2024-09-14 19:53:56 +02:00
Initial commit
This commit is contained in:
commit
565b57a1b9
14 changed files with 375 additions and 0 deletions
4
.github/FUNDING.yml
vendored
Normal file
4
.github/FUNDING.yml
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
# These are supported funding model platforms
|
||||
|
||||
github: [do1jlr]
|
||||
liberapay: L3D
|
217
.github/license.svg
vendored
Normal file
217
.github/license.svg
vendored
Normal file
|
@ -0,0 +1,217 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="83.946869"
|
||||
height="20.137625"
|
||||
version="1.1"
|
||||
id="svg28"
|
||||
sodipodi:docname="license.svg"
|
||||
inkscape:version="0.92.4 5da689c313, 2019-01-14">
|
||||
<metadata
|
||||
id="metadata34">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
<dc:title></dc:title>
|
||||
<cc:license
|
||||
rdf:resource="MIT (c) L3D <l3d@c3woc.de>" />
|
||||
<dc:creator>
|
||||
<cc:Agent>
|
||||
<dc:title>3D <l3d@c3woc.de></dc:title>
|
||||
</cc:Agent>
|
||||
</dc:creator>
|
||||
<dc:rights>
|
||||
<cc:Agent>
|
||||
<dc:title>MIT License</dc:title>
|
||||
</cc:Agent>
|
||||
</dc:rights>
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs32">
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#b"
|
||||
id="linearGradient4625"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(4.9067096,0,0,0.44280744,1.0963297e-6,-1e-6)"
|
||||
x1="0"
|
||||
y1="-0.28392482"
|
||||
x2="0"
|
||||
y2="45.166359" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#b"
|
||||
id="linearGradient837"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(4.9067096,0,0,0.44280744,1.0963297e-6,-1e-6)"
|
||||
x1="0"
|
||||
y1="-0.28392482"
|
||||
x2="0"
|
||||
y2="45.166359" />
|
||||
<linearGradient
|
||||
inkscape:collect="always"
|
||||
xlink:href="#b"
|
||||
id="linearGradient839"
|
||||
gradientUnits="userSpaceOnUse"
|
||||
gradientTransform="matrix(4.9067096,0,0,0.44280744,1.0963297e-6,-1e-6)"
|
||||
x1="0"
|
||||
y1="-0.28392482"
|
||||
x2="0"
|
||||
y2="45.166359" />
|
||||
</defs>
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1916"
|
||||
inkscape:window-height="1152"
|
||||
id="namedview30"
|
||||
showgrid="false"
|
||||
showguides="true"
|
||||
inkscape:guide-bbox="true"
|
||||
inkscape:zoom="7.5888761"
|
||||
inkscape:cx="39.713668"
|
||||
inkscape:cy="14.182162"
|
||||
inkscape:window-x="2560"
|
||||
inkscape:window-y="22"
|
||||
inkscape:window-maximized="0"
|
||||
inkscape:current-layer="svg28"
|
||||
fit-margin-top="0"
|
||||
fit-margin-left="0"
|
||||
fit-margin-right="0"
|
||||
fit-margin-bottom="0">
|
||||
<sodipodi:guide
|
||||
position="47.649406,5.8374226"
|
||||
orientation="0,1"
|
||||
id="guide4567"
|
||||
inkscape:locked="false" />
|
||||
</sodipodi:namedview>
|
||||
<linearGradient
|
||||
id="b"
|
||||
x2="0"
|
||||
y2="45.166359"
|
||||
gradientTransform="scale(2.258318,0.44280744)"
|
||||
x1="0"
|
||||
y1="-0.28392482"
|
||||
gradientUnits="userSpaceOnUse">
|
||||
<stop
|
||||
offset="0"
|
||||
stop-color="#bbb"
|
||||
stop-opacity=".1"
|
||||
id="stop2" />
|
||||
<stop
|
||||
offset="1"
|
||||
stop-opacity=".1"
|
||||
id="stop4" />
|
||||
</linearGradient>
|
||||
<clipPath
|
||||
id="a">
|
||||
<rect
|
||||
width="102"
|
||||
height="20"
|
||||
rx="3"
|
||||
id="rect7"
|
||||
x="0"
|
||||
y="0"
|
||||
style="fill:#ffffff" />
|
||||
</clipPath>
|
||||
<path
|
||||
sodipodi:nodetypes="sccssss"
|
||||
inkscape:connector-curvature="0"
|
||||
id="path4637"
|
||||
d="M 80.55806,0 H 48 v 20 h 32.55806 c 1.87153,0 3.378212,-1.506683 3.378212,-3.378212 V 3.3782117 C 83.936272,1.5066824 82.42959,0 80.55806,0 Z"
|
||||
style="opacity:1;vector-effect:none;fill:#0055d4;fill-opacity:1;stroke:none;stroke-width:1.4740175;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers" />
|
||||
<path
|
||||
style="opacity:1;vector-effect:none;fill:#4d4d4d;fill-opacity:1;stroke:none;stroke-width:1.4740175;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers"
|
||||
d="M 3.3782117,0 H 49.936272 V 20 H 3.3782117 C 1.5066824,20 0,18.493317 0,16.621788 V 3.3782117 C 0,1.5066824 1.5066824,0 3.3782117,0 Z"
|
||||
id="rect4634"
|
||||
inkscape:connector-curvature="0"
|
||||
sodipodi:nodetypes="sccssss" />
|
||||
<rect
|
||||
ry="3.3782117"
|
||||
y="0"
|
||||
x="4.6019753e-15"
|
||||
height="20.137625"
|
||||
width="83.946869"
|
||||
id="rect4641"
|
||||
style="opacity:1;vector-effect:none;fill:url(#linearGradient837);fill-opacity:1;stroke:none;stroke-width:1.4740175;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers" />
|
||||
<rect
|
||||
style="opacity:1;vector-effect:none;fill:url(#linearGradient839);fill-opacity:1;stroke:none;stroke-width:1.4740175;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers"
|
||||
id="rect833"
|
||||
width="83.946869"
|
||||
height="20.137625"
|
||||
x="4.6019753e-15"
|
||||
y="0"
|
||||
ry="3.3782117" />
|
||||
<rect
|
||||
ry="3.3782117"
|
||||
y="0"
|
||||
x="4.6019753e-15"
|
||||
height="20.137625"
|
||||
width="83.946869"
|
||||
id="rect835"
|
||||
style="opacity:1;vector-effect:none;fill:url(#linearGradient4625);fill-opacity:1;stroke:none;stroke-width:1.4740175;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke fill markers" />
|
||||
<g
|
||||
id="g4591"
|
||||
transform="translate(6.0000004,0.1778004)">
|
||||
<text
|
||||
id="text4551"
|
||||
y="15.101547"
|
||||
x="49.939278"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:'DejaVu Sans', Verdana, Geneva, sans-serif;-inkscape-font-specification:'DejaVu Sans, Verdana, Geneva, sans-serif, Normal';font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;opacity:1;vector-effect:none;fill:#000000;fill-opacity:0.3;stroke:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
xml:space="preserve"><tspan
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:'DejaVu Sans', Verdana, Geneva, sans-serif;-inkscape-font-specification:'DejaVu Sans, Verdana, Geneva, sans-serif, Normal';font-variant-ligatures:normal;font-variant-position:normal;font-variant-caps:normal;font-variant-numeric:normal;font-variant-alternates:normal;font-feature-settings:normal;text-indent:0;text-align:start;text-decoration:none;text-decoration-line:none;text-decoration-style:solid;text-decoration-color:#000000;letter-spacing:normal;word-spacing:normal;text-transform:none;writing-mode:lr-tb;direction:ltr;text-orientation:mixed;dominant-baseline:auto;baseline-shift:baseline;text-anchor:start;white-space:normal;shape-padding:0;vector-effect:none;fill:#000000;fill-opacity:0.3;stroke:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
|
||||
y="15.101547"
|
||||
x="49.939278"
|
||||
id="tspan4549"
|
||||
sodipodi:role="line">MIT</tspan></text>
|
||||
<text
|
||||
xml:space="preserve"
|
||||
style="font-style:normal;font-weight:normal;font-size:40px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#ffffff;fill-opacity:1;stroke:none"
|
||||
x="59.774261"
|
||||
y="14.119328"
|
||||
id="text4547"><tspan
|
||||
sodipodi:role="line"
|
||||
id="tspan4545"
|
||||
x="59.774261"
|
||||
y="14.119328"
|
||||
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;font-family:'DejaVu Sans', Verdana, Geneva, sans-serif;-inkscape-font-specification:'DejaVu Sans, Verdana, Geneva, sans-serif, Normal';font-variant-ligatures:normal;font-variant-caps:normal;font-variant-numeric:normal;font-feature-settings:normal;text-align:center;writing-mode:lr-tb;text-anchor:middle;fill:#ffffff">MIT</tspan></text>
|
||||
</g>
|
||||
<g
|
||||
id="g4595"
|
||||
transform="translate(3.9474745e-7,0.1778004)">
|
||||
<text
|
||||
x="245"
|
||||
y="150"
|
||||
transform="scale(0.1)"
|
||||
textLength="370"
|
||||
id="text18"
|
||||
lengthAdjust="spacing"
|
||||
style="font-size:110px;font-family:'DejaVu Sans', Verdana, Geneva, sans-serif;text-anchor:middle;fill:#010101;fill-opacity:0.3">license</text>
|
||||
<text
|
||||
x="245"
|
||||
y="140"
|
||||
transform="scale(0.1)"
|
||||
textLength="370"
|
||||
id="text20"
|
||||
lengthAdjust="spacing"
|
||||
style="font-size:110px;font-family:'DejaVu Sans', Verdana, Geneva, sans-serif;text-anchor:middle;fill:#ffffff">license</text>
|
||||
</g>
|
||||
</svg>
|
After Width: | Height: | Size: 9.5 KiB |
24
.gitignore
vendored
Normal file
24
.gitignore
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
# ---> Vim
|
||||
# Swap
|
||||
[._]*.s[a-v][a-z]
|
||||
!*.svg # comment out if you don't need vector files
|
||||
[._]*.sw[a-p]
|
||||
[._]s[a-rt-v][a-z]
|
||||
[._]ss[a-gi-z]
|
||||
[._]sw[a-p]
|
||||
|
||||
# Session
|
||||
Session.vim
|
||||
Sessionx.vim
|
||||
|
||||
# Temporary
|
||||
.netrwhist
|
||||
*~
|
||||
# Auto-generated tag files
|
||||
tags
|
||||
# Persistent undo
|
||||
[._]*.un~
|
||||
|
||||
# ---> Ansible
|
||||
*.retry
|
||||
*.vault
|
12
.gitmodules
vendored
Normal file
12
.gitmodules
vendored
Normal file
|
@ -0,0 +1,12 @@
|
|||
[submodule "roles/base"]
|
||||
path = roles/base
|
||||
url = https://github.com/roles-ansible/ansible_role_base.git
|
||||
[submodule "roles/ranger"]
|
||||
path = roles/ranger
|
||||
url = https://github.com/roles-ansible/ansible_role_ranger.git
|
||||
[submodule "roles/bat"]
|
||||
path = roles/bat
|
||||
url = https://github.com/gantsign/ansible_role_bat.git
|
||||
[submodule "roles/dotfiles"]
|
||||
path = roles/dotfiles
|
||||
url = https://github.com/chaos-bodensee/role_dotfiles.git
|
21
LICENCE
Normal file
21
LICENCE
Normal file
|
@ -0,0 +1,21 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) 2020 L3D <l3d@c3woc.de>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
29
README.md
Normal file
29
README.md
Normal file
|
@ -0,0 +1,29 @@
|
|||
[![MIT License](https://raw.githubusercontent.com/DO1JLR/ansible_playbook_template/main/.github/license.svg?sanitize=true)](https://github.com/DO1JLR/ansible_playbook_template/blob/main/LICENSE)
|
||||
|
||||
Ansible playbook to set up ...something
|
||||
=========================================
|
||||
|
||||
This is a ansible playbook to setup ... Server and maybe some other projects. We will see...
|
||||
|
||||
|
||||
|
||||
Tipps und Tricks:
|
||||
---------
|
||||
### git submodule
|
||||
Dieses Ansible verwendet submodule. Vergesst nicht diese regelmäßig mit auszuchecken!
|
||||
```
|
||||
git config submodule.recurse true
|
||||
git submodule update --init --recursive
|
||||
```
|
||||
|
||||
### Standard Playbook
|
||||
Das standard Playook ist ``site.yml``. Womöglich sind hier andere Playbooks eingebunden...
|
||||
|
||||
### best practise Ansible-Vault:
|
||||
[docs.ansible.com/ansible/latest/user_guide/playbooks_best_practices.htm](https://docs.ansible.com/ansible/latest/user_guide/playbooks_best_practices.html#tip-for-variables-and-vaults)
|
||||
|
||||
### weitere Methide variablen ins ansible vault:
|
||||
```
|
||||
ansible-vault encrypt_string 'encrypted_secret_string_value' \
|
||||
-n string_name
|
||||
```
|
33
ansible.cfg
Normal file
33
ansible.cfg
Normal file
|
@ -0,0 +1,33 @@
|
|||
[defaults]
|
||||
inventory = ./hosts.ini
|
||||
remote_user = root
|
||||
retry_files_enabled = False
|
||||
nocows = True
|
||||
|
||||
log_path = $HOME/.ansible/ansible.log
|
||||
|
||||
forks = 20
|
||||
gathering = smart
|
||||
fact_caching = jsonfile
|
||||
fact_caching_connection = $HOME/.ansible/facts
|
||||
fact_caching_timeout = 7200
|
||||
host_key_checking = False
|
||||
callback_whitelist = profile_tasks
|
||||
stdout_callback = yaml
|
||||
|
||||
interpreter_python = /usr/bin/python3
|
||||
|
||||
# vault_password_file =./.vault
|
||||
|
||||
[ssh_connection]
|
||||
control_path = %(directory)s/%%h-%%r-%%p
|
||||
ssh_args = -o StrictHostKeyChecking=accept-new -o ControlMaster=auto -o ControlPersist=600s
|
||||
pipelining = True
|
||||
retries = 10
|
||||
|
||||
[privilege_escalation]
|
||||
become=Yes
|
||||
become_method=sudo
|
||||
become_user=root
|
||||
become_ask_pass=False
|
||||
|
2
hosts.ini
Normal file
2
hosts.ini
Normal file
|
@ -0,0 +1,2 @@
|
|||
[random_category]
|
||||
localhost ansible_connection=local
|
20
roles/README.md
Normal file
20
roles/README.md
Normal file
|
@ -0,0 +1,20 @@
|
|||
Subfolders to include ansible roles.
|
||||
============================
|
||||
|
||||
All roles should be included in this subfolder.
|
||||
This is usually done as git submodule.
|
||||
|
||||
The most common command needed for this is:
|
||||
|
||||
```
|
||||
git submodule add <public_path_to_gitrepo.git> <submodule_destination>
|
||||
```
|
||||
|
||||
A simple way to checkk out the latest commit at the main branch for all submodules is:
|
||||
```
|
||||
git submodule foreach "(git checkout $(git symbolic-ref --short refs/remotes/origin/HEAD | sed "s@^origin/@@"); git pull)"
|
||||
```
|
||||
|
||||
In abstract terms, the easiest way to do this is to treat submodules like normal git repositories after you have cloned them. This means checking out the main branch, committing things and similar actions. And when the local changes to submodule git repo are complete, add the new commit hash of submodule indein main git repo by adding, committing and pushing the entire submodule like an updated file.
|
||||
|
||||
Further information is also available at [git-scm.com/docs/git-submodule](https://git-scm.com/docs/git-submodule)
|
1
roles/base
Submodule
1
roles/base
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit dcd338825b32068e5147be59b07908393b26a7c0
|
1
roles/bat
Submodule
1
roles/bat
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 8fe5ef7651bcde31005d8e617a42e81d64616381
|
1
roles/dotfiles
Submodule
1
roles/dotfiles
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit 18581eac0d25f053d6005965618e9c180d0b5a6a
|
1
roles/ranger
Submodule
1
roles/ranger
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit a97cf9b55b1eba65a5f22fc5886cf86271a7ce2b
|
9
site.yml
Normal file
9
site.yml
Normal file
|
@ -0,0 +1,9 @@
|
|||
---
|
||||
|
||||
- name: roles for all hosts
|
||||
hosts: all
|
||||
roles:
|
||||
- { role: base, tags: [default,packages,base]}
|
||||
- { role: ranger, tags: [packages,ranger]}
|
||||
- { role: bat, tags: [packages,bat], when: [ansible_os_family == 'Debian']}
|
||||
- { role: dotfiles, tags: [default,dotfiles]}
|
Loading…
Reference in a new issue