This commit is contained in:
Christoph 2023-04-06 11:53:54 +02:00
parent 912ec16cdb
commit 12c86849c2
59 changed files with 1065 additions and 102 deletions

View File

@ -5,4 +5,4 @@
roles: roles:
- ansible_dependencies-bullseye - ansible_dependencies-bullseye
- ansible_user - ansible_user_debian

View File

@ -12,4 +12,4 @@
roles: roles:
- ansible_dependencies-bullseye - ansible_dependencies-bullseye
- ansible_user - ansible_user_debian

View File

@ -0,0 +1,8 @@
---
- hosts: initial_setup
gather_facts: false
roles:
- ansible_dependencies-centos-7
- ansible_user_centos

View File

@ -0,0 +1,15 @@
---
- hosts: initial_setup
remote_user: root
become: false
gather_facts: false
vars_prompt:
- name: ansible_ssh_pass
prompt: "Give root's password here"
roles:
- ansible_dependencies-centos-7
- ansible_user_centos

View File

@ -0,0 +1,29 @@
# ~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
if [ -d "$HOME/bin/admin-stuff" ] ; then
PATH="$HOME/bin/admin-stuff:$PATH"
fi
# this is for the midnight-commander
# to become the last directory the midnight commander was in
# as the current directory when leaving the midnight commander
#
if [ -f "/etc/profile.d/mc.sh" ]; then
source /etc/profile.d/mc.sh
elif [ -f "/usr/share/mc/bin/mc.sh" ]; then
source /usr/share/mc/bin/mc.sh
elif [ -f "/usr/lib/mc/bin/mc.sh" ] ; then
source /usr/lib/mc/bin/mc.sh
fi
mesg n

View File

@ -0,0 +1,27 @@
# ~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
if [ -d "$HOME/bin/admin-stuff" ] ; then
PATH="$HOME/bin/admin-stuff:$PATH"
fi
# this is for the midnight-commander
# to become the last directory the midnight commander was in
# as the current directory when leaving the midnight commander
#
if [ -f "/etc/profile.d/mc.sh" ]; then
source /etc/profile.d/mc.sh
elif [ -f "/usr/share/mc/bin/mc.sh" ]; then
source /usr/share/mc/bin/mc.sh
elif [ -f "/usr/lib/mc/bin/mc.sh" ] ; then
source /usr/lib/mc/bin/mc.sh
fi

View File

@ -0,0 +1,27 @@
# ~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
if [ -d "$HOME/bin/admin-stuff" ] ; then
PATH="$HOME/bin/admin-stuff:$PATH"
fi
# this is for the midnight-commander
# to become the last directory the midnight commander was in
# as the current directory when leaving the midnight commander
#
if [ -f "/etc/profile.d/mc.sh" ]; then
source /etc/profile.d/mc.sh
elif [ -f "/usr/share/mc/bin/mc.sh" ]; then
source /usr/share/mc/bin/mc.sh
elif [ -f "/usr/lib/mc/bin/mc.sh" ] ; then
source /usr/lib/mc/bin/mc.sh
fi

View File

@ -25,6 +25,9 @@ fi
# to become the last directory the midnight commander was in # to become the last directory the midnight commander was in
# as the current directory when leaving the midnight commander # as the current directory when leaving the midnight commander
# #
#. /usr/lib/mc/bin/mc.sh if [ -f "/usr/share/mc/bin/mc.sh" ]; then
. /usr/share/mc/bin/mc.sh source /usr/share/mc/bin/mc.sh
elif [ -f "/usr/lib/mc/bin/mc.sh" ] ; then
source /usr/lib/mc/bin/mc.sh
fi

View File

@ -0,0 +1,29 @@
# ~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
if [ -d "$HOME/bin/admin-stuff" ] ; then
PATH="$HOME/bin/admin-stuff:$PATH"
fi
# this is for the midnight-commander
# to become the last directory the midnight commander was in
# as the current directory when leaving the midnight commander
#
if [ -f "/etc/profile.d/mc.sh" ]; then
source /etc/profile.d/mc.sh
elif [ -f "/usr/share/mc/bin/mc.sh" ]; then
source /usr/share/mc/bin/mc.sh
elif [ -f "/usr/lib/mc/bin/mc.sh" ] ; then
source /usr/lib/mc/bin/mc.sh
fi
mesg n

View File

@ -1,8 +1,18 @@
# ~/.profile: executed by Bourne-compatible login shells. # ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# exists.
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
if [ "$BASH" ]; then # the default umask is set in /etc/profile; for setting the umask
if [ -f ~/.bashrc ]; then # for ssh logins, install and configure the libpam-umask package.
. ~/.bashrc #umask 022
# if running bash
if [ -n "$BASH_VERSION" ]; then
# include .bashrc if it exists
if [ -f "$HOME/.bashrc" ]; then
. "$HOME/.bashrc"
fi fi
fi fi
@ -10,15 +20,15 @@ fi
if [ -d "$HOME/bin" ] ; then if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH" PATH="$HOME/bin:$PATH"
fi fi
if [ -d "$HOME/bin/admin-stuff" ] ; then
PATH="$HOME/bin/admin-stuff:$PATH"
fi
# this is for the midnight-commander # this is for the midnight-commander
# to become the last directory the midnight commander was in # to become the last directory the midnight commander was in
# as the current directory when leaving the midnight commander # as the current directory when leaving the midnight commander
# #
# . /usr/lib/mc/bin/mc.sh if [ -f "/usr/share/mc/bin/mc.sh" ]; then
. /usr/share/mc/bin/mc.sh source /usr/share/mc/bin/mc.sh
elif [ -f "/usr/lib/mc/bin/mc.sh" ] ; then
source /usr/lib/mc/bin/mc.sh
fi
mesg n mesg n

View File

@ -0,0 +1,27 @@
# ~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
if [ -d "$HOME/bin/admin-stuff" ] ; then
PATH="$HOME/bin/admin-stuff:$PATH"
fi
# this is for the midnight-commander
# to become the last directory the midnight commander was in
# as the current directory when leaving the midnight commander
#
if [ -f "/etc/profile.d/mc.sh" ]; then
source /etc/profile.d/mc.sh
elif [ -f "/usr/share/mc/bin/mc.sh" ]; then
source /usr/share/mc/bin/mc.sh
elif [ -f "/usr/lib/mc/bin/mc.sh" ] ; then
source /usr/lib/mc/bin/mc.sh
fi

View File

@ -0,0 +1,27 @@
# ~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
# set PATH so it includes user's private bin if it exists
if [ -d "$HOME/bin" ] ; then
PATH="$HOME/bin:$PATH"
fi
if [ -d "$HOME/bin/admin-stuff" ] ; then
PATH="$HOME/bin/admin-stuff:$PATH"
fi
# this is for the midnight-commander
# to become the last directory the midnight commander was in
# as the current directory when leaving the midnight commander
#
if [ -f "/etc/profile.d/mc.sh" ]; then
source /etc/profile.d/mc.sh
elif [ -f "/usr/share/mc/bin/mc.sh" ]; then
source /usr/share/mc/bin/mc.sh
elif [ -f "/usr/lib/mc/bin/mc.sh" ] ; then
source /usr/lib/mc/bin/mc.sh
fi

View File

@ -840,11 +840,15 @@ apt_install_postgresql_pkgs: false
apt_postgresql_pkgs: apt_postgresql_pkgs:
- postgresql - postgresql
apt_install_bind9_packages: false install_bind_packages: false
apt_bind9_pkgs: apt_bind_pkgs:
- bind9 - bind9
apt_install_lxc_host_pkgs: false yum_bind_pks:
- bind
install_lxc_host_pkgs: false
apt_lxc_host_pkgs: apt_lxc_host_pkgs:
- bridge-utils - bridge-utils
- lxc - lxc
@ -854,7 +858,16 @@ apt_lxc_host_pkgs:
- debootstrap - debootstrap
- ntp - ntp
apt_install_kvm_host_pkgs: false yum_lxc_host_pkgs:
- bridge-utils
- lxc
- lxc-templates
- python36-lxc
- debootstrap
- ntp
install_kvm_host_pkgs: false
apt_kvm_host_pkgs: apt_kvm_host_pkgs:
- lvm2 - lvm2
- bridge-utils - bridge-utils
@ -893,6 +906,136 @@ microcode_package:
- amd64-microcode - amd64-microcode
# ---
# vars used by yum.yml
# ---
yum_install_state: latest
yum_ansible_dependencies:
- ca-certificates
- dbus
- redhat-lsb-core
- mc
- net-tools
- openssl
- python3
- sudo
- vim
yum_base_install_centos_7:
- redhat-lsb-core
- ca-certificates
- git
- iproute
- mc
- net-tools
- bind-utils
- openssl
- python2
- python3
- sudo
- vim
- yum-utils
yum_initial_install_centos_7:
- cryptsetup
- dbus
- openssh-server
- bash
- bash-completion
- vim
- vim-common
- mc
- screen
- tmux
- cronie
- bc
- figlet
- sudo
- rsync
- dselect
- iputils
- zip
- unzip
- bzip2
- arj
- mlocate
- curl
- gawk
- mawk
- lynx
- links
- w3m
- ctags
- file
- coreutils
- moreutils
- less
- sipcalc
- psmisc
- whois
- gettext
- gettext-devel
- debian-keyring
- patch
- patchutils
- recode
- recode-devel
- sharutils
- perl
- perl-devel
- readline
- readline-devel
- libtermkey
- libtermkey-devel
- perl-Time-Duration-Parse
- perl-DateTime
- perl-libwww-perl
- pcre
- pcre2
- perl-IO-Compress
- re2c
- util-linux
- parted
- lshw
- gdisk
- smartmontools
- tcpdump
- telnet
- unhide
- lsof
- hdparm
- groff
- bridge-utils
- ethtool
- nwipe
- iperf
- mtr
- iptraf
- wget
- logrotate
- rsyslog
- haveged
- rdate
- ntpdate
- man
- groff
- iptables
- ShellCheck
- ftp
- htop
- net-tools
- attr
- acl
- quota
- quotatool
- needrestart
- socat
- zsh
- lua
- btrfs-progs
# --- # ---
# vars used by tor.yml # vars used by tor.yml
# --- # ---
@ -1893,6 +2036,33 @@ samba_cronjob_permissions:
job: "/root/bin/samba/set_permissions_samba_shares.sh" job: "/root/bin/samba/set_permissions_samba_shares.sh"
# ==========
# vars used by roles/common/tasks/systemd-services.yml
# ==========
# Take care that if these services are installed, they are running and
# start automatically after boot.
#
debian_services_active_and_started:
- bind
- cron
- haveged
- ntp
- redis-server
- ssh
- tor
redhat_services_active_and_started:
- crond
- haveged
- named
- ntpd
- redis
- sshd
- tor
# ============================== # ==============================

View File

@ -51,7 +51,7 @@
# vars used by roles/common/tasks/caching-nameserver.yml # vars used by roles/common/tasks/caching-nameserver.yml
# --- # ---
apt_install_bind9_packages: true install_bind_packages: true
# --- # ---

View File

@ -0,0 +1,70 @@
---
# ---
# vars used by roles/ansible_dependencies
# ---
# ---
# vars used by roles/ansible_user
# ---
# ---
# vars used by roles/common/tasks/basic.yml
# ---
# ---
# vars used by roles/common/tasks/sshd.yml
# ---
# ---
# vars used by apt.yml
# ---
# ---
# vars used by roles/common/tasks/users.yml
# ---
# ---
# vars used by roles/common/tasks/users-systemfiles.yml
# ---
# ---
# vars used by roles/common/tasks/webadmin-user.yml
# ---
# ---
# vars used by roles/common/tasks/sudoers.yml
# ---
#
# see: roles/common/tasks/vars
# ---
# vars used by roles/common/tasks/caching-nameserver.yml
# ---
apt_install_bind9_packages: true
# ---
# vars used by roles/common/tasks/git.yml
# ---
#
# see: roles/common/tasks/vars
# ==============================
# ---
# vars used by scripts/reset_root_passwd.yml
# ---

View File

@ -223,7 +223,7 @@ sudo_users:
# vars used by roles/common/tasks/caching-nameserver.yml # vars used by roles/common/tasks/caching-nameserver.yml
# --- # ---
apt_install_bind9_packages: true install_bind_packages: true
bind9_gateway_acl: bind9_gateway_acl:
- local-net: - local-net:

View File

@ -91,7 +91,7 @@ sudo_users:
# vars used by roles/common/tasks/caching-nameserver.yml # vars used by roles/common/tasks/caching-nameserver.yml
# --- # ---
apt_install_bind9_packages: true install_bind_packages: true
# --- # ---
# vars used by roles/common/tasks/git.yml # vars used by roles/common/tasks/git.yml

View File

@ -222,6 +222,10 @@ samba_user:
- buero - buero
- verwaltung - verwaltung
password: 'fx9j/3X-thPr' password: 'fx9j/3X-thPr'
- name: julius-e
groups:
- buero
password: '2/kcx3jju-tr'
- name: leonie - name: leonie
groups: groups:
- buero - buero

View File

@ -253,6 +253,9 @@ samba_groups:
- name: altlasten - name: altlasten
group_id: 1510 group_id: 1510
- name: administration
group_id: 1610
samba_user: samba_user:
@ -463,6 +466,7 @@ samba_user:
# Heike Müller # Heike Müller
- name : h.mueller - name : h.mueller
groups: groups:
- administration
- buero - buero
- team - team
password: 'VT7/n5hHy-Av' password: 'VT7/n5hHy-Av'
@ -470,6 +474,7 @@ samba_user:
# Jana König # Jana König
- name : j.koenig - name : j.koenig
groups: groups:
- administration
- archiv - archiv
- ausstellungen - ausstellungen
- buero - buero
@ -493,6 +498,7 @@ samba_user:
# Jorinde Splettstößer # Jorinde Splettstößer
- name : j.splettstoesser - name : j.splettstoesser
groups: groups:
- administration
- archiv - archiv
- ausstellungen - ausstellungen
- buero - buero
@ -517,6 +523,7 @@ samba_user:
# Natalie Bayer # Natalie Bayer
- name : n.bayer - name : n.bayer
groups: groups:
- administration
- altlasten - altlasten
- archiv - archiv
- ausstellungen - ausstellungen
@ -651,6 +658,15 @@ remove_samba_users:
samba_shares: samba_shares:
- name: Administration
comment: Administration auf Fileserver
path: /data/samba/FHXB-Server/Administration
group_valid_users: administration
group_write_list: administration
file_create_mask: !!str 660
dir_create_mask: !!str 2770
vfs_object_recycle: true
- name: Altlasten - name: Altlasten
comment: Altlasten auf Fileserver comment: Altlasten auf Fileserver
path: /data/samba/FHXB-Server/Altlasten path: /data/samba/FHXB-Server/Altlasten

View File

@ -339,7 +339,7 @@ sudo_users:
# vars used by roles/common/tasks/caching-nameserver.yml # vars used by roles/common/tasks/caching-nameserver.yml
# --- # ---
apt_install_bind9_packages: true install_bind_packages: true
bind9_gateway_acl: bind9_gateway_acl:

View File

@ -215,7 +215,7 @@ sudo_users:
# vars used by roles/common/tasks/caching-nameserver.yml # vars used by roles/common/tasks/caching-nameserver.yml
# --- # ---
apt_install_bind9_packages: true install_bind_packages: true
bind9_gateway_acl: bind9_gateway_acl:
- local-net: - local-net:

View File

@ -150,7 +150,7 @@ sudo_users:
# vars used by roles/common/tasks/caching-nameserver.yml # vars used by roles/common/tasks/caching-nameserver.yml
# --- # ---
apt_install_bind9_packages: true install_bind_packages: true
bind9_gateway_acl: bind9_gateway_acl:
- local-net: - local-net:

View File

@ -385,7 +385,7 @@ sudo_users:
# vars used by roles/common/tasks/caching-nameserver.yml # vars used by roles/common/tasks/caching-nameserver.yml
# --- # ---
apt_install_bind9_packages: true install_bind_packages: true
bind9_gateway_acl: bind9_gateway_acl:
- local-net: - local-net:

View File

@ -101,7 +101,7 @@ sudo_users:
# vars used by roles/common/tasks/caching-nameserver.yml # vars used by roles/common/tasks/caching-nameserver.yml
# --- # ---
apt_install_bind9_packages: true install_bind_packages: true
bind9_gateway_listen_on_v6: bind9_gateway_listen_on_v6:
- none - none

View File

@ -114,7 +114,7 @@ sudo_users:
# vars used by roles/common/tasks/caching-nameserver.yml # vars used by roles/common/tasks/caching-nameserver.yml
# --- # ---
apt_install_bind9_packages: true install_bind_packages: true
bind9_gateway_acl: bind9_gateway_acl:

View File

@ -224,7 +224,7 @@ sudo_users:
# vars used by roles/common/tasks/caching-nameserver.yml # vars used by roles/common/tasks/caching-nameserver.yml
# --- # ---
apt_install_bind9_packages: true install_bind_packages: true
bind9_gateway_acl: bind9_gateway_acl:
- local-net: - local-net:

View File

@ -91,7 +91,7 @@ sudo_users:
# vars used by roles/common/tasks/caching-nameserver.yml # vars used by roles/common/tasks/caching-nameserver.yml
# --- # ---
apt_install_bind9_packages: true install_bind_packages: true
bind9_gateway_listen_on_v6: bind9_gateway_listen_on_v6:
- none - none

View File

@ -165,7 +165,7 @@ sudo_users:
# vars used by roles/common/tasks/caching-nameserver.yml # vars used by roles/common/tasks/caching-nameserver.yml
# --- # ---
apt_install_bind9_packages: true install_bind_packages: true
bind9_gateway_acl: bind9_gateway_acl:

View File

@ -219,7 +219,7 @@ sudo_users:
# vars used by roles/common/tasks/caching-nameserver.yml # vars used by roles/common/tasks/caching-nameserver.yml
# --- # ---
apt_install_bind9_packages: true install_bind_packages: true
bind9_gateway_acl: bind9_gateway_acl:
- local-net: - local-net:

View File

@ -218,7 +218,7 @@ sudo_users:
# vars used by roles/common/tasks/caching-nameserver.yml # vars used by roles/common/tasks/caching-nameserver.yml
# --- # ---
apt_install_bind9_packages: true install_bind_packages: true
# --- # ---

View File

@ -150,10 +150,10 @@ copy_plain_files_postfwd_host_specific:
# --- # ---
hostname: mail.cadus.org hostname: mail.cadus.org
ipv4_address: 46.4.25.245 ipv4_address: 135.181.22.153
ipv6_address: 2a01:4f8:221:3b4e::245 ipv6_address: 2a01:4f9:4b:46d1::153
admin_email: admin@cadus.org admin_email: it@cadus.org
is_relay_host: !!str "false" is_relay_host: !!str "false"
db_in_use: !!str "true" db_in_use: !!str "true"
@ -165,6 +165,7 @@ postfix_db_name: postfix
postfix_db_user: postfix postfix_db_user: postfix
#postfix_db_host: #postfix_db_host:
postfix_db_pass: T3CJnFMJNX9wmhNs postfix_db_pass: T3CJnFMJNX9wmhNs
mysql_credentials: !!str "-u root -S /run/mysqld/mysqld.sock"
# install_amavis.conf # install_amavis.conf
# #

View File

@ -150,8 +150,8 @@ copy_plain_files_postfwd_host_specific:
# --- # ---
hostname: mail.cadus.org hostname: mail.cadus.org
ipv4_address: 46.4.25.245 ipv4_address: 135.181.22.153
ipv6_address: 2a01:4f8:221:3b4e::245 ipv6_address: 2a01:4f9:4b:46d1::153
admin_email: admin@cadus.org admin_email: admin@cadus.org
is_relay_host: !!str "false" is_relay_host: !!str "false"

View File

@ -307,7 +307,7 @@ samba_user:
- buero - buero
- intern - intern
- verwaltung - verwaltung
password: password: '20-buch_holz-20'
- name: schmidt - name: schmidt
groups: groups:
- intern - intern
@ -360,15 +360,15 @@ samba_shares:
guest_ok: !!str no guest_ok: !!str no
browseable: !!str no browseable: !!str no
valid_users: '%S' valid_users: '%S'
file_create_mask: '600' file_create_mask: !!str 600
dir_create_mask: '700' dir_create_mask: !!str 700
- name: Buero - name: Buero
path: /data/samba/shares/Buero path: /data/samba/shares/Buero
group_valid_users: intern group_valid_users: intern
group_write_list: intern group_write_list: intern
file_create_mask: 664 file_create_mask: !!str 664
dir_create_mask: 2775 dir_create_mask: !!str 2775
vfs_object_recycle: true vfs_object_recycle: true
recycle_path: recycle recycle_path: recycle
@ -376,8 +376,8 @@ samba_shares:
path: /data/samba/shares/Verwaltung path: /data/samba/shares/Verwaltung
group_valid_users: verwaltung group_valid_users: verwaltung
group_write_list: verwaltung group_write_list: verwaltung
file_create_mask: 660 file_create_mask: !!str 660
dir_create_mask: 2770 dir_create_mask: !!str 2770
vfs_object_recycle: true vfs_object_recycle: true
recycle_path: recycle recycle_path: recycle
@ -385,8 +385,8 @@ samba_shares:
path: /data/samba/shares/Scans_schnell path: /data/samba/shares/Scans_schnell
group_valid_users: intern group_valid_users: intern
group_write_list: intern group_write_list: intern
file_create_mask: '664' file_create_mask: !!str 664
dir_create_mask: 2775 dir_create_mask: !!str 2775
vfs_object_recycle: true vfs_object_recycle: true
recycle_path: recycle recycle_path: recycle
@ -394,8 +394,8 @@ samba_shares:
path: /data/samba/shares/Hoffmann-Elberling path: /data/samba/shares/Hoffmann-Elberling
group_valid_users: hoffmann-elberling group_valid_users: hoffmann-elberling
group_write_list: hoffmann-elberling group_write_list: hoffmann-elberling
file_create_mask: '664' file_create_mask: !!str 664
dir_create_mask: 2775 dir_create_mask: !!str 2775
vfs_object_recycle: true vfs_object_recycle: true
recycle_path: recycle recycle_path: recycle
@ -403,8 +403,8 @@ samba_shares:
path: /data/samba/shares/Gubitz-Partner path: /data/samba/shares/Gubitz-Partner
group_valid_users: gubitz-partner group_valid_users: gubitz-partner
group_write_list: gubitz-partner group_write_list: gubitz-partner
file_create_mask: '664' file_create_mask: !!str 664
dir_create_mask: 2775 dir_create_mask: !!str 2775
vfs_object_recycle: true vfs_object_recycle: true
recycle_path: recycle recycle_path: recycle
@ -412,8 +412,8 @@ samba_shares:
path: /data/samba/shares/Gubitz-Backup path: /data/samba/shares/Gubitz-Backup
group_valid_users: gubitz group_valid_users: gubitz
group_write_list: gubitz group_write_list: gubitz
file_create_mask: 660 file_create_mask: !!str 660
dir_create_mask: 2770 dir_create_mask: !!str 2770
vfs_object_recycle: true vfs_object_recycle: true
recycle_path: recycle recycle_path: recycle
@ -422,8 +422,8 @@ samba_shares:
path: /data/samba/shares/WinServer2016-Backup path: /data/samba/shares/WinServer2016-Backup
group_valid_users: {} group_valid_users: {}
group_write_list: {} group_write_list: {}
file_create_mask: 664 file_create_mask: !!str 664
dir_create_mask: 2775 dir_create_mask: !!str 2775
guest_ok: !!str yes guest_ok: !!str yes
vfs_object_recycle: true vfs_object_recycle: true
recycle_path: {} recycle_path: {}
@ -433,8 +433,8 @@ samba_shares:
path: /data/samba/shares/Advoware-Backup path: /data/samba/shares/Advoware-Backup
group_valid_users: back group_valid_users: back
group_write_list: back group_write_list: back
file_create_mask: 664 file_create_mask: !!str 664
dir_create_mask: 2775 dir_create_mask: !!str 2775
guest_ok: !!str yes guest_ok: !!str yes
vfs_object_recycle: true vfs_object_recycle: true

View File

@ -198,6 +198,12 @@ samba_user:
- beratung - beratung
password: 'D1dPWdPvopp4!' password: 'D1dPWdPvopp4!'
- name: anika
groups:
- buero
- beratung
password: '4n1k4*adb_23'
- name: anna - name: anna
groups: groups:
- buero - buero
@ -475,7 +481,7 @@ samba_shares:
writeable: !!str no writeable: !!str no
guest_ok: !!str no guest_ok: !!str no
file_create_mask: !!str 0664 file_create_mask: !!str 0664
dir_create_mask: !!str 2775 dir_create_mask: !!str 0755
vfs_object_recycle: false vfs_object_recycle: false

42
hosts
View File

@ -9,6 +9,10 @@
#schleuder3.so36.net ansible_user=ckubu #schleuder3.so36.net ansible_user=ckubu
#site36.net ansible_user=ckubu #site36.net ansible_user=ckubu
#web.so36.net ansible_user=ckubu #web.so36.net ansible_user=ckubu
[so36_server]
#kvm05.so36.net ansible_ssh_user=ckubu ansible_ssh_port=1036
#kvm13.so36.net ansible_ssh_user=ckubu ansible_ssh_port=1036
[dns_sinma] [dns_sinma]
@ -52,6 +56,9 @@ gw-replacement.local.netz
gw-replacement2.local.netz gw-replacement2.local.netz
gw-replacement3.local.netz gw-replacement3.local.netz
kvm-ipa.local.netz
file-ipa.local.netz
k1371.dyndns.org k1371.dyndns.org
ga-st-gw-ersatz.ga.netz ga-st-gw-ersatz.ga.netz
@ -124,8 +131,8 @@ o20.oopen.de
o21.oopen.de o21.oopen.de
o31.oopen.de o31.oopen.de
mail.cadus.org mail.cadus.org
mail-neu.cadus.org
web.cadus.org web.cadus.org
wiki.cadus.org
o22.oopen.de o22.oopen.de
oolm-db.oopen.de oolm-db.oopen.de
@ -199,7 +206,6 @@ lxc-host-kb.anw-kb.netz
[initial_setup] [initial_setup]
# --- # ---
# - Warenform Server # - Warenform Server
# --- # ---
@ -278,8 +284,8 @@ o20.oopen.de
o21.oopen.de o21.oopen.de
o31.oopen.de o31.oopen.de
mail.cadus.org mail.cadus.org
mail-neu.cadus.org
web.cadus.org web.cadus.org
wiki.cadus.org
# - o22.oopen.de # - o22.oopen.de
o22.oopen.de o22.oopen.de
@ -367,6 +373,9 @@ gw-replacement.local.netz
gw-replacement2.local.netz gw-replacement2.local.netz
gw-replacement3.local.netz gw-replacement3.local.netz
kvm-ipa.local.netz
file-ipa.local.netz
# 123Comics # 123Comics
gw-123.oopen.de gw-123.oopen.de
@ -455,7 +464,6 @@ devel-php.wf.netz
devel-todo.wf.netz devel-todo.wf.netz
devel-wiki.wf.netz devel-wiki.wf.netz
[apache2_webserver] [apache2_webserver]
# --- # ---
@ -485,8 +493,8 @@ o20.oopen.de
# o21.oopen.de # o21.oopen.de
# o31.oopen.de # o31.oopen.de
web.cadus.org web.cadus.org
wiki.cadus.org
mail.cadus.org mail.cadus.org
mail-neu.cadus.org
# o22.oopen.de # o22.oopen.de
oolm-shop-dev.oopen.de oolm-shop-dev.oopen.de
@ -531,6 +539,8 @@ cl-test.oopen.de
# O.OPEN office network # O.OPEN office network
# --- # ---
file-ipa.local.netz
# - GA - Gemeinschaft Altensclirf # - GA - Gemeinschaft Altensclirf
ga-st-mail.ga.netz ga-st-mail.ga.netz
ga-al-ws1.ga.netz ga-al-ws1.ga.netz
@ -643,6 +653,9 @@ o26.oopen.de
# o30.oopen.de - AK Server Nextcloud/Jitsi Meet # o30.oopen.de - AK Server Nextcloud/Jitsi Meet
meet.akweb.de meet.akweb.de
# o31.oopen.de
wiki.cadus.org
# etventure # etventure
o32.oopen.de o32.oopen.de
@ -678,6 +691,7 @@ o13-web.oopen.de
# o21.oopen.de # o21.oopen.de
# o31.oopen.de # o31.oopen.de
web.cadus.org web.cadus.org
wiki.cadus.org
# o20.oopen.de (srv-cityslang.cityslang.com) # o20.oopen.de (srv-cityslang.cityslang.com)
o20.oopen.de o20.oopen.de
@ -728,7 +742,6 @@ test.mx.oopen.de
# o21.oopen.de # o21.oopen.de
# o31.oopen.de # o31.oopen.de
mail.cadus.org mail.cadus.org
mail-neu.cadus.org
# o27.oopen.de # o27.oopen.de
mail.faire-mobilitaet.de mail.faire-mobilitaet.de
@ -757,6 +770,12 @@ ga-st-mail.ga.netz
mx.warenform.de mx.warenform.de
lists.mx.warenform.de lists.mx.warenform.de
# ---
# so36.net
# ---
#rage.so36.net ansible_ssh_user=ckubu ansible_ssh_port=1036
[sympa_list_server] [sympa_list_server]
@ -833,8 +852,8 @@ o20.oopen.de
# o21.oopen.de # o21.oopen.de
web.cadus.org web.cadus.org
wiki.cadus.org
mail.cadus.org mail.cadus.org
mail-neu.cadus.org
# o22.oopen.de # o22.oopen.de
oolm-db-dev.oopen.de oolm-db-dev.oopen.de
@ -992,7 +1011,6 @@ nscache.oopen.de
# o21.oopen.de # o21.oopen.de
# o31.oopen.de # o31.oopen.de
mail.cadus.org mail.cadus.org
mail-neu.cadus.org
o22.oopen.de o22.oopen.de
@ -1014,6 +1032,8 @@ b.mx.oopen.de
# - GA - Gemeinschaft Altensclirf # - GA - Gemeinschaft Altensclirf
ga-st-mail.ga.netz ga-st-mail.ga.netz
file-ipa.local.netz
# --- # ---
# Warenform # Warenform
@ -1161,6 +1181,8 @@ lxc-host-kb.anw-kb.netz
# O.OPEN office network # O.OPEN office network
# --- # ---
file-ipa.local.netz
bbb-server.b3-bornim.netz bbb-server.b3-bornim.netz
file-ah.kanzlei-kiel.netz file-ah.kanzlei-kiel.netz
file-km.anw-km.netz file-km.anw-km.netz
@ -1218,8 +1240,8 @@ meet2.oopen.de
# - o21.oopen.de # - o21.oopen.de
# - o31.oopen.de # - o31.oopen.de
mail.cadus.org mail.cadus.org
mail-neu.cadus.org
web.cadus.org web.cadus.org
wiki.cadus.org
# - o22.oopen.de # - o22.oopen.de
oolm-db.oopen.de oolm-db.oopen.de
@ -1385,8 +1407,8 @@ o20.oopen.de
o21.oopen.de o21.oopen.de
o31.oopen.de o31.oopen.de
mail.cadus.org mail.cadus.org
mail-neu.cadus.org
web.cadus.org web.cadus.org
wiki.cadus.org
# - o22.oopen.de # - o22.oopen.de
o22.oopen.de o22.oopen.de

