added bacula-conf.py

configure and restart bacula-fd
This commit is contained in:
Markus Rosenstihl 2024-02-10 17:25:42 +01:00
parent 284f7fbf25
commit 3ad8b29178
2 changed files with 3 additions and 3 deletions

View File

@ -7,7 +7,6 @@ import argparse
parser = argparse.ArgumentParser(description='Process some integers.')
parser.add_argument('-d', '--debug', dest='debug', action='store_true',
help='debug: show what would be sent')
args = parser.parse_args()
hostname = socket.gethostname()
@ -17,7 +16,6 @@ ip = socket.gethostbyname(hostname)
API_ENDPOINT = "http://192.168.0.140:5000/register"
def get_ip():
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
try:
@ -42,7 +40,7 @@ elif platform.system() == "Linux":
else:
raise ValueError
if not fqdn.endswith(".liebchen.fkp"):
if not "." in fqdn:
fqdn += ".liebchen.fkp"
data = {

View File

@ -41,11 +41,13 @@
apt:
name: bacula-fd
default_release: jammy-proposed
- name: Install script for bacula-fd configuration
copy:
src: bacula-conf.py
dest: /usr/local/bin/bacula-conf.py
mode: 0700
- name: run configuration for bacula-fd
command: /usr/local/bin/bacula-conf.py
- name: Restart service bacula-fd