diff --git a/.gitmodules b/.gitmodules index a032300..6529427 100644 --- a/.gitmodules +++ b/.gitmodules @@ -58,9 +58,6 @@ [submodule "roles/l3d.packages"] path = roles/l3d.packages url = https://github.com/roles-ansible/ansible_role_packages.git -[submodule "roles/l3d.gopass"] - path = roles/l3d.gopass - url = https://github.com/roles-ansible/ansible_role_gopass.git [submodule "roles/l3d.etesync_dav"] path = roles/l3d.etesync_dav url = https://github.com/roles-ansible/ansible_role_etesync_dav.git @@ -73,3 +70,6 @@ [submodule "collections/ansible_collections/l3d/wm"] path = collections/ansible_collections/l3d/wm url = https://github.com/roles-ansible/ansible_collection_wm.git +[submodule "roles/roles-ansible.gopass"] + path = roles/roles-ansible.gopass + url = https://github.com/roles-ansible/ansible_role_gopass.git diff --git a/inventory.py b/inventory.py index a2a23ba..f09b2d0 100755 --- a/inventory.py +++ b/inventory.py @@ -7,10 +7,12 @@ import socket import sys import json +INIT_HOST=False + # create a dict to match hostnames to enviroments env_dict = { 'work': - ['workstation.local', 'daringdoo.local'], + [], 'private': ['derpy.local', 'applejack.local', 'rarity.local', 'discord.local'] } @@ -44,6 +46,8 @@ def env(domain): for key, values in env_dict.items(): if domain in values: return key + if INIT_HOST: + return str('init') print(json.dumps(empty_host_list(domain), sort_keys=True, indent=2)) sys.exit() @@ -59,8 +63,10 @@ def hostvars(host, group): """ set variables to local connection """ - local = str('"' + host + '": {"ansible_connection": "local", ' - + str(become_pass(host, group)) + '}') + local = str('"' + host + '": {"ansible_connection": "local"') + if not INIT_HOST: + local += str(', ' + str(become_pass(host, group))) + local += str('}') return local def formated_host_group_list(host, group): diff --git a/roles/l3d.gopass b/roles/l3d.gopass deleted file mode 160000 index bf76fcc..0000000 --- a/roles/l3d.gopass +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bf76fcc81e5687009d6897b1a80e8f5d19b9ab47 diff --git a/roles/roles-ansible.gopass b/roles/roles-ansible.gopass new file mode 160000 index 0000000..034a8cd --- /dev/null +++ b/roles/roles-ansible.gopass @@ -0,0 +1 @@ +Subproject commit 034a8cd8e1dc151f610a161249cd5ac68846521c diff --git a/site.yml b/site.yml index 73b1652..b528674 100644 --- a/site.yml +++ b/site.yml @@ -4,8 +4,13 @@ roles: - {role: ansible_version, tags: always} -- name: Generic Workstation Preperation +- name: Setup GoPass hosts: all + roles: + - {role: roles-ansible.gopass, tags: gopass} + +- name: Generic Workstation Preperation + hosts: [work, private] roles: - {role: l3d.users.user, tags: user} - {role: l3d.users.admin, tags: admin} @@ -13,7 +18,7 @@ - {role: l3d.users.dotfiles, tags: dotfiles} - name: Generic Workstation Preperation - hosts: all + hosts: [work, private] roles: - {role: l3d.packages, tags: [packages, apt]} - {role: l3d.time.ntp, tags: ntp} @@ -21,7 +26,6 @@ - {role: l3d.avahi.daemon, tags: avahi} - {role: l3d.etesync_dav, tags: [etebase, etesync, dav]} - {role: gantsign.bat, tags: bat} - - {role: l3d.gopass, tags: gopass} - {role: l3d.wm.i3, tags: i3wm} - {role: l3d.wm.sway, tags: sway} # - {role: amdgpu_firmware, tags: firmware}