View File

@ -0,0 +1,24 @@
---
- name: (ansible_dependencies-centos-7) System updates
yum:
name: '*'
state: latest
update_cache: yes
#cache_valid_time: 3600
tags:
- yum-update
- name: Ensure python2 is present (This is necessary for ansible to work properly)
raw: test -e /usr/bin/python2 || (yum -y install python2)
- name: Ensure python3 is present (This is necessary for ansible to work properly)
raw: test -e /usr/bin/python3 || (yum install -y python3)
- name: yum install ansible dependencies
yum:
name: "{{ yum_ansible_dependencies }}"
state: "{{ yum_install_state }}"
tags:
- ansible-dependencies

View File

@ -0,0 +1,35 @@
---
- name: Ensure remote users for ansible exists
user:
name: '{{ item.name }}'
state: present
uid: '{{ item.user_id | default(omit) }}'
#group: '{{ item.name | default(omit) }}'
shell: '{{ item.shell|d("/bin/bash") }}'
password: "{{ item.password }}"
update_password: on_create
with_items: '{{ ansible_remote_user }}'
tags:
- ansible-remote-user
- name: Ensure ansible user is part of sudo group
user:
name: "{{ item.name }}"
groups: wheel
append: yes
with_items: "{{ ansible_remote_user }}"
tags:
- sudo-users
- name: Ensure authorized_key files are present
authorized_key:
user: "{{ item.0.name }}"
key: "{{ item.1 }}"
state: present
with_subelements:
- '{{ ansible_remote_user }}'
- ssh_keys
tags:
- authorized_key

View File

@ -62,7 +62,7 @@ curl_check_host=127.0.0.1
# - Example: # - Example:
# - php_versions="5.4 5.6 7.0 7.1" # - php_versions="5.4 5.6 7.0 7.1"
# - # -
php_versions="7.4" php_versions="8.1"
# - If PHP-FPM's ping.path setting does not match ping-$php_major_version, # - If PHP-FPM's ping.path setting does not match ping-$php_major_version,
# - set the value given in your ping.path setting here. Give ping_path also # - set the value given in your ping.path setting here. Give ping_path also

View File

@ -74,7 +74,7 @@ check_website=false
# - mysql_credential_args="--defaults-file=/etc/mysql/debian.cnf" (Debian default) # - mysql_credential_args="--defaults-file=/etc/mysql/debian.cnf" (Debian default)
# - mysql_credential_args="--defaults-file=/usr/local/mysql/sys-maint.cnf" # - mysql_credential_args="--defaults-file=/usr/local/mysql/sys-maint.cnf"
# - # -
mysql_credential_args="--login-path=local" mysql_credential_args="--defaults-file=/etc/mysql/debian.cnf"
# - Additional Settings for check_php_fpm # - Additional Settings for check_php_fpm
@ -93,7 +93,7 @@ curl_check_host=127.0.0.1
# - Example: # - Example:
# - php_versions="5.4 5.6 7.0 7.1" # - php_versions="5.4 5.6 7.0 7.1"
# - # -
php_versions="7.4" php_versions="8.1"
# - If PHP-FPM's ping.path setting does not match ping-$php_major_version, # - If PHP-FPM's ping.path setting does not match ping-$php_major_version,
# - set the value given in your ping.path setting here. Give ping_path also # - set the value given in your ping.path setting here. Give ping_path also

View File

@ -62,7 +62,7 @@ curl_check_host=127.0.0.1
# - Example: # - Example:
# - php_versions="5.4 5.6 7.0 7.1" # - php_versions="5.4 5.6 7.0 7.1"
# - # -
php_versions="7.4" php_versions="8.1"
# - If PHP-FPM's ping.path setting does not match ping-$php_major_version, # - If PHP-FPM's ping.path setting does not match ping-$php_major_version,
# - set the value given in your ping.path setting here. Give ping_path also # - set the value given in your ping.path setting here. Give ping_path also

View File

@ -93,7 +93,7 @@ curl_check_host=127.0.0.1
# - Example: # - Example:
# - php_versions="5.4 5.6 7.0 7.1" # - php_versions="5.4 5.6 7.0 7.1"
# - # -
php_versions="7.4" php_versions="8.1"
# - If PHP-FPM's ping.path setting does not match ping-$php_major_version, # - If PHP-FPM's ping.path setting does not match ping-$php_major_version,
# - set the value given in your ping.path setting here. Give ping_path also # - set the value given in your ping.path setting here. Give ping_path also

View File

@ -74,7 +74,7 @@ check_website=false
# - mysql_credential_args="--defaults-file=/etc/mysql/debian.cnf" (Debian default) # - mysql_credential_args="--defaults-file=/etc/mysql/debian.cnf" (Debian default)
# - mysql_credential_args="--defaults-file=/usr/local/mysql/sys-maint.cnf" # - mysql_credential_args="--defaults-file=/usr/local/mysql/sys-maint.cnf"
# - # -
mysql_credential_args="--login-path=local" mysql_credential_args="--defaults-file=/etc/mysql/debian.cnf"
# - Additional Settings for check_php_fpm # - Additional Settings for check_php_fpm
@ -93,7 +93,7 @@ curl_check_host=127.0.0.1
# - Example: # - Example:
# - php_versions="5.4 5.6 7.0 7.1" # - php_versions="5.4 5.6 7.0 7.1"
# - # -
php_versions="7.4" php_versions="8.1"
# - If PHP-FPM's ping.path setting does not match ping-$php_major_version, # - If PHP-FPM's ping.path setting does not match ping-$php_major_version,
# - set the value given in your ping.path setting here. Give ping_path also # - set the value given in your ping.path setting here. Give ping_path also

View File

@ -93,7 +93,7 @@ curl_check_host=127.0.0.1
# - Example: # - Example:
# - php_versions="5.4 5.6 7.0 7.1" # - php_versions="5.4 5.6 7.0 7.1"
# - # -
php_versions="7.4" php_versions="8.1"
# - If PHP-FPM's ping.path setting does not match ping-$php_major_version, # - If PHP-FPM's ping.path setting does not match ping-$php_major_version,
# - set the value given in your ping.path setting here. Give ping_path also # - set the value given in your ping.path setting here. Give ping_path also

View File

@ -70,3 +70,9 @@ convinceandconvert\.com$
thelargest\.homes$ thelargest\.homes$
eamyobai\.cfd$ eamyobai\.cfd$
countryfields\.ca$ countryfields\.ca$
urgencypasture\.shop$
detectivecomics\.net$
bell\.net$
beheshtfoundation\.com$
tohochina\.com$
mailer-service\.de$

View File

@ -133,3 +133,16 @@
103.114.162.0/24 103.114.162.0/24
# US (u.a.versender50.com) # US (u.a.versender50.com)
204.152.197.0/24 204.152.197.0/24
# US (u.a.vs-dienst.com)
45.134.11.0/24
212.83.56.0/24
# US ( u.a. urgencypasture.shop)
194.87.84.0/24
# US ( u.a. dkdirekt.com)
64.188.1.176/28
# CA (Canada) (u.a. bell.net)
209.71.192.0/18
# HU (u.a. beheshtfoundation.com)
83.137.158.0/24
# US (u.a. josephraffael.com / auftrag@v-markt-direkt.com)
64.188.4.0/22

View File

@ -92,4 +92,13 @@ firmen-infos\.com$
^info@webmeinung\.de$ ^info@webmeinung\.de$
^info@handel-versand\.com$ ^info@handel-versand\.com$
^order@direktversender\.net$ ^order@direktversender\.net$
versender.*.com$ versender.*\.com$
vs-dienst\.com$
urgencypasture\.shop$
dkdirekt\.com$
nb\.sympatico\.ca$
beheshtfoundation\.com$
josephraffael\.com$
v-markt-direkt\.com$
mailer-service\.de$
swissad\.biz$

View File

