Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ansible-warpzone
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
infrastruktur
ansible-warpzone
Commits
2a09fc8c
Commit
2a09fc8c
authored
1 month ago
by
Christian Elberfeld
Browse files
Options
Downloads
Patches
Plain Diff
ddns updates nach updates der zone erzwingen
parent
c13b8087
No related branches found
No related tags found
1 merge request
!148
Umbau von PiHole auf Kea DHCP und Bind
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dhcpdns/bind/tasks/main.yml
+52
-6
52 additions, 6 deletions
dhcpdns/bind/tasks/main.yml
webserver/docker_icinga/templates/etc/icinga/conf.d/services_manual.conf
+42
-0
42 additions, 0 deletions
...r_icinga/templates/etc/icinga/conf.d/services_manual.conf
with
94 additions
and
6 deletions
dhcpdns/bind/tasks/main.yml
+
52
−
6
View file @
2a09fc8c
...
@@ -2,14 +2,10 @@
...
@@ -2,14 +2,10 @@
-
include_tasks
:
../functions/get_secret.yml
-
include_tasks
:
../functions/get_secret.yml
with_items
:
with_items
:
-
{
path
:
"
/etc/kea/kea_api_password"
,
length
:
22
}
-
{
path
:
"
/etc/kea/kea_ddns_key"
,
length
:
44
}
-
{
path
:
"
/etc/kea/kea_ddns_key"
,
length
:
44
}
-
name
:
"
Create
new
zonefile
serial"
set_fact
:
zonefile_serial
:
"
{{
ansible_date_time.date
|
replace('-',
'')
}}01"
-
name
:
"
Instaliere
debian
Pakete"
-
name
:
"
Instaliere
debian
Pakete"
apt
:
apt
:
update_cache
:
yes
update_cache
:
yes
...
@@ -36,9 +32,59 @@
...
@@ -36,9 +32,59 @@
-
named.conf.options
-
named.conf.options
-
name
:
enable and restart named.service
-
name
:
"
Purge
DDNS
Updates"
ansible.builtin.file
:
path
:
/etc/bind/db.warpzone.lan.jnl
state
:
absent
-
name
:
"
Enable
and
restart
named.service"
systemd
:
systemd
:
name
:
"
named.service"
name
:
"
named.service"
state
:
restarted
state
:
restarted
enabled
:
True
enabled
:
True
-
name
:
"
Get
all
active
leases
from
Kea"
uri
:
url
:
"
http://127.0.0.1:8000"
method
:
POST
user
:
"
kea-api"
password
:
"
{{
kea_api_password
}}"
body_format
:
json
body
:
command
:
"
lease4-get-all"
service
:
[
"
dhcp4"
]
headers
:
Content-Type
:
"
application/json"
register
:
all_leases
-
name
:
"
Display
number
of
leases
found"
debug
:
msg
:
"
Found
{{
all_leases.json[0].arguments.leases
|
length
}}
active
leases"
-
name
:
"
Force
DDNS
update
for
each
lease"
uri
:
url
:
"
http://127.0.0.1:8000"
method
:
POST
user
:
"
kea-api"
password
:
"
{{
kea_api_password
}}"
body_format
:
json
body
:
command
:
"
lease4-resend-ddns"
service
:
[
"
dhcp4"
]
arguments
:
ip-address
:
"
{{
item['ip-address']
}}"
headers
:
Content-Type
:
"
application/json"
loop
:
"
{{
all_leases.json[0].arguments.leases
}}"
register
:
ddns_results
when
:
-
all_leases.json[0].arguments.leases is defined
-
item.hostname is defined
-
item.hostname != ""
-
item['ip-address'] is defined
-
item['ip-address'] != ""
This diff is collapsed.
Click to expand it.
webserver/docker_icinga/templates/etc/icinga/conf.d/services_manual.conf
+
42
−
0
View file @
2a09fc8c
...
@@ -11,6 +11,48 @@ apply Service "warpfire-admin" {
...
@@ -11,6 +11,48 @@ apply Service "warpfire-admin" {
assign
where
host
.
name
==
"warpfire"
assign
where
host
.
name
==
"warpfire"
}
}
apply
Service
"dhcpinfo-web"
{
import
"generic-service"
check_command
=
"http"
enable_perfdata
=
false
vars
.
http_address
=
"$host.address$"
vars
.
http_port
=
80
assign
where
host
.
name
==
"dhcpdns"
}
apply
Service
"dhcpinfo-connected"
{
import
"generic-service"
check_command
=
"check_metric_value"
enable_perfdata
=
true
vars
.
metric_url
=
"http://{{ hostvars['dhcpdns'].int_ip4 }}/metrics"
vars
.
metric_name
=
"kea_connection_ok"
vars
.
metric_operator
=
"lt"
vars
.
metric_warn
=
"1"
vars
.
metric_crit
=
"1"
assign
where
host
.
name
==
"dhcpdns"
}
apply
Service
"dhcpinfo-leases"
{
import
"generic-service"
check_command
=
"check_metric_value"
enable_perfdata
=
true
vars
.
metric_url
=
"http://{{ hostvars['dhcpdns'].int_ip4 }}/metrics"
vars
.
metric_name
=
"kea_total_leases"
vars
.
metric_operator
=
"lt"
vars
.
metric_warn
=
"25"
vars
.
metric_crit
=
"1"
assign
where
host
.
name
==
"dhcpdns"
}
apply
Service
"wz-uplink-globe"
{
apply
Service
"wz-uplink-globe"
{
import
"generic-service"
import
"generic-service"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment