Browse Source

Weitere Daeien hinzugefügt

master
Dirk Wirts 2 years ago
parent
commit
1640ec7d17
  1. 1
      Inventories/test/docker05.inv
  2. 58
      Inventories/test/host_vars/ansible-docker05.yml
  3. 2
      setups/enable_ansible.sh

1
Inventories/test/docker05.inv

@ -0,0 +1 @@
ansible-docker05 ansible_host=172.20.1.169 hostname=ansible-docker05

58
Inventories/test/host_vars/ansible-docker05.yml

@ -0,0 +1,58 @@
interface_name: "Wired connection 1"
static_ip: 172.20.1.33
netmask: 0/24
gateway: 172.20.1.251
dns_servers:
- 172.20.1.251
- 172.20.1.10
- 172.20.1.11
- 8.8.8.8
new_hostname: "ansible-docker05"
timezone: "Europe/Berlin"
required_pkgs:
- ufw
- fail2ban
- net-tools
- p7zip-full
- pigz
- htop
- iotop
- bash-completion
- rsync
- sudo
- nano
- vim
- screen
- curl
- gnupg2
- apache2-utils
- mariadb-client
- git
- sshpass
# Liste von IPs mit Erlaubnis für SSH
ssh_ips:
- "195.192.223.212" # Ratingen
- "87.128.173.178" # Essen
- "94.79.143.149" # Dirk
# Liste von Ports, die erlaubt sind
tcp_ports:
- "22"
- "6789"
- "8080"
- "8443"
- "8843"
- "8880"
udp_ports:
- "3478"
ssh_pub_key: "<pub-key-from-client>"
admin_users:
- name: admin-johannes
- name: admin-daniel
- name: admin-dirk
- name: admin-martin
groups_to_add: "sudo,docker"

2
setups/enable_ansible.sh

@ -2,7 +2,7 @@
# enable host for ansible
set -e
PUBKEY="ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBAEuwAZEN/DNkr1KkBsHdw1kRV964httL4gqpstBgComJy549miU2Cul0ozyl76qv8L6BNCzQywW86Kbb2h8glufSwCDwbcZpmQUN4lRDctrWHUU8R2mPLwSQfFqc+AVYomotegaVOnSwQzpOkTJIv94LWI3Amsfo0L/2V8JY0cb3WNMIg== root@ansible-host"
id -u ansible > /dev/null 2>&1 || adduser ansible --disabled-password --gecos "" --quiet
id -u ansible > /dev/null 2>&1 || /sbin/adduser ansible --disabled-password --gecos "" --quiet
mkdir -p /home/ansible/.ssh
echo "$PUBKEY" > /home/ansible/.ssh/authorized_keys
chown -R ansible /home/ansible/.ssh

Loading…
Cancel
Save