Move hosts file in to ansible directory.

New readme file
This commit is contained in:
Freifunk Troisdorf 2019-02-09 15:07:47 +01:00
parent 09f971ff9c
commit 62f4236660
3 changed files with 171 additions and 33 deletions

View File

@ -1,34 +1,12 @@
# ansible.fftdf.supernode
Ansible yml file to manage Freifunk Troisdorf supernodes
Ansible file to manage Freifunk Troisdorf supernodes
example: ansible-playbook install.sn.yml -l hosts
At this time you have to start it explicit with the target server
example: ansible-playbook install.sn.yml --extra-vars "target=troisdorf5"
example: ansible-playbook install.sn.yml --extra-vars "target=troisdorf[4,5,6]"
To install a individual host you have to start it explicit with the target server
example: ansible-playbook install.sn.yml -l hosts -l troisdorf7 -v
You need this information in your hosts (/etc/ansible/hosts) file:
#example, I hope self explaining
[troisdorf5]
78.46.233.212
[troisdorf5:vars]
sn_hostname=troisdorf5
sn_dhcp_range=10.188.116.1 10.188.119.254
sn_dhcp_dns=10.188.1.100, 10.188.1.23
sn_dhcp_router=10.188.255.5
sn_mesh_IPv6=fda0:747e:ab29:7405:255::5
sn_mesh_IPv4=10.188.255.5
sn_mesh_MAC=a2:8c:ae:6f:f6:05
sn_fqdn=freifunk-troisdorf.de
sn_l2tp_tb_port=53844
[troisdorf4:vars]
sn_hostname=troisdorf4
sn_dhcp_range=10.188.112.1 10.188.115.254
sn_dhcp_dns=10.188.255.4, 10.188.1.100
sn_dhcp_router=10.188.255.4
sn_mesh_IPv6=fda0:747e:ab29:7405:255::4
sn_mesh_IPv4=10.188.255.4
sn_mesh_MAC=a2:8c:ae:6f:f6:04
sn_fqdn=freifunk-troisdorf.de
sn_l2tp_tb_port=53842
The hosts file is the most important file.
You will find some example files:
files/hosts.example
files/root_pwd.yml.example
files/slack_token.yml.example

161
hosts Normal file
View File

