mirror of
https://github.com/unman/shaker.git
synced 2024-10-01 01:25:41 -04:00
Pi-hole - set IP for eth0 and update
This commit is contained in:
parent
6c61d79ac5
commit
4f7f14de12
5
pihole/eth0
Normal file
5
pihole/eth0
Normal file
@ -0,0 +1,5 @@
|
||||
auto eth0
|
||||
iface eth0 inet static
|
||||
address
|
||||
netmask 255.0.0.0
|
||||
gateway
|
48
pihole/install.sls
Normal file
48
pihole/install.sls
Normal file
@ -0,0 +1,48 @@
|
||||
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :
|
||||
#
|
||||
|
||||
{% if grains['nodename'] != 'dom0' %}
|
||||
|
||||
/etc/apt/sources.list:
|
||||
file.replace:
|
||||
- names:
|
||||
- /etc/apt/sources.list
|
||||
- /etc/apt/sources.list.d/qubes-r4.list
|
||||
- pattern: 'http://HTTPS///'
|
||||
- repl: 'https://'
|
||||
- flags: [ 'IGNORECASE', 'MULTILINE' ]
|
||||
|
||||
{% set IP = salt['cmd.shell']('qubesdb-read /qubes-ip') %}
|
||||
{% set GW = salt['cmd.shell']('qubesdb-read /qubes-gateway') %}
|
||||
|
||||
/etc/network/interfaces.d/eth0:
|
||||
file.managed:
|
||||
- source:
|
||||
- salt://pihole/eth0
|
||||
- user: root
|
||||
- group: root
|
||||
- makedirs: True
|
||||
|
||||
set_ip:
|
||||
file.line:
|
||||
- name: /etc/network/interfaces.d/eth0
|
||||
- match: address
|
||||
- mode: replace
|
||||
- content: "address {{IP}}"
|
||||
|
||||
set_gw:
|
||||
file.line:
|
||||
- name: /etc/network/interfaces.d/eth0
|
||||
- match: gateway
|
||||
- mode: replace
|
||||
- content: "gateway {{GW}}"
|
||||
|
||||
'systemctl restart networking':
|
||||
cmd.run:
|
||||
- runas: root
|
||||
|
||||
Pihole_update:
|
||||
pkg.uptodate:
|
||||
- refresh: True
|
||||
|
||||
{% endif %}
|
5
pihole/install.top
Normal file
5
pihole/install.top
Normal file
@ -0,0 +1,5 @@
|
||||
# vim: set syntax=yaml ts=2 sw=2 sts=2 et :
|
||||
|
||||
base:
|
||||
sys-pihole:
|
||||
- pihole.install
|
Loading…
Reference in New Issue
Block a user