Compare commits
No commits in common. "925289b675bc43ce1d7fbde09f40ed416e09e4c8" and "607a9374db4f186b416c5b8c33c01482629fd925" have entirely different histories.
925289b675
...
607a9374db
@ -1,93 +1,17 @@
|
|||||||
---
|
---
|
||||||
all:
|
all:
|
||||||
hosts:
|
hosts:
|
||||||
router:
|
prusa.lan:
|
||||||
ansible_host: 192.168.50.2
|
iron-man.lan:
|
||||||
vars:
|
router.lan:
|
||||||
ip: 2
|
|
||||||
mac: 2c:b0:5d:4a:72:62
|
|
||||||
bender:
|
|
||||||
ansible_host: 192.168.50.3
|
|
||||||
vars:
|
|
||||||
ip: 3
|
|
||||||
mac: e0:3f:49:6f:03:c2
|
|
||||||
|
|
||||||
home-assistant:
|
|
||||||
ansible_host: 192.168.50.5
|
|
||||||
vars:
|
|
||||||
ip: 5
|
|
||||||
mac: dc:a6:32:8b:7b:ab
|
|
||||||
mac2: 6a:1b:c8:63:58:7a
|
|
||||||
prusa:
|
|
||||||
ansible_host: 192.168.50.6
|
|
||||||
vars:
|
|
||||||
ip: 6
|
|
||||||
mac: b8:27:eb:96:f3:3f
|
|
||||||
mac2: b8:27:eb:c3:a6:6a
|
|
||||||
# rpi3-02:
|
|
||||||
iron-man:
|
|
||||||
ansible_host: 192.168.50.7
|
|
||||||
vars:
|
|
||||||
ip: 7
|
|
||||||
mac: b8:27:eb:19:f8:0d
|
|
||||||
rpi3a:
|
|
||||||
ansible_host: 192.168.50.8
|
|
||||||
vars:
|
|
||||||
ip: 8
|
|
||||||
mac: b8:27:eb:ff:2a:86
|
|
||||||
kvm-bender:
|
|
||||||
ansible_host: 192.168.50.11
|
|
||||||
vars:
|
|
||||||
ip: 11
|
|
||||||
mac: dc:a6:32:f6:63:c1
|
|
||||||
android-sgs9:
|
|
||||||
vars:
|
|
||||||
ip: 41
|
|
||||||
mac: 24:18:1d:bc:fe:4f
|
|
||||||
ipad:
|
|
||||||
vars:
|
|
||||||
ip: 42
|
|
||||||
mac: b8:63:4d:b6:4c:bc
|
|
||||||
node-01.lan:
|
|
||||||
ansible_host: 192.168.50.101
|
|
||||||
vars:
|
|
||||||
ip: 101
|
|
||||||
mac: dc:a6:32:03:6d:fa
|
|
||||||
node-02.lan:
|
|
||||||
ansible_host: 192.168.50.102
|
|
||||||
vars:
|
|
||||||
ip: 102
|
|
||||||
mac: dc:a6:32:3c:0f:ff
|
|
||||||
node-03.lan:
|
|
||||||
ansible_host: 192.168.50.103
|
|
||||||
vars:
|
|
||||||
ip: 103
|
|
||||||
mac: dc:a6:32:3c:1a:ec
|
|
||||||
node-x86.lan:
|
|
||||||
ansible_host: 192.168.50.186
|
|
||||||
vars:
|
|
||||||
ip: 186
|
|
||||||
children:
|
children:
|
||||||
raspberry:
|
docker_cluster:
|
||||||
hosts:
|
hosts:
|
||||||
node-01.lan:
|
node-01.lan:
|
||||||
|
ansible_host: 192.168.50.101
|
||||||
node-02.lan:
|
node-02.lan:
|
||||||
|
ansible_host: 192.168.50.102
|
||||||
node-03.lan:
|
node-03.lan:
|
||||||
lan:
|
ansible_host: 192.168.50.103
|
||||||
hosts:
|
node-x86.lan:
|
||||||
router:
|
ansible_host: 192.168.50.186
|
||||||
bender:
|
|
||||||
home-assistant:
|
|
||||||
rpi3-01:
|
|
||||||
# rpi3-02:
|
|
||||||
iron-man:
|
|
||||||
prusa:
|
|
||||||
|
|
||||||
|
|
||||||
children:
|
|
||||||
docker_cluster:
|
|
||||||
hosts:
|
|
||||||
node-01.lan:
|
|
||||||
node-02.lan:
|
|
||||||
node-03.lan:
|
|
||||||
node-x86.lan:
|
|
||||||
|
20
main.yml
20
main.yml
@ -4,21 +4,17 @@
|
|||||||
# - ssh
|
# - ssh
|
||||||
# - ubuntu
|
# - ubuntu
|
||||||
#
|
#
|
||||||
- hosts: prusa
|
#- hosts: prusa.lan
|
||||||
roles:
|
|
||||||
- ssh
|
|
||||||
- octoprint
|
|
||||||
- ubuntu
|
|
||||||
|
|
||||||
#- hosts: docker_cluster
|
|
||||||
# roles:
|
# roles:
|
||||||
# - ssh
|
# - ssh
|
||||||
# - docker-cluster
|
# - octoprint
|
||||||
# - ubuntu
|
# - ubuntu
|
||||||
#
|
|
||||||
#- hosts: raspberry
|
- hosts: docker_cluster
|
||||||
# roles:
|
roles:
|
||||||
# - i2c-clock
|
- ssh
|
||||||
|
- docker-cluster
|
||||||
|
- ubuntu
|
||||||
|
|
||||||
#- hosts: router.lan
|
#- hosts: router.lan
|
||||||
# roles:
|
# roles:
|
||||||
|
@ -1,2 +1 @@
|
|||||||
node-02 IPaddr::192.168.50.100/24/eth0:0
|
node-02 IPaddr::192.168.50.100/24/eth0:0
|
||||||
node-02 ssh-external
|
|
@ -1,28 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
SERVICE=sshd-external
|
|
||||||
|
|
||||||
case "$1" in
|
|
||||||
start)
|
|
||||||
systemctl start "${SERVICE}"
|
|
||||||
;;
|
|
||||||
stop)
|
|
||||||
systemctl stop "${SERVICE}"
|
|
||||||
;;
|
|
||||||
reload)
|
|
||||||
systemctl reload "${SERVICE}"
|
|
||||||
;;
|
|
||||||
force-reload)
|
|
||||||
systemctl force-reload "${SERVICE}"
|
|
||||||
;;
|
|
||||||
restart)
|
|
||||||
systemctl restart "${SERVICE}"
|
|
||||||
;;
|
|
||||||
status)
|
|
||||||
systemctl status "${SERVICE}"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Usage: /etc/init.d/ssh {start|stop|reload|force-reload|restart|status}" || true
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
@ -1,19 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=OpenBSD Secure Shell server
|
|
||||||
After=network.target auditd.service
|
|
||||||
ConditionPathExists=!/etc/ssh/sshd_not_to_be_run
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
EnvironmentFile=-/etc/default/ssh
|
|
||||||
ExecStartPre=/usr/sbin/sshd -t
|
|
||||||
ExecStart=/usr/sbin/sshd -D $SSHD_OPTS -f /etc/ssh/sshd_config_external
|
|
||||||
ExecReload=/usr/sbin/sshd -t
|
|
||||||
ExecReload=/bin/kill -HUP $MAINPID
|
|
||||||
KillMode=process
|
|
||||||
Restart=on-failure
|
|
||||||
RestartPreventExitStatus=255
|
|
||||||
Type=notify
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
Alias=sshd-external.service
|
|
@ -11,6 +11,4 @@
|
|||||||
|
|
||||||
- import_tasks: hostfile.yml
|
- import_tasks: hostfile.yml
|
||||||
|
|
||||||
- import_tasks: docker-watcher.yml
|
- import_tasks: docker-watcher.yml
|
||||||
|
|
||||||
- import_tasks: ssh-external.yml
|
|
@ -1,24 +0,0 @@
|
|||||||
---
|
|
||||||
- become: yes
|
|
||||||
block:
|
|
||||||
- name: copy config
|
|
||||||
copy:
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0600
|
|
||||||
directory_mode: yes
|
|
||||||
src: etc/ssh
|
|
||||||
dest: /etc
|
|
||||||
|
|
||||||
- name: copy ha.d resource ssh-external
|
|
||||||
copy:
|
|
||||||
owner: root
|
|
||||||
group: root
|
|
||||||
mode: 0755
|
|
||||||
src: etc/ha.d/resource.d/ssh-external
|
|
||||||
dest: /etc/ha.d/resource.d/ssh-external
|
|
||||||
|
|
||||||
- name: add systemd service
|
|
||||||
copy:
|
|
||||||
src: lib/systemd/system/sshd-external.service
|
|
||||||
dest: /lib/systemd/system/sshd-external.service
|
|
@ -12,12 +12,3 @@
|
|||||||
vars:
|
vars:
|
||||||
network: "{{ lan }}"
|
network: "{{ lan }}"
|
||||||
serial: "{{ ansible_date_time.year }}{{ ansible_date_time.month }}{{ ansible_date_time.day }}02"
|
serial: "{{ ansible_date_time.year }}{{ ansible_date_time.month }}{{ ansible_date_time.day }}02"
|
||||||
|
|
||||||
- name: Create db.lan
|
|
||||||
# become: yes
|
|
||||||
template:
|
|
||||||
src: etc/bind/db.reverse.j2
|
|
||||||
dest: build/dns/db.{{ lan.network_reverse }}
|
|
||||||
vars:
|
|
||||||
network: "{{ lan }}"
|
|
||||||
serial: "{{ ansible_date_time.year }}{{ ansible_date_time.month }}{{ ansible_date_time.day }}02"
|
|
||||||
|
@ -8,7 +8,7 @@ $ORIGIN {{ network.network_name }}.
|
|||||||
86400;
|
86400;
|
||||||
)
|
)
|
||||||
|
|
||||||
@ IN NS dns.{{ network.network_name }}.
|
@ IN NS dns.lan.
|
||||||
|
|
||||||
DNS IN A {{ network.network_prefix }}.100
|
DNS IN A {{ network.network_prefix }}.100
|
||||||
|
|
||||||
|
@ -1,15 +0,0 @@
|
|||||||
$TTL 86400
|
|
||||||
$ORIGIN {{ network.network_name }}.
|
|
||||||
@ IN SOA {{ network.network_name }}. dns.{{ network.network_name }}. (
|
|
||||||
{{ serial }};
|
|
||||||
604800;
|
|
||||||
86400;
|
|
||||||
2419200;
|
|
||||||
86400;
|
|
||||||
)
|
|
||||||
|
|
||||||
{{ network.network_reverse }} IN A dns.{{ network.network_name }}
|
|
||||||
|
|
||||||
{% for host in network.hosts %}
|
|
||||||
{{ host.ip }} IN PTR {{ host.name }}
|
|
||||||
{% endfor %}
|
|
@ -1,7 +1,6 @@
|
|||||||
---
|
---
|
||||||
lan:
|
lan:
|
||||||
network_prefix: 192.168.50
|
network_prefix: 192.168.50
|
||||||
network_reverse: 50.168.192
|
|
||||||
network_name: lan
|
network_name: lan
|
||||||
address: 192.168.50.0
|
address: 192.168.50.0
|
||||||
mask: 255.255.255.0
|
mask: 255.255.255.0
|
||||||
@ -16,36 +15,29 @@ lan:
|
|||||||
- name: bender
|
- name: bender
|
||||||
ip: 3
|
ip: 3
|
||||||
mac: e0:3f:49:6f:03:c2
|
mac: e0:3f:49:6f:03:c2
|
||||||
|
- name: prusa-new
|
||||||
|
ip: 4
|
||||||
|
mac: b8:27:eb:96:f3:3f
|
||||||
|
mac2: b8:27:eb:c3:a6:6a
|
||||||
- name: home-assistant
|
- name: home-assistant
|
||||||
ip: 5
|
ip: 5
|
||||||
mac: dc:a6:32:8b:7b:ab
|
mac: dc:a6:32:8b:7b:ab
|
||||||
mac2: 6a:1b:c8:63:58:7a
|
mac2: 6a:1b:c8:63:58:7a
|
||||||
- name: prusa
|
|
||||||
ip: 6
|
|
||||||
mac: b8:27:eb:96:f3:3f
|
|
||||||
mac2: b8:27:eb:c3:a6:6a
|
|
||||||
# - name: rpi3
|
|
||||||
- name: iron-man
|
- name: iron-man
|
||||||
ip: 7
|
ip: 7
|
||||||
mac: dc:a6:32:03:6d:fa
|
mac: dc:a6:32:03:6d:fa
|
||||||
- name: rpi3a
|
- name: prusa
|
||||||
ip: 8
|
ip: 8
|
||||||
mac: b8:27:eb:ff:2a:86
|
mac: b8:27:eb:ff:2a:86
|
||||||
- name: kvm-bender
|
|
||||||
ip: 11
|
|
||||||
mac: dc:a6:32:f6:63:c1
|
|
||||||
- name: hulk
|
|
||||||
ip: 21
|
|
||||||
mac: 24:4b:fe:05:e2:8b
|
|
||||||
- name: farnsworth
|
- name: farnsworth
|
||||||
ip: 22
|
ip: 21
|
||||||
mac: e0:3f:49:83:e8:dd
|
mac: e0:3f:49:83:e8:dd
|
||||||
- name: android-sgs9
|
|
||||||
ip: 41
|
|
||||||
mac: 24:18:1d:bc:fe:4f
|
|
||||||
- name: ipad
|
- name: ipad
|
||||||
ip: 42
|
ip: 46
|
||||||
mac: b8:63:4d:b6:4c:bc
|
mac: b8:63:4d:b6:4c:bc
|
||||||
|
- name: android-sgs9
|
||||||
|
ip: 47
|
||||||
|
mac: 24:18:1d:bc:fe:4f
|
||||||
- name: node-01
|
- name: node-01
|
||||||
ip: 101
|
ip: 101
|
||||||
mac: dc:a6:32:03:6d:fa
|
mac: dc:a6:32:03:6d:fa
|
||||||
|
@ -6,7 +6,7 @@ After=network.target
|
|||||||
User=octoprint
|
User=octoprint
|
||||||
Group=octoprint
|
Group=octoprint
|
||||||
Restart=always
|
Restart=always
|
||||||
ExecStart=/home/octoprint/bin/octoprint
|
ExecStart=/home/octoprint/.local/bin/octoprint
|
||||||
Type=simple
|
Type=simple
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
|
@ -5,29 +5,44 @@
|
|||||||
apt:
|
apt:
|
||||||
update_cache: yes
|
update_cache: yes
|
||||||
pkg:
|
pkg:
|
||||||
- python3-pip
|
- python-pip
|
||||||
- python3-all-dev
|
- python-dev
|
||||||
- python3-setuptools
|
- python-setuptools
|
||||||
- python3-virtualenv
|
- python-virtualenv
|
||||||
|
- python-pillow
|
||||||
- git
|
- git
|
||||||
- libyaml-dev
|
- libyaml-dev
|
||||||
- build-essential
|
- build-essential
|
||||||
- acl
|
|
||||||
- libjpeg8-dev
|
|
||||||
|
|
||||||
- name: install octoprint software
|
- name: install octoprint software
|
||||||
become: true
|
|
||||||
become_user: octoprint
|
become_user: octoprint
|
||||||
shell:
|
shell:
|
||||||
chdir: /home/octoprint
|
chdir: /home/octoprint
|
||||||
cmd: |
|
cmd: |
|
||||||
virtualenv --system-site-packages .
|
virtualenv --system-site-packages .
|
||||||
source bin/activate
|
source bin/activate
|
||||||
pip3 install pip --upgrade
|
pip install pip --upgrade
|
||||||
pip3 install octoprint
|
pip install octoprint
|
||||||
args:
|
args:
|
||||||
executable: /bin/bash
|
executable: /bin/bash
|
||||||
|
|
||||||
|
- name: enable system wide packages
|
||||||
|
file:
|
||||||
|
path: /home/octoprint/lib/python2.7/no-global-site-packages.txt
|
||||||
|
state: absent
|
||||||
|
|
||||||
|
- name: Create symbolic link for PIL package
|
||||||
|
file:
|
||||||
|
src: /usr/lib/python2.7/dist-packages/PIL
|
||||||
|
dest: /home/octoprint/lib/python2.7/site-packages/PIL
|
||||||
|
state: link
|
||||||
|
|
||||||
|
- name: Create symbolic link for pillow package
|
||||||
|
file:
|
||||||
|
src: /usr/lib/python2.7/dist-packages/Pillow-5.1.0.egg-info
|
||||||
|
dest: /home/octoprint/lib/python2.7/site-packages/Pillow-5.1.0.egg-info
|
||||||
|
state: link
|
||||||
|
|
||||||
- name: install plugins
|
- name: install plugins
|
||||||
become_user: octoprint
|
become_user: octoprint
|
||||||
pip:
|
pip:
|
||||||
@ -43,4 +58,6 @@
|
|||||||
- https://github.com/paukstelis/OctoPrint-Cancelobject/archive/master.zip
|
- https://github.com/paukstelis/OctoPrint-Cancelobject/archive/master.zip
|
||||||
- https://github.com/Renaud11232/OctoPrint-Resource-Monitor/archive/master.zip
|
- https://github.com/Renaud11232/OctoPrint-Resource-Monitor/archive/master.zip
|
||||||
- https://github.com/agrif/OctoPrint-InfluxDB/archive/master.zip
|
- https://github.com/agrif/OctoPrint-InfluxDB/archive/master.zip
|
||||||
|
- https://github.com/juergenpabel/OctoPrint-Procastinator/archive/master.zip
|
||||||
|
- https://github.com/ManuelMcLure/OctoPrint-WiFiStatus/archive/master.zip
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user