Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
DO1JLR committed Dec 12, 2020
0 parents commit 565b57a
Show file tree
Hide file tree
Showing 14 changed files with 375 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# These are supported funding model platforms

github: [do1jlr]
liberapay: L3D
217 changes: 217 additions & 0 deletions .github/license.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions .gitignore
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
12 changes: 12 additions & 0 deletions .gitmodules
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
21 changes: 21 additions & 0 deletions LICENCE
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.
29 changes: 29 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -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 changes: 33 additions & 0 deletions ansible.cfg
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

2 changes: 2 additions & 0 deletions hosts.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[random_category]
localhost ansible_connection=local
20 changes: 20 additions & 0 deletions roles/README.md
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)
1 change: 1 addition & 0 deletions roles/base
Submodule base added at dcd338
1 change: 1 addition & 0 deletions roles/bat
Submodule bat added at 8fe5ef
1 change: 1 addition & 0 deletions roles/dotfiles
Submodule dotfiles added at 18581e
1 change: 1 addition & 0 deletions roles/ranger
Submodule ranger added at a97cf9
9 changes: 9 additions & 0 deletions site.yml
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]}

0 comments on commit 565b57a

Please sign in to comment.