added bacula-conf.py
configure and restart bacula-fd
This commit is contained in:
parent
284f7fbf25
commit
3ad8b29178
@ -7,7 +7,6 @@ import argparse
|
|||||||
parser = argparse.ArgumentParser(description='Process some integers.')
|
parser = argparse.ArgumentParser(description='Process some integers.')
|
||||||
parser.add_argument('-d', '--debug', dest='debug', action='store_true',
|
parser.add_argument('-d', '--debug', dest='debug', action='store_true',
|
||||||
help='debug: show what would be sent')
|
help='debug: show what would be sent')
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
hostname = socket.gethostname()
|
hostname = socket.gethostname()
|
||||||
@ -17,7 +16,6 @@ ip = socket.gethostbyname(hostname)
|
|||||||
|
|
||||||
API_ENDPOINT = "http://192.168.0.140:5000/register"
|
API_ENDPOINT = "http://192.168.0.140:5000/register"
|
||||||
|
|
||||||
|
|
||||||
def get_ip():
|
def get_ip():
|
||||||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||||
try:
|
try:
|
||||||
@ -42,7 +40,7 @@ elif platform.system() == "Linux":
|
|||||||
else:
|
else:
|
||||||
raise ValueError
|
raise ValueError
|
||||||
|
|
||||||
if not fqdn.endswith(".liebchen.fkp"):
|
if not "." in fqdn:
|
||||||
fqdn += ".liebchen.fkp"
|
fqdn += ".liebchen.fkp"
|
||||||
|
|
||||||
data = {
|
data = {
|
||||||
|
@ -41,11 +41,13 @@
|
|||||||
apt:
|
apt:
|
||||||
name: bacula-fd
|
name: bacula-fd
|
||||||
default_release: jammy-proposed
|
default_release: jammy-proposed
|
||||||
|
|
||||||
- name: Install script for bacula-fd configuration
|
- name: Install script for bacula-fd configuration
|
||||||
copy:
|
copy:
|
||||||
src: bacula-conf.py
|
src: bacula-conf.py
|
||||||
dest: /usr/local/bin/bacula-conf.py
|
dest: /usr/local/bin/bacula-conf.py
|
||||||
mode: 0700
|
mode: 0700
|
||||||
|
|
||||||
- name: run configuration for bacula-fd
|
- name: run configuration for bacula-fd
|
||||||
command: /usr/local/bin/bacula-conf.py
|
command: /usr/local/bin/bacula-conf.py
|
||||||
- name: Restart service bacula-fd
|
- name: Restart service bacula-fd
|
||||||
|
Loading…
Reference in New Issue
Block a user