1
0
Fork 0
mirror of https://github.com/DO1JLR/ansible_linux_desktop_setup.git synced 2024-09-14 19:54:51 +02:00

use a local connection

This commit is contained in:
L3D 2022-07-16 00:36:15 +02:00
parent 7b3c17136a
commit ba060af753
Signed by: l3d
GPG key ID: CD08445BFF4313D1
4 changed files with 15 additions and 6 deletions

3
.gitmodules vendored
View file

@ -67,3 +67,6 @@
[submodule "roles/do1jlr.i3wm"]
path = roles/do1jlr.i3wm
url = https://github.com/roles-ansible/ansible_role_i3wm.git
[submodule "roles/do1jlr.htop"]
path = roles/do1jlr.htop
url = https://github.com/roles-ansible/ansible_role_htop.git

View file

@ -1,11 +1,9 @@
[defaults]
inventory = ./inventory.py
retry_files_enabled = False
nocows = True
ansible_connection = 'local'
retry_files_enabled = false
nocows = true
transport = local
[privilege_escalation]
become_method = sudo
become_user = root
become_ask_pass = False

View file

@ -43,12 +43,19 @@ def empty_host_list(domain):
return json.loads('{"_meta": {"comment": "' + comment +
'", "hostvars": {}}, "instances": {"hosts": []}}')
def hostvars(host):
"""
set variables to local connection
"""
local = str('"' + host + '": {"ansible_connection": "local"}')
return local
def formated_host_group_list(host, group):
"""
build inventory and return it
"""
# pylint: disable=line-too-long
return json.loads('{"_meta": {"hostvars": {}},"' + str(group) + '": {"hosts": ["' + str(host) + '"]},"instances": {"children": ["' + str(group) + '"]}}')
return json.loads('{"_meta": {"hostvars": {' + str(hostvars(host)) + '}},"' + str(group) + '": {"hosts": ["' + str(host) + '"]},"instances": {"children": ["' + str(group) + '"]}}')
def main():
"""

1
roles/do1jlr.htop Submodule

@ -0,0 +1 @@
Subproject commit b79f3331976035cfe3a9c163ebe1ca32d85aee33