Compare commits
No commits in common. "e7c3e1eed279912785b63f035dbe133ee680a6d3" and "802144ecb61bca05a3353ab6fa8970eb4b69e345" have entirely different histories.
e7c3e1eed2
...
802144ecb6
@ -72,10 +72,6 @@ all:
|
||||
ansible_host: 192.168.50.186
|
||||
vars:
|
||||
ip: 186
|
||||
remote_server:
|
||||
ansible_host:
|
||||
ansible_become_password:
|
||||
ansible_user: ubuntu
|
||||
children:
|
||||
raspberry:
|
||||
hosts:
|
||||
|
41
main.yml
41
main.yml
@ -1,25 +1,30 @@
|
||||
---
|
||||
- hosts: prusa
|
||||
roles:
|
||||
- ssh
|
||||
- octoprint
|
||||
- ubuntu
|
||||
#- hosts: iron-man.lan
|
||||
# roles:
|
||||
# - ssh
|
||||
# - ubuntu
|
||||
#
|
||||
#- hosts: prusa
|
||||
# roles:
|
||||
# - ssh
|
||||
# - octoprint
|
||||
# - ubuntu
|
||||
|
||||
- hosts: docker_cluster
|
||||
roles:
|
||||
- node_explorer
|
||||
- ssh
|
||||
# - node_explorer
|
||||
# - ssh
|
||||
- docker-cluster
|
||||
- ubuntu
|
||||
# - ubuntu
|
||||
#
|
||||
#- hosts: raspberry
|
||||
# roles:
|
||||
# - i2c-clock
|
||||
|
||||
- hosts: raspberry
|
||||
roles:
|
||||
- i2c-clock
|
||||
#- hosts: router.lan
|
||||
# roles:
|
||||
# - router
|
||||
|
||||
- hosts: router.lan
|
||||
roles:
|
||||
- router
|
||||
|
||||
- hosts: remote_server
|
||||
roles:
|
||||
- docker
|
||||
#- hosts: iron-man
|
||||
# roles:
|
||||
# - ssh
|
||||
|
@ -1,2 +1,2 @@
|
||||
node-02 IPaddr::192.168.50.100/24/eth0:0
|
||||
node-02 ssh-external::start
|
||||
node-02 ssh-external
|
@ -1,17 +0,0 @@
|
||||
- name: Clean docker system
|
||||
become: yes
|
||||
ansible.builtin.cron:
|
||||
user: root
|
||||
name: "clean docker system"
|
||||
minute: "0"
|
||||
hour: "3"
|
||||
job: "/usr/bin/docker system prune -f"
|
||||
|
||||
- name: Clean docker image cache
|
||||
become: yes
|
||||
ansible.builtin.cron:
|
||||
user: root
|
||||
name: "clean docker system"
|
||||
minute: "0"
|
||||
hour: "3"
|
||||
job: "/usr/bin/docker image prune -a -f"
|
@ -1,49 +0,0 @@
|
||||
---
|
||||
- become: yes
|
||||
block:
|
||||
- name: install needed packages
|
||||
apt:
|
||||
update_cache: yes
|
||||
pkg:
|
||||
- apt-transport-https
|
||||
- ca-certificates
|
||||
- curl
|
||||
- gnupg-agent
|
||||
- software-properties-common
|
||||
|
||||
- name: add docker gpg key
|
||||
apt_key:
|
||||
url: https://download.docker.com/linux/ubuntu/gpg
|
||||
state: present
|
||||
|
||||
- name: add docker repo
|
||||
apt_repository:
|
||||
repo: deb https://download.docker.com/linux/ubuntu {{ ansible_distribution_release }} stable
|
||||
state: present
|
||||
filename: docker
|
||||
|
||||
- name: install docker
|
||||
apt:
|
||||
update_cache: yes
|
||||
pkg:
|
||||
- docker-ce
|
||||
- docker-ce-cli
|
||||
- containerd.io
|
||||
|
||||
- name: add current user to docker group
|
||||
user:
|
||||
name: "{{ansible_user_id}}"
|
||||
groups: docker
|
||||
append: yes
|
||||
|
||||
- name: start and enable docker
|
||||
systemd:
|
||||
name: docker
|
||||
state: started
|
||||
enabled: true
|
||||
|
||||
- name: add current user to docker group
|
||||
user:
|
||||
name: "{{ ansible_user_id }}"
|
||||
append: yes
|
||||
groups: docker
|
@ -1,20 +0,0 @@
|
||||
---
|
||||
- become: yes
|
||||
block:
|
||||
- name: install needed packages
|
||||
apt:
|
||||
update_cache: yes
|
||||
pkg:
|
||||
- docker.io
|
||||
|
||||
- name: start and enable docker
|
||||
systemd:
|
||||
name: docker
|
||||
state: started
|
||||
enabled: true
|
||||
|
||||
- name: add current user to docker group
|
||||
user:
|
||||
name: "{{ ansible_user_id }}"
|
||||
append: yes
|
||||
groups: docker
|
@ -1,8 +0,0 @@
|
||||
---
|
||||
- import_tasks: install-docker-ce.yml
|
||||
when: ansible_distribution == "Ubuntu" and ansible_distribution_version == "18.04"
|
||||
|
||||
- import_tasks: install-docker-io.yml
|
||||
when: ansible_distribution == "Ubuntu" and ansible_distribution_version != "18.04"
|
||||
|
||||
- import_tasks: docker-cron.yml
|
@ -4,7 +4,7 @@
|
||||
path: build/dns
|
||||
state: directory
|
||||
|
||||
- name: Create db lan
|
||||
- name: Create db.lan
|
||||
# become: yes
|
||||
template:
|
||||
src: etc/bind/db.lan.j2
|
||||
@ -13,7 +13,7 @@
|
||||
network: "{{ lan }}"
|
||||
serial: "{{ ansible_date_time.year }}{{ ansible_date_time.month }}{{ ansible_date_time.day }}02"
|
||||
|
||||
- name: Create reverse db lan
|
||||
- name: Create db.lan
|
||||
# become: yes
|
||||
template:
|
||||
src: etc/bind/db.reverse.j2
|
||||
@ -21,21 +21,3 @@
|
||||
vars:
|
||||
network: "{{ lan }}"
|
||||
serial: "{{ ansible_date_time.year }}{{ ansible_date_time.month }}{{ ansible_date_time.day }}02"
|
||||
|
||||
- name: Create db iot
|
||||
# become: yes
|
||||
template:
|
||||
src: etc/bind/db.lan.j2
|
||||
dest: build/dns/db.iot
|
||||
vars:
|
||||
network: "{{ iot }}"
|
||||
serial: "{{ ansible_date_time.year }}{{ ansible_date_time.month }}{{ ansible_date_time.day }}02"
|
||||
|
||||
- name: Create reverse db iot
|
||||
# become: yes
|
||||
template:
|
||||
src: etc/bind/db.reverse.j2
|
||||
dest: build/dns/db.{{ iot.network_reverse }}
|
||||
vars:
|
||||
network: "{{ iot }}"
|
||||
serial: "{{ ansible_date_time.year }}{{ ansible_date_time.month }}{{ ansible_date_time.day }}02"
|
||||
|
@ -10,7 +10,7 @@ $ORIGIN {{ network.network_name }}.
|
||||
|
||||
@ IN NS dns.{{ network.network_name }}.
|
||||
|
||||
DNS IN A {{ network.dns }}
|
||||
DNS IN A {{ network.network_prefix }}.100
|
||||
|
||||
{% for host in network.hosts %}
|
||||
{{ host.name }} IN A {{ network.network_prefix }}.{{ host.ip }}
|
||||
|
@ -4,7 +4,6 @@ authorative;
|
||||
subnet {{ network.address }} netmask {{ network.mask }} {
|
||||
option domain-name-servers {{ network.dns }};
|
||||
option domain-name "{{ network.network_name }}";
|
||||
option domain-search "lan", "iot";
|
||||
option routers {{ network.gateway }};
|
||||
default-lease-time 86400;
|
||||
max-lease-time 86400;
|
||||
|
@ -20,17 +20,23 @@ lan:
|
||||
- name: prusa
|
||||
ip: 6
|
||||
mac: b8:27:eb:c3:a6:6a
|
||||
# - name: rpi3
|
||||
- name: iron-man
|
||||
ip: 7
|
||||
mac: dc:a6:32:03:6d:fa
|
||||
- name: rpi3a
|
||||
ip: 8
|
||||
mac: b8:27:eb:ff:2a:86
|
||||
|
||||
- name: hulk
|
||||
ip: 21
|
||||
mac: 24:4b:fe:05:e2:8b
|
||||
- name: banner
|
||||
ip: 22
|
||||
mac: '52:54:00:49:04:51'
|
||||
- name: hawkeye
|
||||
ip: 23
|
||||
mac: b4:8c:9d:5e:a1:8b
|
||||
mac2: a0:ce:c8:77:c3:13
|
||||
mac: 52:54:00:49:04:51
|
||||
- name: laptop
|
||||
ip: 29
|
||||
mac: 08:d4:0c:cc:ff:1f
|
||||
|
||||
- name: android-sgs9
|
||||
ip: 41
|
||||
@ -40,13 +46,10 @@ lan:
|
||||
mac: b8:63:4d:b6:4c:bc
|
||||
- name: iphone
|
||||
ip: 43
|
||||
mac: 0c:19:f8:10:c2:b3
|
||||
mac: b2:d9:6f:d9:31:e1
|
||||
- name: apple-watch
|
||||
ip: 44
|
||||
mac: 9c:28:b3:24:bc:9c
|
||||
- name: ipad-pro
|
||||
ip: 45
|
||||
mac: 38:88:a4:6e:95:a3
|
||||
mac: b2:b0:04:86:fc:90
|
||||
|
||||
- name: node-01
|
||||
ip: 101
|
||||
@ -60,15 +63,9 @@ lan:
|
||||
- name: node-04
|
||||
ip: 104
|
||||
mac: dc:a6:32:8b:7b:ab
|
||||
- name: node-05
|
||||
ip: 105
|
||||
mac: 08:d4:0c:cc:ff:1f
|
||||
|
||||
iot:
|
||||
network_prefix: 192.168.60
|
||||
network_reverse: 60.168.192
|
||||
network_name: iot
|
||||
dns: 192.168.50.100
|
||||
network: 192.168.60
|
||||
hosts:
|
||||
- name: hue-light
|
||||
ip: 3
|
||||
@ -76,16 +73,16 @@ iot:
|
||||
- name: harmony-hub
|
||||
ip: 4
|
||||
mac: c8:db:26:06:7e:f9
|
||||
- name: airpurifier-bedroom
|
||||
- name: zhimi-airpurifier-m1_miio61353463
|
||||
ip: 5
|
||||
mac: 34:ce:00:a4:f6:75
|
||||
- name: airpurifier-livingroom
|
||||
- name: zhimi-airpurifier-mb3_mibt952D
|
||||
ip: 6
|
||||
mac: 50:ec:50:85:95:2d
|
||||
- name: roborock
|
||||
ip: 7
|
||||
mac: 50:ec:50:0a:c3:94
|
||||
- name: humidifier
|
||||
- name: zhimi-humidifier-ca4_mibt1D0C
|
||||
ip: 8
|
||||
mac: 54:48:e6:5d:1d:0c
|
||||
- name: yeelight-lightbar
|
||||
@ -103,9 +100,6 @@ iot:
|
||||
- name: bedroom-tv
|
||||
ip: 16
|
||||
mac: d8:a3:5c:7d:50:0a
|
||||
- name: miibox
|
||||
ip: 17
|
||||
mac: 00:e0:4c:68:09:35
|
||||
- name: nvidia-shield
|
||||
ip: 18
|
||||
mac: 00:04:4b:cd:a6:5b
|
||||
@ -113,14 +107,9 @@ iot:
|
||||
- name: nintendo-switch
|
||||
ip: 19
|
||||
mac: 64:b5:c6:6f:ff:a8
|
||||
mac2: 00:0e:c6:c7:55:6f
|
||||
- name: printer
|
||||
ip: 20
|
||||
mac: 38:9d:92:d0:6d:8e
|
||||
- name: xbox-series-s
|
||||
ip: 21
|
||||
mac: a8:8c:3e:b0:aa:7a
|
||||
|
||||
- name: Sonos-LivingRoom
|
||||
ip: 30
|
||||
mac: 34:7e:5c:83:6f:c6
|
||||
@ -130,19 +119,12 @@ iot:
|
||||
- name: Sonos-Bathroom
|
||||
ip: 32
|
||||
mac: 5c:aa:fd:b9:4b:22
|
||||
- name: Sonos-Bedroom2
|
||||
ip: 33
|
||||
mac: 78:28:ca:85:51:dc
|
||||
|
||||
- name: home-assistant
|
||||
ip: 100
|
||||
mac: dc:a6:32:f6:63:c1
|
||||
- name: usb-switch-1
|
||||
ip: 111
|
||||
- name: home-assistant-power
|
||||
ip: 110
|
||||
mac: c8:2b:96:64:6a:37
|
||||
- name: usb-switch-2
|
||||
ip: 112
|
||||
mac: c8:2b:96:64:68:a3
|
||||
guest:
|
||||
network: 192.168.70
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user