@ -0,0 +1,161 @@
# This is the default ansible 'hosts' file.
#
# It should live in /etc/ansible/hosts
#
# - Comments begin with the '#' character
# - Blank lines are ignored
# - Groups of hosts are delimited by [header] elements
# - You can enter hostnames or ip addresses
# - A hostname/ip can be a member of multiple groups
# Ex 1: Ungrouped hosts, specify before any group headers.
#green.example.com
#blue.example.com
#192.168.100.1
#192.168.100.10
# Ex 2: A collection of hosts belonging to the 'webservers' group
#[webservers]
#alpha.example.org
#beta.example.org
#192.168.1.100
#192.168.1.110
# If you have multiple hosts following a pattern you can specify
# them like this:
#www[001:006].example.com
# Ex 3: A collection of database servers in the 'dbservers' group
#[dbservers]
#
#db01.intranet.mydomain.net
#db02.intranet.mydomain.net
#10.25.1.56
#10.25.1.57
# Here's another example of host ranges, this time there are no
# leading 0s:
#db-[99:101]-node.example.com
[freifunk]
#46.4.138.180 ansible_ssh_port=2222
#46.4.138.181 ansible_ssh_port=2222
#46.4.138.182 ansible_ssh_port=2222
#46.4.138.183 ansible_ssh_port=2222
#46.4.138.188 ansible_ssh_port=22
#46.4.138.189 ansible_ssh_port=22
[freifunk_sn:children]
troisdorf4
troisdorf5
troisdorf6
troisdorf7
#[freifunk_sn_l2tp:children]
#troisdorf4
#troisdorf5
#troisdorf6
#troisdorf7
[freifunk_sn:vars]
ansible_ssh_port=22
ansible_ssh_user=root
sn_mtu=1312
sn_l2tp_tb_port=53842
sn_fqdn=freifunk-troisdorf.de
static_dhcp_repo=https://github.com/Freifunk-Troisdorf/static-dhcp.git
root_password_file=/home/localadmin/root_pwd.yml
slack_token_file=/home/localadmin/slack_token.yml
communitymac=a2:8c:ae:6f:f6
communityname=troisdorf
[troisdorf4]
4.freifunk-troisdorf.de
[troisdorf4:vars]
sn_number=4
sn_hostname=troisdorf4
sn_dhcp_range=10.188.8.0 10.188.15.254
sn_mesh_IPv6=2a03:2260:121:4000::4
sn_mesh_IPv6_net=2a03:2260:121:4000::/64
sn_mesh_IPv6_xfer=2a03:2260:121:4000::2
sn_mesh_IPv4=10.188.0.4
sn_mesh_IPv4_brcast=10.188.31.255
sn_mesh_IPv4_net=10.188.0.0
sn_mesh_IPv4_xfer=10.188.0.2
sn_mesh_MAC=a2:8c:ae:6f:f6:04
ul_mesh_MAC=a2:8c:ae:6f:f6:40
sn_ffrl_IPv4=185.66.193.104
sn_exit=1
sn_interface_name=eth0
yanic_domain=tdf
[troisdorf5]
5.fftdf.de
[troisdorf5:vars]
sn_number=5
sn_hostname=troisdorf5
sn_dhcp_range=10.188.40.0 10.188.47.255
sn_mesh_IPv6=2a03:2260:121:5000::5
sn_mesh_IPv6_net=2a03:2260:121:5000::/64
sn_mesh_IPv6_xfer=2a03:2260:121:5000::2
sn_mesh_IPv4=10.188.32.5
sn_mesh_IPv4_brcast=10.188.63.255
sn_mesh_IPv4_net=10.188.32.0
sn_mesh_IPv4_xfer=10.188.32.2
sn_mesh_MAC=a2:8c:ae:6f:f6:05
ul_mesh_MAC=a2:8c:ae:6f:f6:50
sn_ffrl_IPv4=185.66.193.105
sn_exit=1
sn_interface_name=eth0
yanic_domain=inn
[troisdorf6]
6.fftdf.de
[troisdorf6:vars]
sn_number=6
sn_hostname=troisdorf6
sn_dhcp_range=10.188.72.0 10.188.79.255
sn_mesh_IPv6=2a03:2260:121:6000::6
sn_mesh_IPv6_net=2a03:2260:121:6000::/64
sn_mesh_IPv6_xfer=2a03:2260:121:6000::2
sn_mesh_IPv4=10.188.64.6
sn_mesh_IPv4_brcast=10.188.95.255
sn_mesh_IPv4_net=10.188.64.0
sn_mesh_IPv4_xfer=10.188.64.2
sn_mesh_MAC=a2:8c:ae:6f:f6:06
ul_mesh_MAC=a2:8c:ae:6f:f6:60
sn_ffrl_IPv4=185.66.193.106
sn_exit=1
sn_interface_name=eth0
yanic_domain=flu
[troisdorf7]
7.fftdf.de
[troisdorf7:vars]
sn_number=7
sn_hostname=troisdorf7
sn_dhcp_range=10.188.104.0 10.188.111.255
sn_mesh_IPv6=2a03:2260:121:7000::7
sn_mesh_IPv6_net=2a03:2260:121:7000::/64
sn_mesh_IPv6_xfer=2a03:2260:121:7000::2
sn_mesh_IPv4=10.188.96.7
sn_mesh_IPv4_brcast=10.188.127.255
sn_mesh_IPv4_net=10.188.96.0
sn_mesh_IPv4_xfer=10.188.96.2
sn_mesh_MAC=a2:8c:ae:6f:f6:07
ul_mesh_MAC=a2:8c:ae:6f:f6:70
sn_ffrl_IPv4=185.66.193.107
sn_local_exit=1
sn_interface_name=ens18
yanic_domain=evt

View File

@ -3,8 +3,7 @@
# ansible troisdorf4 -u root -m raw -a "apt-get update && apt-get install python -y"
- name: Install Freifunk Troisdorf super node
# hosts: FreifunkSupernodesL2TP
hosts: '{{ target }}'
hosts: all
sudo: False
user: root
gather_facts: False