@ -69,7 +69,7 @@ curl_check_host=127.0.0.1
# - Example: # - Example:
# - php_versions="5.4 5.6 7.0 7.1" # - php_versions="5.4 5.6 7.0 7.1"
# - # -
php_versions="7.4" php_versions="8.1"
# - If PHP-FPM's ping.path setting does not match ping-$php_major_version, # - If PHP-FPM's ping.path setting does not match ping-$php_major_version,
# - set the value given in your ping.path setting here. Give ping_path also # - set the value given in your ping.path setting here. Give ping_path also

View File

@ -63,8 +63,10 @@
state: restarted state: restarted
- name: Restart redis-server - name: Restart redis-server
vars:
_daemon: "{{ 'redis' if ansible_distribution == 'CentOS' else 'redis-server' }}"
service: service:
name: redis-server name: "{{ _daemon }}"
state: restarted state: restarted
- name: Restart tor service - name: Restart tor service

View File

@ -11,6 +11,8 @@
name: "{{ item }}" name: "{{ item }}"
state: present state: present
with_items: "{{ locales }}" with_items: "{{ locales }}"
when:
- ansible_facts['distribution'] == "Debian"
tags: tags:
- locales - locales
@ -150,28 +152,38 @@
- name: (basic.yml) install unattended-upgrades - name: (basic.yml) install unattended-upgrades
apt: pkg=unattended-upgrades state=present apt: pkg=unattended-upgrades state=present
when:
- ansible_facts['distribution'] == "Debian"
tags: tags:
- unattended-upgrades - unattended-upgrades
- name: (basic.yml) install apt-listchanges - name: (basic.yml) install apt-listchanges
apt: pkg=apt-listchanges state=present apt: pkg=apt-listchanges state=present
when:
- ansible_facts['distribution'] == "Debian"
tags: tags:
- unattended-upgrades - unattended-upgrades
- name: (basic.yml) remove apticron - name: (basic.yml) remove apticron
apt: pkg=apticron state=absent apt: pkg=apticron state=absent
when:
- ansible_facts['distribution'] == "Debian"
tags: tags:
- unattended-upgrades - unattended-upgrades
- name: (basic.yml) check if /etc/apt/apt.conf.d/20auto-upgrades exists - name: (basic.yml) check if /etc/apt/apt.conf.d/20auto-upgrades exists
stat: path=/etc/apt/apt.conf.d/20auto-upgrades stat: path=/etc/apt/apt.conf.d/20auto-upgrades
register: ua_enabled register: ua_enabled
when:
- ansible_facts['distribution'] == "Debian"
tags: tags:
- unattended-upgrades - unattended-upgrades
- name: (basic.yml) activate unattended upgrades - name: (basic.yml) activate unattended upgrades
shell: DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true dpkg-reconfigure -plow unattended-upgrades shell: DEBIAN_FRONTEND=noninteractive DEBCONF_NONINTERACTIVE_SEEN=true dpkg-reconfigure -plow unattended-upgrades
when: ua_enabled.stat.exists == False when:
- ansible_facts['distribution'] == "Debian"
- ua_enabled.stat.exists == False
tags: tags:
- unattended-upgrades - unattended-upgrades
@ -182,6 +194,8 @@
owner: root owner: root
group: root group: root
mode: 0644 mode: 0644
when:
- ansible_facts['distribution'] == "Debian"
tags: tags:
- unattended-upgrades - unattended-upgrades
@ -193,5 +207,7 @@
owner: root owner: root
group: root group: root
mode: 0644 mode: 0644
when:
- ansible_facts['distribution'] == "Debian"
tags: tags:
- unattended-upgrades - unattended-upgrades

View File

@ -1,11 +1,17 @@
--- ---
# ---
# Install 'bind' apt based OS
# ---
- name: (caching-nameserver.yml) update - name: (caching-nameserver.yml) update
apt: apt:
update_cache: true update_cache: true
cache_valid_time: "{{ 0 if apt_config_updated is defined and apt_config_updated.changed else apt_update_cache_valid_time }}" cache_valid_time: "{{ 0 if apt_config_updated is defined and apt_config_updated.changed else apt_update_cache_valid_time }}"
when: apt_update|bool when:
- ansible_distribution == "Debian"
- apt_update|bool
tags: tags:
- apt-caching-nameserver - apt-caching-nameserver
@ -17,7 +23,9 @@
warn: false warn: false
changed_when: _dpkg_configure.stdout_lines | length changed_when: _dpkg_configure.stdout_lines | length
register: _dpkg_configure register: _dpkg_configure
when: apt_dpkg_configure|bool when:
- ansible_distribution == "Debian"
- apt_update|bool
tags: tags:
- apt-caching-nameserver - apt-caching-nameserver
@ -27,19 +35,52 @@
upgrade: "{{ apt_upgrade_type }}" upgrade: "{{ apt_upgrade_type }}"
update_cache: true update_cache: true
dpkg_options: "{{ apt_upgrade_dpkg_options | join(',') }}" dpkg_options: "{{ apt_upgrade_dpkg_options | join(',') }}"
when: apt_upgrade|bool when:
- ansible_distribution == "Debian"
- apt_dpkg_configure|bool
tags: tags:
- apt-caching-nameserver - apt-caching-nameserver
- name: (caching-nameserver.yml) Install bind9 packages - name: (caching-nameserver.yml) Install bind packages (using apt)
apt: apt:
name: "{{ apt_bind9_pkgs }}" name: "{{ apt_bind_pkgs }}"
state: present state: present
when: apt_install_bind9_packages|bool == true when:
- ansible_distribution == "Debian"
- install_bind_packages|bool == true
tags: tags:
- apt-caching-nameserver - apt-caching-nameserver
# ---
# Install 'bind' - yum based OS
# ---
- name: (yum.yml) Install system updates for centos systems
yum:
name: '*'
state: latest
update_cache: yes
#cache_valid_time: 3600
when:
- ansible_os_family == "RedHat"
- ansible_distribution == "CentOS"
tags:
- yum-update
- name: (yum.yml) Install bind packages (using yum)
yum:
name: "{{ yum_bind_pks }}"
state: "{{ yum_install_state }}"
when:
- ansible_os_family == "RedHat"
- ansible_distribution == "CentOS"
tags:
- yum-caching-nameserver
# ---
# Configure bind on debian systems
# --
- name: (caching-nameserver.yml) Create directory /var/log/named if it does not exist - name: (caching-nameserver.yml) Create directory /var/log/named if it does not exist
file: file:
@ -48,6 +89,8 @@
owner: bind owner: bind
group: bind group: bind
mode: '0755' mode: '0755'
when:
- ansible_distribution == "Debian"
- name: (caching-nameserver.yml) update named.conf.options configuration file (normal server) - name: (caching-nameserver.yml) update named.conf.options configuration file (normal server)
@ -64,6 +107,7 @@
- apt-caching-nameserver - apt-caching-nameserver
- caching-nameserver - caching-nameserver
when: when:
- ansible_distribution == "Debian"
- inventory_hostname not in groups["gateway_server"] - inventory_hostname not in groups["gateway_server"]
# -------------------- # --------------------
@ -89,6 +133,7 @@
- apt-caching-nameserver - apt-caching-nameserver
- caching-nameserver - caching-nameserver
when: when:
- ansible_distribution == "Debian"
- inventory_hostname in groups["gateway_server"] - inventory_hostname in groups["gateway_server"]
# - not file_named_conf_options.stat.exists # - not file_named_conf_options.stat.exists
@ -107,4 +152,6 @@
mode: '0644' mode: '0644'
tags: tags:
- apt-caching-nameserver - apt-caching-nameserver
when:
- ansible_distribution == "Debian"

View File

