Fix up clippy networking
This commit is contained in:
parent
bd281ef2e8
commit
07f1aacba0
5 changed files with 68 additions and 4 deletions
|
|
@ -15,7 +15,7 @@ After=network.target systemd-resolved.service
|
||||||
RequiresMountsFor=/var/lib/machines
|
RequiresMountsFor=/var/lib/machines
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/bin/systemd-nspawn --quiet --keep-unit --ephemeral --boot --network-veth --port=23:2342 -U --settings=override --machine=clippy
|
ExecStart=/usr/bin/systemd-nspawn --quiet --keep-unit --ephemeral --boot -U --settings=override --machine=clippy
|
||||||
KillMode=mixed
|
KillMode=mixed
|
||||||
Type=notify
|
Type=notify
|
||||||
RestartForceExitStatus=133
|
RestartForceExitStatus=133
|
||||||
|
|
|
||||||
2
clippy.nspawn
Normal file
2
clippy.nspawn
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
[Network]
|
||||||
|
VirtualEthernet=no
|
||||||
24
iptables.rules
Normal file
24
iptables.rules
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
# Generated by iptables-save v1.8.0 on Thu Apr 4 11:06:33 2019
|
||||||
|
*nat
|
||||||
|
:PREROUTING ACCEPT [13:648]
|
||||||
|
:INPUT ACCEPT [8:440]
|
||||||
|
:OUTPUT ACCEPT [18:1260]
|
||||||
|
:POSTROUTING ACCEPT [18:1260]
|
||||||
|
-A PREROUTING -i eth0 -p tcp -m tcp --dport 23 -j REDIRECT --to-ports 2342
|
||||||
|
COMMIT
|
||||||
|
# Completed on Thu Apr 4 11:06:33 2019
|
||||||
|
# Generated by iptables-save v1.8.0 on Thu Apr 4 11:06:33 2019
|
||||||
|
*filter
|
||||||
|
:INPUT ACCEPT [0:0]
|
||||||
|
:FORWARD ACCEPT [0:0]
|
||||||
|
:OUTPUT ACCEPT [360:761646]
|
||||||
|
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
|
||||||
|
-A INPUT -p icmp -j ACCEPT
|
||||||
|
-A INPUT -i lo -j ACCEPT
|
||||||
|
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
|
||||||
|
-A INPUT -p tcp -m state --state NEW -m tcp --dport 2342 -j ACCEPT
|
||||||
|
-A INPUT -p tcp -m state --state NEW -m tcp --dport 23 -j ACCEPT
|
||||||
|
-A INPUT -j REJECT --reject-with icmp-host-prohibited
|
||||||
|
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
|
||||||
|
COMMIT
|
||||||
|
# Completed on Thu Apr 4 11:06:33 2019
|
||||||
24
playbook.yml
24
playbook.yml
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
- name: Install host requisites
|
- name: Install host requisites
|
||||||
dnf:
|
dnf:
|
||||||
name: nginx,uwsgi,python3-flask,python3-flask-wtf,uwsgi-plugin-python3,certbot,python3-certbot-nginx,libselinux-python,git
|
name: nginx,uwsgi,python3-flask,python3-flask-wtf,uwsgi-plugin-python3,certbot,python3-certbot-nginx,libselinux-python,git,iptables-services
|
||||||
state: latest
|
state: latest
|
||||||
|
|
||||||
- name: Disable password-based root login
|
- name: Disable password-based root login
|
||||||
|
|
@ -28,6 +28,28 @@
|
||||||
state: restarted
|
state: restarted
|
||||||
when: disable_root_pw_ssh is changed
|
when: disable_root_pw_ssh is changed
|
||||||
|
|
||||||
|
- name: Create iptables firewall config dir
|
||||||
|
file:
|
||||||
|
path: /etc/iptables
|
||||||
|
state: directory
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0775
|
||||||
|
|
||||||
|
- name: Configure iptables firewall service
|
||||||
|
copy:
|
||||||
|
src: iptables.rules
|
||||||
|
dest: /etc/iptables/iptables.rules
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0664
|
||||||
|
|
||||||
|
- name: Enable iptables firewall service
|
||||||
|
systemd:
|
||||||
|
name: iptables
|
||||||
|
enabled: yes
|
||||||
|
state: started
|
||||||
|
|
||||||
- name: Create containers
|
- name: Create containers
|
||||||
include_tasks: setup_containers.yml
|
include_tasks: setup_containers.yml
|
||||||
vars:
|
vars:
|
||||||
|
|
|
||||||
|
|
@ -36,6 +36,22 @@
|
||||||
group: root
|
group: root
|
||||||
mode: 0664
|
mode: 0664
|
||||||
|
|
||||||
|
- name: Create systemd-nspawn config dir
|
||||||
|
file:
|
||||||
|
path: /etc/systemd/nspawn
|
||||||
|
state: directory
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0775
|
||||||
|
|
||||||
|
- name: Copy over clippy container config
|
||||||
|
copy:
|
||||||
|
src: clippy.nspawn
|
||||||
|
dest: /etc/systemd/nspawn/clippy.nspawn
|
||||||
|
owner: root
|
||||||
|
group: root
|
||||||
|
mode: 0664
|
||||||
|
|
||||||
- name: Enable clippy container auto boot
|
- name: Enable clippy container auto boot
|
||||||
systemd:
|
systemd:
|
||||||
daemon-reload: yes
|
daemon-reload: yes
|
||||||
|
|
@ -64,6 +80,6 @@
|
||||||
# enabled: yes
|
# enabled: yes
|
||||||
# state: started
|
# state: started
|
||||||
|
|
||||||
- name: Enable clippy container networkd
|
#- name: Enable clippy container networkd
|
||||||
command: systemctl enable -M clippy systemd-networkd
|
# command: systemctl enable -M clippy systemd-networkd
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue