generated from DO1JLR/ansible_playbook_template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 565b57a
Showing
14 changed files
with
375 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# These are supported funding model platforms | ||
|
||
github: [do1jlr] | ||
liberapay: L3D |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020 L3D <[email protected]> | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
[](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 | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[random_category] | ||
localhost ansible_connection=local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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]} |