Merge branch 'master' of ssh://git.paulbsd.com:2222/paulbsd/paulbsd-salt
This commit is contained in:
commit
ec0c1d6642
@ -27,7 +27,8 @@ def get_apikey(configfile="/root/.config/syncthing/config.xml"):
|
||||
|
||||
return None
|
||||
|
||||
def get_config(url="http://localhost:8384", verify=False, apikey=""):
|
||||
|
||||
def get_config(url="http://localhost:8384", verify=False, apikey=None):
|
||||
try:
|
||||
apikey = get_apikey()
|
||||
except:
|
||||
@ -47,7 +48,9 @@ def get_config(url="http://localhost:8384", verify=False, apikey=""):
|
||||
|
||||
return None
|
||||
|
||||
def set_config_options(url="http://localhost:8384", verify=False, apikey=get_apikey(), options={}):
|
||||
def set_config_options(url="http://localhost:8384", verify=False, apikey=None, options={}):
|
||||
if not apikey:
|
||||
apikey = get_apikey()
|
||||
fullurl = f"{url}/rest/config/options"
|
||||
req = Request(method="PUT",
|
||||
url=fullurl,
|
||||
@ -68,7 +71,9 @@ def set_config_options(url="http://localhost:8384", verify=False, apikey=get_api
|
||||
|
||||
return None
|
||||
|
||||
def set_config_gui(url="http://localhost:8384", verify=False, apikey=get_apikey(), gui={}):
|
||||
def set_config_gui(url="http://localhost:8384", verify=False, apikey=None, gui={}):
|
||||
if not apikey:
|
||||
apikey = get_apikey()
|
||||
fullurl = f"{url}/rest/config/gui"
|
||||
req = Request(method="PUT",
|
||||
url=fullurl,
|
||||
@ -92,7 +97,9 @@ def set_config_gui(url="http://localhost:8384", verify=False, apikey=get_apikey(
|
||||
return None
|
||||
|
||||
## deprecated
|
||||
def _set_config(url="http://localhost:8384", verify=False, apikey=get_apikey(), config={}):
|
||||
def _set_config(url="http://localhost:8384", verify=False, apikey=None, config={}):
|
||||
if not apikey:
|
||||
apikey = get_apikey()
|
||||
fullurl = f"{url}/rest/config"
|
||||
req = Request(method="POST",
|
||||
url=fullurl,
|
||||
@ -113,7 +120,9 @@ def _set_config(url="http://localhost:8384", verify=False, apikey=get_apikey(),
|
||||
|
||||
return None
|
||||
|
||||
def insync(url="http://localhost:8384", verify=False, apikey=get_apikey()):
|
||||
def insync(url="http://localhost:8384", verify=False, apikey=None):
|
||||
if not apikey:
|
||||
apikey = get_apikey()
|
||||
fullurl = f"{url}/rest/config/restart-required"
|
||||
req = Request(method="GET",
|
||||
url=fullurl)
|
||||
@ -128,7 +137,9 @@ def insync(url="http://localhost:8384", verify=False, apikey=get_apikey()):
|
||||
|
||||
return None
|
||||
|
||||
def restart(url="http://localhost:8384", verify=False, apikey=get_apikey()):
|
||||
def restart(url="http://localhost:8384", verify=False, apikey=None):
|
||||
if not apikey:
|
||||
apikey = get_apikey()
|
||||
fullurl = f"{url}/rest/system/restart"
|
||||
req = Request(method="POST",
|
||||
url=fullurl)
|
||||
|
@ -23,7 +23,7 @@ vector-config-dir:
|
||||
- name: /etc/vector
|
||||
- user: {{ vector.user.name }}
|
||||
- group: {{ vector.group.name }}
|
||||
- mode: 700
|
||||
- mode: 755
|
||||
- watch_in:
|
||||
- service: vector-service
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user