@ -26,11 +26,26 @@
# apt-autoremove # apt-autoremove
# apt-clean # apt-clean
- import_tasks: apt.yml - import_tasks: apt.yml
when:
- ansible_facts['distribution'] == "Debian"
tags: apt tags: apt
#
# yum-update
# yum-base-install
# yum-initial-install
- import_tasks: yum.yml
when:
- ansible_os_family == "RedHat"
- ansible_distribution == "CentOS"
tags: yum
- import_tasks: tor.yml - import_tasks: tor.yml
when: inventory_hostname in groups['mail_server'] when:
- inventory_hostname in groups['mail_server']
- ansible_facts['distribution'] == "Debian"
tags: tags:
- tor-service - tor-service
@ -44,6 +59,8 @@
# zsh-config # zsh-config
# #
- import_tasks: shell.yml - import_tasks: shell.yml
when:
- ansible_facts['distribution'] == "Debian"
tags: tags:
- shell-config - shell-config
- vim-config - vim-config
@ -208,7 +225,23 @@
# tags supportetd inside caching-nameserver.yml # tags supportetd inside caching-nameserver.yml
# #
# apt-caching-nameserver # apt-caching-nameserver
# yum-caching-nameserver
#
- import_tasks: caching-nameserver.yml - import_tasks: caching-nameserver.yml
when: groups['caching_nameserver']|string is search(inventory_hostname) when: groups['caching_nameserver']|string is search(inventory_hostname)
tags: caching-nameserver tags: caching-nameserver
- import_tasks: systemd-services_debian_based_OS.yml
when:
- ansible_os_family == "Debian"
tags:
- services
- import_tasks: systemd-services_redhat_based_OS.yml
when:
- ansible_os_family == "RedHat"
tags:
- services

View File

@ -1,11 +1,17 @@
--- ---
- name: (redis-server.yml) Set var '_redis_conf'
set_fact:
_redis_conf: "{{ '/etc/redis.conf' if ansible_distribution == 'CentOS' else '/etc/redis/redis.conf' }}"
- name: (redis-server.yml) update - name: (redis-server.yml) update
apt: apt:
update_cache: true update_cache: true
cache_valid_time: "{{ 0 if apt_config_updated is defined and apt_config_updated.changed else apt_update_cache_valid_time }}" cache_valid_time: "{{ 0 if apt_config_updated is defined and apt_config_updated.changed else apt_update_cache_valid_time }}"
when: apt_update|bool when:
- ansible_facts['distribution'] == "Debian"
- apt_update|bool
tags: tags:
- redis-server - redis-server
@ -17,7 +23,9 @@
warn: false warn: false
changed_when: _dpkg_configure.stdout_lines | length changed_when: _dpkg_configure.stdout_lines | length
register: _dpkg_configure register: _dpkg_configure
when: apt_dpkg_configure|bool when:
- ansible_facts['distribution'] == "Debian"
- apt_update|bool
tags: tags:
- redis-server - redis-server
@ -27,15 +35,30 @@
upgrade: "{{ apt_upgrade_type }}" upgrade: "{{ apt_upgrade_type }}"
update_cache: true update_cache: true
dpkg_options: "{{ apt_upgrade_dpkg_options | join(',') }}" dpkg_options: "{{ apt_upgrade_dpkg_options | join(',') }}"
when: apt_upgrade|bool when:
- ansible_facts['distribution'] == "Debian"
- apt_upgrade|bool
tags: tags:
- redis-server - redis-server
- name: (redis-server.yml) Install redis-server packages - name: (redis-server.yml) Install redis-server packages (debian system)
apt: apt:
name: redis-server name: redis-server
state: present state: present
when:
- ansible_facts['distribution'] == "Debian"
tags:
- redis-server
- name: (redis-server.yml) Install redis packages (centos system)
yum:
name: redis
state: latest
update_cache: yes
when:
- ansible_os_family == "RedHat"
- ansible_distribution == "CentOS"
tags: tags:
- redis-server - redis-server
@ -79,23 +102,23 @@
tags: tags:
- redis-server - redis-server
- name: (redis-server.yml) Check if file '/etc/redis/redis.conf.ORIG' exists - name: (redis-server.yml) Check if redis configuration file exists
stat: stat:
path: /etc/redis/redis.conf.ORIG path: "{{ _redis_conf }}.ORIG"
register: redis_conf_exists register: redis_conf_exists
tags: tags:
- redis-server - redis-server
- name: (redis-server.yml) Backup existing file /etc/redis/redis.conf. - name: (redis-server.yml) Backup existing redis configuration file.
command: cp -a /etc/redis/redis.conf /etc/redis/redis.conf.ORIG command: cp -a "{{ _redis_conf }}" "{{ _redis_conf }}".ORIG
when: when:
- redis_conf_exists.stat.exists == False - redis_conf_exists.stat.exists == False
tags: tags:
- redis-server - redis-server
- name: (redis-server.yml) adjust configuration '/etc/redis/redis.conf' - name: (redis-server.yml) adjust redis configuration
lineinfile: lineinfile:
dest: /etc/redis/redis.conf dest: "{{ _redis_conf }}"
regexp: "{{ item.regexp }}" regexp: "{{ item.regexp }}"
insertafter: "{{ item.insertafter }}" insertafter: "{{ item.insertafter }}"
line: "{{ item.key }} {{ item.val }}" line: "{{ item.key }} {{ item.val }}"

View File

@ -19,7 +19,7 @@
path: "{{ item.path }}" path: "{{ item.path }}"
owner: "root" owner: "root"
group: "{{ item.group_write_list | default('root', true) }}" group: "{{ item.group_write_list | default('root', true) }}"
mode: '2770' mode: "{{ dir_create_mask | default('2770', true) }}"
state: directory state: directory
recurse: no recurse: no
with_items: "{{ samba_shares }}" with_items: "{{ samba_shares }}"

View File

@ -0,0 +1,61 @@
---
- name: (systemd-services.yml) Check if Service Exists (Debian based OS)
shell: 'systemctl list-unit-files | grep -q -e "^{{ item }}.service";'
changed_when: "service_exists.rc > 1"
failed_when: "service_exists.rc > 1"
register: service_exists
with_items:
- "{{ debian_services_active_and_started }}"
#- debug: msg="{{ service_exists.results }}"
- name: (systemd-services.yml) Check if Service is disabled (Debian based OS)
shell: 'systemctl list-unit-files | grep -e "^{{ item.item }}.service" | grep -q "disabled";'
register: service_is_enabled
changed_when: "service_is_enabled.rc == 0"
failed_when: "service_is_enabled.rc > 1"
with_items:
- "{{ service_exists.results }}"
loop_control:
label: '{{ item.item }}'
when:
- item.rc == 0
#- debug: msg="{{ service_is_enabled.results }}"
- name: (systemd-services.yml) Enable service
systemd:
name: "{{ item.item.item }}.service"
enabled: true
with_items:
- "{{ service_is_enabled.results }}"
loop_control:
label: '{{ item.item.item }}'
when:
- item.changed
- name: (systemd-services.yml) Check if Service is active
shell: 'systemctl is-active {{ item.item }}.service'
register: service_is_active
changed_when: 'service_is_active.stdout == "inactive"'
failed_when: 'service_is_active.rc > 3'
with_items:
- "{{ service_exists.results }}"
loop_control:
label: '{{ item.item }}'
when:
- item.rc == 0
- name: (systemd-services.yml) Start service
systemd:
name: "{{ item.item.item }}.service"
state: started
with_items:
- "{{ service_is_active.results }}"
loop_control:
label: '{{ item.item.item }}'
when:
- item.changed

View File

@ -0,0 +1,64 @@
---
- name: (systemd-services.yml) Check if Service Exists (RedHat based OS)
shell: 'systemctl list-unit-files | grep -q -e "^{{ item }}.service";'
changed_when: "service_exists.rc > 1"
failed_when: "service_exists.rc > 1"
register: service_exists
with_items:
- "{{ redhat_services_active_and_started }}"
when:
- ansible_os_family == "RedHat"
#- debug: msg="{{ service_exists.results }}"
- name: (systemd-services.yml) Check if Service is disabled (RedHat based OS)
shell: 'systemctl list-unit-files | grep -e "^{{ item.item }}.service" | grep -q "disabled";'
register: service_is_enabled
changed_when: "service_is_enabled.rc == 0"
failed_when: "service_is_enabled.rc > 1"
with_items:
- "{{ service_exists.results }}"
loop_control:
label: '{{ item.item }}'
when:
- item.rc == 0
- ansible_os_family == "RedHat"
#- debug: msg="{{ service_is_enabled.results }}"
- name: (systemd-services.yml) Enable service
systemd:
name: "{{ item.item.item }}.service"
enabled: true
with_items:
- "{{ service_is_enabled.results }}"
loop_control:
label: '{{ item.item.item }}'
when:
- item.changed
- name: (systemd-services.yml) Check if Service is active
shell: 'systemctl is-active {{ item.item }}.service'
register: service_is_active
changed_when: 'service_is_active.stdout == "inactive"'
failed_when: 'service_is_active.rc > 3'
with_items:
- "{{ service_exists.results }}"
loop_control:
label: '{{ item.item }}'
when:
- item.rc == 0
- name: (systemd-services.yml) Start service
systemd:
name: "{{ item.item.item }}.service"
state: started
with_items:
- "{{ service_is_active.results }}"
loop_control:
label: '{{ item.item.item }}'
when:
- item.changed

View File

@ -83,7 +83,7 @@
- bash - bash
# -- # --
# Copy .profile # Copy .profile (Debian System)
# --- # ---
- name: (users-systemfiles.yml) Check if users file '.profile.ORIG' exists - name: (users-systemfiles.yml) Check if users file '.profile.ORIG' exists
@ -93,6 +93,8 @@
loop: "{{ default_user }}" loop: "{{ default_user }}"
loop_control: loop_control:
label: '{{ item.name }}' label: '{{ item.name }}'
when:
- ansible_facts['distribution'] == "Debian"
tags: tags:
- profile - profile
@ -101,7 +103,9 @@
loop: "{{ profile_user_orig_exists.results }}" loop: "{{ profile_user_orig_exists.results }}"
loop_control: loop_control:
label: '{{ item.item.name }}' label: '{{ item.item.name }}'
when: item.stat.exists == False when:
- ansible_facts['distribution'] == "Debian"
- item.stat.exists == False
tags: tags:
- profile - profile
@ -116,6 +120,7 @@
loop_control: loop_control:
label: '{{ item.item.name }}' label: '{{ item.item.name }}'
when: when:
- ansible_facts['distribution'] == "Debian"
- item.stat.exists - item.stat.exists
- lookup('fileglob', inventory_dir + '/files/homedirs/' + item.item.name + '/_profile') - lookup('fileglob', inventory_dir + '/files/homedirs/' + item.item.name + '/_profile')
tags: tags:
@ -125,12 +130,16 @@
stat: stat:
path: /root/.profile.ORIG path: /root/.profile.ORIG
register: profile_root_orig_exists register: profile_root_orig_exists
when:
- ansible_facts['distribution'] == "Debian"
tags: tags:
- profile - profile
- name: (users-systemfiles.yml) Backup existing users .profile file - name: (users-systemfiles.yml) Backup existing users .profile file
command: cp -a /root/.profile /root/.profile.ORIG command: cp -a /root/.profile /root/.profile.ORIG
when: profile_root_orig_exists.stat.exists == False when:
- ansible_facts['distribution'] == "Debian"
- profile_root_orig_exists.stat.exists == False
tags: tags:
- profile - profile
@ -142,11 +151,88 @@
group: root group: root
mode: 0644 mode: 0644
when: when:
- ansible_facts['distribution'] == "Debian"
- local_template_dir_root.stat.exists - local_template_dir_root.stat.exists
- lookup('fileglob', inventory_dir + '/files/homedirs/root/_profile') - lookup('fileglob', inventory_dir + '/files/homedirs/root/_profile')
tags: tags:
- profile - profile
# --
# Copy .bash_profile (CentOS/Fedora?/RedHat? System)
# ---
- name: (users-systemfiles.yml) Check if users file '.bash_profile.ORIG' exists
stat:
path: "~{{ item.name }}/.bash_profile.ORIG"
register: bash_profile_user_orig_exists
loop: "{{ default_user }}"
loop_control:
label: '{{ item.name }}'
when:
- ansible_facts['distribution'] == "CentOS"
tags:
- profile
- name: (users-systemfiles.yml) Backup existing users .bash_profile file
command: cp -a ~{{ item.item.name }}/.bash_profile ~{{ item.item.name }}/.bash_profile.ORIG
loop: "{{ bash_profile_user_orig_exists.results }}"
loop_control:
label: '{{ item.item.name }}'
when:
- ansible_facts['distribution'] == "CentOS"
- item.stat.exists == False
tags:
- profile
- name: (users-systemfiles.yml) copy .bash_profile if it exists
copy:
src: "{{ lookup('fileglob', inventory_dir + '/files/homedirs/' + item.item.name + '/_bash_profile') }}"
dest: "~{{ item.item.name }}/.bash_profile"
owner: "{{ item.item.name }}"
group: "{{ item.item.name }}"
mode: 0644
loop: "{{ local_template_dir_default_user.results }}"
loop_control:
label: '{{ item.item.name }}'
when:
- ansible_facts['distribution'] == "CentOS"
- item.stat.exists
- lookup('fileglob', inventory_dir + '/files/homedirs/' + item.item.name + '/_bash_profile')
tags:
- profile
- name: (users-systemfiles.yml) Check if file '/root/.bash_profile.ORIG' exists
stat:
path: /root/.bash_profile.ORIG
register: profile_root_orig_exists
when:
- ansible_facts['distribution'] == "CentOS"
tags:
- profile
- name: (users-systemfiles.yml) Backup existing users .bash_profile file
command: cp -a /root/.bash_profile /root/.bash_profile.ORIG
when:
- ansible_facts['distribution'] == "CentOS"
- profile_root_orig_exists.stat.exists == False
tags:
- profile
- name: (users-systemfiles.yml) copy .bash_profile for user root
copy:
src: "{{ lookup('fileglob', inventory_dir + '/files/homedirs/root/_bash_profile') }}"
dest: "/root/.bash_profile"
owner: root
group: root
mode: 0644
when:
- ansible_facts['distribution'] == "CentOS"
- local_template_dir_root.stat.exists
- lookup('fileglob', inventory_dir + '/files/homedirs/root/_bash_profile')
tags:
- profile
# -- # --
# Copy .vimrc # Copy .vimrc
# --- # ---

View File

@ -0,0 +1,53 @@
---
- name: (yum.yml) Install system updates for centos systems
yum:
name: '*'
state: latest
update_cache: yes
#cache_valid_time: 3600
when:
- ansible_os_family == "RedHat"
- ansible_distribution == "CentOS"
tags:
- yum-update
- name: Install the EPEL Repository in CentOS 7
yum:
name: epel-release
state: latest
# Its more eficient to in
- name: (yum.yml) Base install CentOS packages (CentOS 7)
yum:
name: "{{ yum_base_install_centos_7 }}"
state: "{{ yum_install_state }}"
when:
- ansible_os_family == "RedHat"
- ansible_distribution == "CentOS"
- ansible_distribution_major_version == "7"
tags:
- yum-base-install
- name: (yum.yml) Initial install CentOS packages (CentOS 7)
yum:
name: "{{ yum_initial_install_centos_7 }}"
state: "{{ yum_install_state }}"
when:
- ansible_os_family == "RedHat"
- ansible_distribution == "CentOS"
- ansible_distribution_major_version == "7"
tags:
- yum-initial-install
- name: (yum.yml) Install lxc_host related packages
yum:
name: "{{ yum_lxc_host_pkgs }}"
state: "{{ yum_install_state }}"
when:
- groups['lxc_host']|string is search(inventory_hostname)
tags:
- yum-lxc-hosts-pkgs

View File

@ -147,7 +147,7 @@ APACHE_SERVER_KEY="privkey.pem"
# - '/etc/mysql/debian.cnf' if MySQL is installed from debian package system # - '/etc/mysql/debian.cnf' if MySQL is installed from debian package system
# - '/usr/local/mysql/sys-maint.cnf' otherwise # - '/usr/local/mysql/sys-maint.cnf' otherwise
# - # -
#MYSQL_CREDENTIALS="" MYSQL_CREDENTIALS='{{ mysql_credentials | default(omit) }}'
# - The wa passwords will be encrypted. # - The wa passwords will be encrypted.