From 7e1348e5395068926b367af3d06d0a1dfeeb5c03 Mon Sep 17 00:00:00 2001 From: L3D Date: Sat, 11 Jun 2022 15:12:13 +0200 Subject: [PATCH 01/18] update submodules --- roles/bat | 2 +- roles/do1jlr.sshd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/bat b/roles/bat index f49dba9..1b4d972 160000 --- a/roles/bat +++ b/roles/bat @@ -1 +1 @@ -Subproject commit f49dba9f447ae01a73d61bf582b68585e4414d5b +Subproject commit 1b4d9721d1b6a0d1b0786fd5f46409df11b34d07 diff --git a/roles/do1jlr.sshd b/roles/do1jlr.sshd index 878f405..15b7867 160000 --- a/roles/do1jlr.sshd +++ b/roles/do1jlr.sshd @@ -1 +1 @@ -Subproject commit 878f405dfc4056132e445bdd7322029f55ec1e32 +Subproject commit 15b7867a37e4036947de29c727075c4a75859e43 From b44d717ed952a49ff164e250d2744eb540089042 Mon Sep 17 00:00:00 2001 From: L3D Date: Sun, 12 Jun 2022 22:36:35 +0200 Subject: [PATCH 02/18] start adding inventory --- inventory.py | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 inventory.py diff --git a/inventory.py b/inventory.py new file mode 100755 index 0000000..7b51fe4 --- /dev/null +++ b/inventory.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +Create a dynamic inventory for this ansible playbook +""" +import socket +import sys + +# create a dict to match hostnames to enviroments +env_dict = { + 'work': + ['workstation.local'], + 'private': + ['dderpy.local', 'foo.bar'] +} + +def fqdn(): + """ + return fully qualified domain name + """ + return socket.getfqdn() + +def env(domain): + """ + map a hostname to a space + """ + for key, values in env_dict.items(): + if domain in values: + return key + sys.exit('{"group": { "hosts": ["example.com"], "vars": {} }, "_meta": { "foo": "bar" }}') + + +def main(): + """ + main funktion + will analyse on which host this script is started + and will print the dynamic inventory to tell ansible + which host_vars and group_vars should be used + """ + host = fqdn() + group = env(host) + print(host + group) +# { +# "group": +# { "hosts": ["127.0.0.1", "::1"], "vars": {} }, +# "_meta": +# { "hostvars": { "192.168.28.71": { "host_specific_var": "bar" }, +# "192.168.28.72": { "host_specific_var": "foo" }} } +# } + +main() From 293cff26497657d933a6572f1e6107bdd778d9f6 Mon Sep 17 00:00:00 2001 From: L3D Date: Sat, 18 Jun 2022 13:16:59 +0200 Subject: [PATCH 03/18] successful return empty inv --- inventory.py | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/inventory.py b/inventory.py index 7b51fe4..609b0e7 100755 --- a/inventory.py +++ b/inventory.py @@ -5,6 +5,7 @@ Create a dynamic inventory for this ansible playbook """ import socket import sys +import json # create a dict to match hostnames to enviroments env_dict = { @@ -27,8 +28,16 @@ def env(domain): for key, values in env_dict.items(): if domain in values: return key - sys.exit('{"group": { "hosts": ["example.com"], "vars": {} }, "_meta": { "foo": "bar" }}') + print(json.dumps(empty_host_list(), sort_keys=True, indent=2)) + sys.exit() +def empty_host_list(): + """ + return empty host list + """ + comment = "No valid host found. returning empty host list!" + return json.loads('{"_meta": {"comment": "' + comment + + '", "hostvars": {}}, "instances": {"hosts": []}}') def main(): """ @@ -40,12 +49,14 @@ def main(): host = fqdn() group = env(host) print(host + group) -# { -# "group": -# { "hosts": ["127.0.0.1", "::1"], "vars": {} }, -# "_meta": -# { "hostvars": { "192.168.28.71": { "host_specific_var": "bar" }, -# "192.168.28.72": { "host_specific_var": "foo" }} } +#{ +# "_meta": { +# "hostvars": { } +# }, +# +# "instances": { +# "hosts": ["10.66.70.33"] +# } # } main() From c23aafa008f00c49a8d17901b61a33d8b635ccd1 Mon Sep 17 00:00:00 2001 From: L3D Date: Sat, 18 Jun 2022 13:45:34 +0200 Subject: [PATCH 04/18] update linting --- inventory.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/inventory.py b/inventory.py index 609b0e7..d119343 100755 --- a/inventory.py +++ b/inventory.py @@ -12,7 +12,7 @@ env_dict = { 'work': ['workstation.local'], 'private': - ['dderpy.local', 'foo.bar'] + ['derpy.local', 'foo.bar'] } def fqdn(): @@ -24,6 +24,7 @@ def fqdn(): def env(domain): """ map a hostname to a space + or print empty list if no one matched and exit """ for key, values in env_dict.items(): if domain in values: @@ -39,6 +40,13 @@ def empty_host_list(): return json.loads('{"_meta": {"comment": "' + comment + '", "hostvars": {}}, "instances": {"hosts": []}}') +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) + '"]}}') + def main(): """ main funktion @@ -48,7 +56,10 @@ def main(): """ host = fqdn() group = env(host) - print(host + group) + print(json.dumps(formated_host_group_list(host, group), sort_keys=True, indent=2)) + + + #{ # "_meta": { # "hostvars": { } From 75609fb2a398d908a4abe94b8f13daad04a0ae63 Mon Sep 17 00:00:00 2001 From: L3D Date: Sat, 18 Jun 2022 14:22:12 +0200 Subject: [PATCH 05/18] automated linting --- .github/workflows/pylint.yml | 15 +++++++++++++++ .github/workflows/yamllint.yaml | 2 -- setup_desk_minni.yml | 4 ++-- setup_l14.yml | 4 ++-- setup_t460p.yml | 2 +- 5 files changed, 20 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/pylint.yml diff --git a/.github/workflows/pylint.yml b/.github/workflows/pylint.yml new file mode 100644 index 0000000..876c6ad --- /dev/null +++ b/.github/workflows/pylint.yml @@ -0,0 +1,15 @@ +--- +name: 'Pylint GitHub Actions' + +# yamllint disable-line rule:truthy +on: [push, pull_request] + +jobs: + pylint: + name: 'Pylint' + runs-on: ubuntu-latest + steps: + - name: 'Checkout' + uses: actions/checkout@master + - name: GitHub Action for pylint + uses: cclauss/GitHub-Action-for-pylint@0.7.0 diff --git a/.github/workflows/yamllint.yaml b/.github/workflows/yamllint.yaml index 39c49f8..c4894bd 100644 --- a/.github/workflows/yamllint.yaml +++ b/.github/workflows/yamllint.yaml @@ -18,5 +18,3 @@ jobs: yamllint_config_filepath: './.yamllint' yamllint_strict: false yamllint_comment: true -# env: -# GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN } diff --git a/setup_desk_minni.yml b/setup_desk_minni.yml index 3a573a0..dec07ef 100644 --- a/setup_desk_minni.yml +++ b/setup_desk_minni.yml @@ -21,7 +21,7 @@ hosts: desk_minni.local roles: - {role: akku-warning, tags: akku} - # - {role: pulseaudio, tags: [pulse, audio, pulseaudio]} + # - {role: pulseaudio, tags: [pulse, audio, pulseaudio]} - {role: networkmanager, tags: networkmanager, when: ansible_os_family == 'Archlinux'} - {role: openvpn, tags: ovpn} - {role: nextcloud, tags: nextcloud, when: ansible_os_family == 'Archlinux'} @@ -32,7 +32,7 @@ - {role: ntp, tags: ntp} - {role: xrandr, tags: xrandr} - {role: arch-fonts, tags: fonts} - # - {role: winehq, tags: wine} + # - {role: winehq, tags: wine} - {role: no-sleep, tags: sleep} - {role: do1jlr.avahi_daemon, tags: [avahi_daemon, avahi]} - {role: do1jlr.avahi_client, tags: [avahi_client, mdns]} diff --git a/setup_l14.yml b/setup_l14.yml index e87c712..3fc3975 100644 --- a/setup_l14.yml +++ b/setup_l14.yml @@ -22,7 +22,7 @@ hosts: l14.local roles: - {role: akku-warning, tags: akku} -# - {role: pulseaudio, tags: [pulse, audio, pulseaudio]} + # - {role: pulseaudio, tags: [pulse, audio, pulseaudio]} - {role: networkmanager, tags: networkmanager, when: ansible_os_family == 'Archlinux'} - {role: openvpn, tags: ovpn} - {role: nextcloud, tags: nextcloud, when: ansible_os_family == 'Archlinux'} @@ -33,7 +33,7 @@ - {role: ntp, tags: ntp} - {role: xrandr, tags: xrandr} - {role: arch-fonts, tags: fonts} -# - {role: winehq, tags: wine} + # - {role: winehq, tags: wine} - {role: no-sleep, tags: sleep} - {role: do1jlr.avahi_daemon, tags: [avahi_daemon, avahi]} - {role: do1jlr.avahi_client, tags: [avahi_client, mdns]} diff --git a/setup_t460p.yml b/setup_t460p.yml index 6bf5acf..00f38a8 100644 --- a/setup_t460p.yml +++ b/setup_t460p.yml @@ -21,7 +21,7 @@ hosts: t460p.local roles: - {role: akku-warning, tags: akku} -# - {role: pulseaudio, tags: [pulse, audio, pulseaudio]} + # - {role: pulseaudio, tags: [pulse, audio, pulseaudio]} - {role: networkmanager, tags: networkmanager, when: ansible_os_family == 'Archlinux'} - {role: openvpn, tags: ovpn} - {role: nextcloud, tags: nextcloud, when: ansible_os_family == 'Archlinux'} From 4c11fabaee8eabe8ff8d03f01b131a0775949d06 Mon Sep 17 00:00:00 2001 From: L3D Date: Sat, 18 Jun 2022 14:40:06 +0200 Subject: [PATCH 06/18] Start rewriting README --- README.md | 16 ++++++++++------ ansible.cfg | 2 +- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 90b1e27..f174d10 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,20 @@ Ansible Linux Desktop Setup ========================== -This ansible playbook collection creates [L3D](https://chaos.social/@l3d)s Desktop enviroment. Including window manager and some pre-installed programms like [Firefox](https://www.mozilla.org/de/firefox/new/) and some usefull shell programms. +This ansible playbook collection manages some of my workstations and laptops. Because of this it sometimes contains very specific variables like my username, SSH keys or similar data that may not be the best choice for your system. - ATTENTION +Nevertheless, this ansible playbook is not only publicly available on the internet, but by the MIT license a part of free open-source ansible, which may serve you as inspiration within the framework of the MIT license. + + + Inventory ------------- -Different to my other ansible playbooks: +This is my first ansible with dynamic inventory. The [inventory.py](inventory.py) script looks at which hostname it was lauched on. If the hostname is known, the host is mapped to the group stored for it and a local connection to the host is established. -### THIS PLAYBOOK HAS TO BE EXECUTET AT THE TARGET HOST DIRECTLY! +This has the advantage that different environments are automatically recognized and significantly less danger of accidentally rolling out the ansible with the variables for a completely different host and thus configuring things that were not intended for this device. -*It requires some GUI stuff and I did not find the time to forward X or wayland correctly to make it remotely working. Sorry. Feel free to create a Issue or pull-request* +Obviously, this also means that **this playbook must always be run on the host you want to manage** and this ansible playbook is not meant to be run remotely. - Install tipps: + +Install tipps: ----------------------- ```bash # Clone Git diff --git a/ansible.cfg b/ansible.cfg index 0578235..51c1513 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -1,5 +1,5 @@ [defaults] -inventory = ./hosts.ini +inventory = ./inventory.py retry_files_enabled = False nocows = True ansible_connection = 'local' From e1e42c8cfe1779a1a5dc04b8bc9e0bffeea46b45 Mon Sep 17 00:00:00 2001 From: L3D Date: Sun, 26 Jun 2022 01:18:16 +0200 Subject: [PATCH 07/18] update submodules --- roles/bat | 2 +- roles/do1jlr.sshd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/bat b/roles/bat index f49dba9..1b4d972 160000 --- a/roles/bat +++ b/roles/bat @@ -1 +1 @@ -Subproject commit f49dba9f447ae01a73d61bf582b68585e4414d5b +Subproject commit 1b4d9721d1b6a0d1b0786fd5f46409df11b34d07 diff --git a/roles/do1jlr.sshd b/roles/do1jlr.sshd index 878f405..15b7867 160000 --- a/roles/do1jlr.sshd +++ b/roles/do1jlr.sshd @@ -1 +1 @@ -Subproject commit 878f405dfc4056132e445bdd7322029f55ec1e32 +Subproject commit 15b7867a37e4036947de29c727075c4a75859e43 From 55a693da8642f62366d60d95fef2142c6d8dc41f Mon Sep 17 00:00:00 2001 From: L3D Date: Sun, 26 Jun 2022 02:31:29 +0200 Subject: [PATCH 08/18] update inventory --- inventory.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/inventory.py b/inventory.py index d119343..7dc3294 100755 --- a/inventory.py +++ b/inventory.py @@ -12,7 +12,7 @@ env_dict = { 'work': ['workstation.local'], 'private': - ['derpy.local', 'foo.bar'] + ['derpy.local', 'applejack.local'] } def fqdn(): @@ -29,14 +29,14 @@ def env(domain): for key, values in env_dict.items(): if domain in values: return key - print(json.dumps(empty_host_list(), sort_keys=True, indent=2)) + print(json.dumps(empty_host_list(domain), sort_keys=True, indent=2)) sys.exit() -def empty_host_list(): +def empty_host_list(domain): """ return empty host list """ - comment = "No valid host found. returning empty host list!" + comment = f"No valid host found. Found '{domain}'. Return empty host list!" return json.loads('{"_meta": {"comment": "' + comment + '", "hostvars": {}}, "instances": {"hosts": []}}') From 7b3c17136a033105bad24df0afae64751eccf848 Mon Sep 17 00:00:00 2001 From: L3D Date: Wed, 6 Jul 2022 18:13:26 +0200 Subject: [PATCH 09/18] update inventory creation --- inventory.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/inventory.py b/inventory.py index 7dc3294..3f79ce5 100755 --- a/inventory.py +++ b/inventory.py @@ -10,7 +10,7 @@ import json # create a dict to match hostnames to enviroments env_dict = { 'work': - ['workstation.local'], + ['workstation.local', 'daringdoo.local'], 'private': ['derpy.local', 'applejack.local'] } @@ -19,7 +19,10 @@ def fqdn(): """ return fully qualified domain name """ - return socket.getfqdn() + hostname = socket.gethostname() + if '.' not in hostname: + hostname = f"{hostname}.local" + return str(hostname) def env(domain): """ From ba060af75393bfd70c85694762d34ecbe3a3b35e Mon Sep 17 00:00:00 2001 From: L3D Date: Sat, 16 Jul 2022 00:36:15 +0200 Subject: [PATCH 10/18] use a local connection --- .gitmodules | 3 +++ ansible.cfg | 8 +++----- inventory.py | 9 ++++++++- roles/do1jlr.htop | 1 + 4 files changed, 15 insertions(+), 6 deletions(-) create mode 160000 roles/do1jlr.htop diff --git a/.gitmodules b/.gitmodules index 3419572..48c9950 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 diff --git a/ansible.cfg b/ansible.cfg index 51c1513..4cdf9f4 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -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 - diff --git a/inventory.py b/inventory.py index 3f79ce5..bb6f34b 100755 --- a/inventory.py +++ b/inventory.py @@ -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(): """ diff --git a/roles/do1jlr.htop b/roles/do1jlr.htop new file mode 160000 index 0000000..b79f333 --- /dev/null +++ b/roles/do1jlr.htop @@ -0,0 +1 @@ +Subproject commit b79f3331976035cfe3a9c163ebe1ca32d85aee33 From 7fa8ce0d2d1710a32c04a4ebfe6766f696177309 Mon Sep 17 00:00:00 2001 From: L3D Date: Sat, 16 Jul 2022 02:27:32 +0200 Subject: [PATCH 11/18] update htop role parameters --- ansible.cfg | 1 + group_vars/all.yml | 2 ++ roles/do1jlr.htop | 2 +- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ansible.cfg b/ansible.cfg index 4cdf9f4..d9d5c2a 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -3,6 +3,7 @@ inventory = ./inventory.py retry_files_enabled = false nocows = true transport = local +interpreter_python = /usr/bin/python3 [privilege_escalation] become_method = sudo diff --git a/group_vars/all.yml b/group_vars/all.yml index 3986ddd..29d1e9d 100644 --- a/group_vars/all.yml +++ b/group_vars/all.yml @@ -68,5 +68,7 @@ i3_run_on_startup: # - nextcloud - sudo nm-applet +htop__compile: true + # globaly enably simple versionscheck - if available submodules_versioncheck: true diff --git a/roles/do1jlr.htop b/roles/do1jlr.htop index b79f333..46a2dde 160000 --- a/roles/do1jlr.htop +++ b/roles/do1jlr.htop @@ -1 +1 @@ -Subproject commit b79f3331976035cfe3a9c163ebe1ca32d85aee33 +Subproject commit 46a2dde4efe40245f461cac542c0b3993a833850 From 5bdfbe274bf6e8dd39887b6bf3880449bbe66773 Mon Sep 17 00:00:00 2001 From: L3D Date: Sun, 2 Apr 2023 22:28:43 +0200 Subject: [PATCH 12/18] update dev --- .gitignore | 1 + README.md | 9 +++++++++ inventory.py | 2 +- roles/ansible_version | 2 +- roles/bat | 2 +- roles/ntp | 2 +- site.yml | 44 ++++++++++++++++++++++--------------------- 7 files changed, 37 insertions(+), 25 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b83b53f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +ansible/ diff --git a/README.md b/README.md index f174d10..46c84ab 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,15 @@ git submodule update --init --recursive # make sure you always check out the submodules git config --global submodule.recurse true + +# Install Ansible in venv +python3 -m venv ansible + +# Activate Venv +source ansible/bin/activate + +# Install Ansible +pip3 install ansible-core ``` Which playbook? diff --git a/inventory.py b/inventory.py index bb6f34b..0487250 100755 --- a/inventory.py +++ b/inventory.py @@ -12,7 +12,7 @@ env_dict = { 'work': ['workstation.local', 'daringdoo.local'], 'private': - ['derpy.local', 'applejack.local'] + ['derpy.local', 'applejack.local', 'rarity.local'] } def fqdn(): diff --git a/roles/ansible_version b/roles/ansible_version index ef4cf76..2bf5d7c 160000 --- a/roles/ansible_version +++ b/roles/ansible_version @@ -1 +1 @@ -Subproject commit ef4cf763795d61e883b1867f4a3149568d4acb2d +Subproject commit 2bf5d7c4369a8213b42829b14f78920e9906d099 diff --git a/roles/bat b/roles/bat index 1b4d972..b263e5e 160000 --- a/roles/bat +++ b/roles/bat @@ -1 +1 @@ -Subproject commit 1b4d9721d1b6a0d1b0786fd5f46409df11b34d07 +Subproject commit b263e5e140ee3c5e868f9392b2e4a2eaa37eaf79 diff --git a/roles/ntp b/roles/ntp index 4bf1dbd..8d33019 160000 --- a/roles/ntp +++ b/roles/ntp @@ -1 +1 @@ -Subproject commit 4bf1dbdffe7b675fad8e32286d892d6c5cfe834f +Subproject commit 8d330190c4052981bdb146136dc7f41071a66289 diff --git a/site.yml b/site.yml index 6cc0d3f..ebf5567 100644 --- a/site.yml +++ b/site.yml @@ -7,26 +7,28 @@ - name: run do1jlr.base setup roles hosts: localhost roles: - - {role: do1jlr.base, tags: [default, packages, base]} - - {role: workstation_packages, tags: [default, workstation_packages, packages, setup]} + #- {role: do1jlr.base, tags: [default, packages, base]} + #- {role: workstation_packages, tags: [default, workstation_packages, packages, setup]} - {role: ntp, tags: ntp} - - {role: arch-fonts, tags: [font, fonts, arch-fonts]} + - {role: do1jlr.avahi_client, tags: avahi} + - {role: do1jlr.avahi_daemon, tags: avahi} + #- {role: arch-fonts, tags: [font, fonts, arch-fonts]} -- name: user specific setup - hosts: localhost - roles: - - {role: dotfiles, tags: [default, dotfiles, fancy]} - - {role: manage_users, tags: [ssh, manage, manage_users]} - - {role: authorized_keys, tags: [ssh, auth, authorized_keys]} - - {role: sshd, tags: [ssh, sshd]} - - {role: akku-warning, tags: [akku, akku_warning, akku-warning]} - - {role: pulseaudio, tags: pulseaudio} - - {role: networkmanager, tags: [nm, networkmanager]} - - {role: copy_files} - - {role: do1jlr.i3wm, tags: i3wm} - - {role: xrandr, tags: xrandr} - - {role: install-firefox, tags: firefox} - - {role: nextcloud, tags: nextcloud} - - {role: openvpn, tags: openvpn} - - {role: winehq, tags: [wine, winehq]} - - {role: no-sleep, tags: no_sleep} +#- name: user specific setup +# hosts: localhost +# roles: + #- {role: dotfiles, tags: [default, dotfiles, fancy]} + #- {role: manage_users, tags: [ssh, manage, manage_users]} + #- {role: authorized_keys, tags: [ssh, auth, authorized_keys]} + #- {role: sshd, tags: [ssh, sshd]} + #- {role: akku-warning, tags: [akku, akku_warning, akku-warning]} + #- {role: pulseaudio, tags: pulseaudio} + #- {role: networkmanager, tags: [nm, networkmanager]} + #- {role: copy_files} + #- {role: do1jlr.i3wm, tags: i3wm} + # - {role: xrandr, tags: xrandr} + #- {role: install-firefox, tags: firefox} + #- {role: nextcloud, tags: nextcloud} + #- {role: openvpn, tags: openvpn} + #- {role: winehq, tags: [wine, winehq]} + #- {role: no-sleep, tags: no_sleep} From 8f48aa768d74ab16a7bba871df7da3230ef0d148 Mon Sep 17 00:00:00 2001 From: L3D Date: Thu, 13 Apr 2023 23:10:00 +0200 Subject: [PATCH 13/18] Uptimize for gopass usage --- .gitmodules | 38 ++++++++++++++++--- README.md | 4 ++ ansible.cfg | 3 ++ .../ansible_collections/community/general | 1 + inventory.py | 21 ++++------ site.yml | 15 ++++++-- 6 files changed, 61 insertions(+), 21 deletions(-) create mode 160000 collections/ansible_collections/community/general diff --git a/.gitmodules b/.gitmodules index 48c9950..a95c1bd 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,72 +1,100 @@ [submodule "roles/workstation_packages"] path = roles/workstation_packages url = https://github.com/chaos-bodensee/role_install_workstaton_packages.git + branch = master [submodule "roles/dotfiles"] path = roles/dotfiles - url = https://github.com/chaos-bodensee/role_dotfiles.git + url = https://github.com/roles-ansible/ansible_role_dotfiles.git + branch = main [submodule "roles/pulseaudio"] path = roles/pulseaudio url = https://github.com/chaos-bodensee/role_pulseaudio_archlinux.git + branch = master [submodule "roles/authorized_keys"] path = roles/do1jlr.auth - url = https://github.com/ffbsee/role-ssh_authorized_keys.git + url = https://github.com/roles-ansible/ansible_role_auth.git + branch = main [submodule "files/admin_ssh_keys"] path = files/admin_ssh_keys url = https://backwesen.de/ansible/ssh_public_keys.git + branch = main [submodule "roles/sshd"] path = roles/do1jlr.sshd url = https://github.com/roles-ansible/ansible_role_sshd.git + branch = main [submodule "roles/nextcloud"] path = roles/nextcloud url = https://github.com/DO1JLR/role_nextcloud_client.git + branch = master [submodule "roles/ntp"] path = roles/ntp - url = https://github.com/chaos-bodensee/role-ntp.git + url = https://github.com/roles-ansible/ansible_role_ntp.git + branch = main [submodule "roles/arch-fonts"] path = roles/arch-fonts url = https://github.com/chaos-bodensee/role-arch-fonts.git + branch = master [submodule "roles/akku-warning"] path = roles/akku-warning url = https://github.com/roles-ansible/role_akku_warning.git + branch = main [submodule "roles/install-firefox"] path = roles/install-firefox url = https://github.com/roles-ansible/ansible_role_install_firefox.git + branch = main [submodule "roles/xrandr"] path = roles/xrandr - url = https://github.com/chaos-bodensee/role-xrandr.git + url = https://github.com/roles-ansible/ansible_role_xrandr_help.git + branch = main [submodule "roles/winehq"] path = roles/winehq url = https://github.com/ekultails/ansible_role_wine.git + branch = master [submodule "roles/no-sleep"] path = roles/no-sleep url = https://github.com/chaos-bodensee/role_disable_sleep.git + branch = master [submodule "roles/manage_users"] path = roles/do1jlr.users - url = https://github.com/chaos-bodensee/role-manage_users.git + url = https://github.com/roles-ansible/ansible_role_users.git + branch = main [submodule "roles/polybar"] path = roles/polybar url = https://github.com/chaos-bodensee/role_install-polybar.git + branch = master [submodule "roles/ansible_version"] path = roles/ansible_version url = https://github.com/chaos-bodensee/role-ansible_version.git + branch = main [submodule "roles/base"] path = roles/do1jlr.base url = https://github.com/roles-ansible/ansible_role_base.git + branch = main [submodule "roles/bat"] path = roles/bat url = https://github.com/gantsign/ansible_role_bat.git + branch = master [submodule "roles/amdgpu_firmware"] path = roles/amdgpu_firmware url = https://github.com/DO1JLR/ansible_role_amdgpu_firmware.git + branch = main [submodule "roles/do1jlr.avahi"] path = roles/do1jlr.avahi_daemon url = https://github.com/roles-ansible/ansible_role_avahi_daemon.git + branch = main [submodule "roles/do1jlr.avahi_client"] path = roles/do1jlr.avahi_client url = https://github.com/roles-ansible/ansible_role_avahi_client.git + branch = main [submodule "roles/do1jlr.i3wm"] path = roles/do1jlr.i3wm url = https://github.com/roles-ansible/ansible_role_i3wm.git + branch = main [submodule "roles/do1jlr.htop"] path = roles/do1jlr.htop url = https://github.com/roles-ansible/ansible_role_htop.git + branch = main +[submodule "collections/ansible_collections/community/general"] + path = collections/ansible_collections/community/general + url = https://github.com/ansible-collections/community.general.git + branch = main diff --git a/README.md b/README.md index 46c84ab..42625f3 100644 --- a/README.md +++ b/README.md @@ -54,3 +54,7 @@ Or create a new git repo and be inspired by the roles L3D uses. If you find this usefull please take a few secounds and say thankyou to L3D. He is at the most [chaos events](https://events.ccc.de), simple give him a Tschunk or Club Mate there! + + Additional Infos +------------------ +By the way, to store sensible passwords, I am using the [community.general.passwordstore](https://docs.ansible.com/ansible/latest/collections/community/general/passwordstore_lookup.html) Lookup to access my passwords, stored in [gopass](https://gopass.pw/) Password Manager. diff --git a/ansible.cfg b/ansible.cfg index d9d5c2a..09c82d2 100644 --- a/ansible.cfg +++ b/ansible.cfg @@ -8,3 +8,6 @@ interpreter_python = /usr/bin/python3 [privilege_escalation] become_method = sudo become_user = root + +[passwordstore_lookup] +backend = "gopass" diff --git a/collections/ansible_collections/community/general b/collections/ansible_collections/community/general new file mode 160000 index 0000000..42bc2cb --- /dev/null +++ b/collections/ansible_collections/community/general @@ -0,0 +1 @@ +Subproject commit 42bc2cb4d8a61b9f4f501cd45017101f743c858c diff --git a/inventory.py b/inventory.py index 0487250..78957aa 100755 --- a/inventory.py +++ b/inventory.py @@ -24,6 +24,13 @@ def fqdn(): hostname = f"{hostname}.local" return str(hostname) +def become_pass(host): + """ + return variable for become password using gopass lookup + """ + passstring = str("\"ansible_become_pass\": \"{{ lookup('community.general.passwordstore', 'ansible/hosts/" + host + "/users/root') }}\"") + return passstring + def env(domain): """ map a hostname to a space @@ -47,7 +54,7 @@ def hostvars(host): """ set variables to local connection """ - local = str('"' + host + '": {"ansible_connection": "local"}') + local = str('"' + host + '": {"ansible_connection": "local", ' + str(become_pass(host)) + '}') return local def formated_host_group_list(host, group): @@ -68,16 +75,4 @@ def main(): group = env(host) print(json.dumps(formated_host_group_list(host, group), sort_keys=True, indent=2)) - - -#{ -# "_meta": { -# "hostvars": { } -# }, -# -# "instances": { -# "hosts": ["10.66.70.33"] -# } -# } - main() diff --git a/site.yml b/site.yml index ebf5567..93b41d6 100644 --- a/site.yml +++ b/site.yml @@ -1,11 +1,20 @@ --- - name: check if ansible is not to old - hosts: localhost + hosts: all roles: - {role: ansible_version, tags: always, gather_facts: false} +- name: Test + hosts: all + tasks: + - name: TEST1 + ansible.builtin.debug: + msg: "{{ ansible_become_pass }}" + - name: T2 + ansible.builtin.debug: + msg: "{{ lookup('community.general.passwordstore', 'ansible/hosts/rarity.local/users/root') }}" - name: run do1jlr.base setup roles - hosts: localhost + hosts: all roles: #- {role: do1jlr.base, tags: [default, packages, base]} #- {role: workstation_packages, tags: [default, workstation_packages, packages, setup]} @@ -15,7 +24,7 @@ #- {role: arch-fonts, tags: [font, fonts, arch-fonts]} #- name: user specific setup -# hosts: localhost +# hosts: private # roles: #- {role: dotfiles, tags: [default, dotfiles, fancy]} #- {role: manage_users, tags: [ssh, manage, manage_users]} From c484325f23770f6c6cee89f92be6c38c2c98c222 Mon Sep 17 00:00:00 2001 From: L3D Date: Thu, 13 Apr 2023 23:19:42 +0200 Subject: [PATCH 14/18] improve linting and pylint --- .yamllint | 2 ++ README.md | 2 +- inventory.py | 6 ++++-- setup_desk_minni.yml | 38 -------------------------------------- setup_l14.yml | 39 --------------------------------------- setup_t460p.yml | 38 -------------------------------------- setup_workstation.yml | 38 -------------------------------------- site.yml | 42 +++++++++++++++++++++--------------------- 8 files changed, 28 insertions(+), 177 deletions(-) delete mode 100644 setup_desk_minni.yml delete mode 100644 setup_l14.yml delete mode 100644 setup_t460p.yml delete mode 100644 setup_workstation.yml diff --git a/.yamllint b/.yamllint index be0cacf..283da64 100644 --- a/.yamllint +++ b/.yamllint @@ -9,3 +9,5 @@ rules: ignore: | roles/ + collections/ + ansible/ diff --git a/README.md b/README.md index 42625f3..45b358b 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ python3 -m venv ansible source ansible/bin/activate # Install Ansible -pip3 install ansible-core +pip3 install --upgrade ansible-core ansible-lint pylint ``` Which playbook? diff --git a/inventory.py b/inventory.py index 78957aa..696cd8b 100755 --- a/inventory.py +++ b/inventory.py @@ -28,8 +28,10 @@ def become_pass(host): """ return variable for become password using gopass lookup """ - passstring = str("\"ansible_become_pass\": \"{{ lookup('community.general.passwordstore', 'ansible/hosts/" + host + "/users/root') }}\"") - return passstring + passstring = str("\"ansible_become_pass\": " + + "\"{{ lookup('community.general.passwordstore', 'ansible/hosts/" + + host + "/users/root') }}\"") + return passstring def env(domain): """ diff --git a/setup_desk_minni.yml b/setup_desk_minni.yml deleted file mode 100644 index dec07ef..0000000 --- a/setup_desk_minni.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -- name: check if ansible is not to old - hosts: localhost - roles: - - {role: ansible_version, tags: always, gather_facts: false} - -- name: base packages setup - hosts: desk_minni.local - roles: - - {role: workstation_packages, tags: [base, packages, workstation]} - -- name: user and ssh(d) setup - hosts: desk_minni.local - roles: - - {role: do1jlr.users, tags: [users, base]} - - {role: do1jlr.auth, tags: [auth, base]} - - {role: do1jlr.sshd, tags: [sshd, base]} - - {role: dotfiles, tags: [dotfiles, base]} - -- name: fancy schnickschnack - hosts: desk_minni.local - roles: - - {role: akku-warning, tags: akku} - # - {role: pulseaudio, tags: [pulse, audio, pulseaudio]} - - {role: networkmanager, tags: networkmanager, when: ansible_os_family == 'Archlinux'} - - {role: openvpn, tags: ovpn} - - {role: nextcloud, tags: nextcloud, when: ansible_os_family == 'Archlinux'} - - {role: bat, tags: bat, when: ansible_os_family == 'Debian'} - - {role: install-firefox, tags: firefox} - - {role: copy_files} - - {role: do1jlr.i3wm, tags: i3wm} - - {role: ntp, tags: ntp} - - {role: xrandr, tags: xrandr} - - {role: arch-fonts, tags: fonts} - # - {role: winehq, tags: wine} - - {role: no-sleep, tags: sleep} - - {role: do1jlr.avahi_daemon, tags: [avahi_daemon, avahi]} - - {role: do1jlr.avahi_client, tags: [avahi_client, mdns]} diff --git a/setup_l14.yml b/setup_l14.yml deleted file mode 100644 index 3fc3975..0000000 --- a/setup_l14.yml +++ /dev/null @@ -1,39 +0,0 @@ ---- -- name: check if ansible is not to old - hosts: localhost - roles: - - {role: ansible_version, tags: always, gather_facts: false} - -- name: base packages setup - hosts: l14.local - roles: - - {role: workstation_packages, tags: [base, packages, workstation]} - - {role: amdgpu_firmware, tags: [amdgpu, firmware]} - -- name: user and ssh(d) setup - hosts: l14.local - roles: - - {role: do1jlr.users, tags: [users, base]} - - {role: do1jlr.auth, tags: [auth, base]} - - {role: do1jlr.sshd, tags: [sshd, base]} - - {role: dotfiles, tags: [dotfiles, base]} - -- name: fancy schnickschnack - hosts: l14.local - roles: - - {role: akku-warning, tags: akku} - # - {role: pulseaudio, tags: [pulse, audio, pulseaudio]} - - {role: networkmanager, tags: networkmanager, when: ansible_os_family == 'Archlinux'} - - {role: openvpn, tags: ovpn} - - {role: nextcloud, tags: nextcloud, when: ansible_os_family == 'Archlinux'} - - {role: bat, tags: bat, when: ansible_os_family == 'Debian'} - - {role: install-firefox, tags: firefox} - - {role: copy_files} - - {role: do1jlr.i3wm, tags: i3wm} - - {role: ntp, tags: ntp} - - {role: xrandr, tags: xrandr} - - {role: arch-fonts, tags: fonts} - # - {role: winehq, tags: wine} - - {role: no-sleep, tags: sleep} - - {role: do1jlr.avahi_daemon, tags: [avahi_daemon, avahi]} - - {role: do1jlr.avahi_client, tags: [avahi_client, mdns]} diff --git a/setup_t460p.yml b/setup_t460p.yml deleted file mode 100644 index 00f38a8..0000000 --- a/setup_t460p.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -- name: check if ansible is not to old - hosts: localhost - roles: - - {role: ansible_version, tags: always, gather_facts: false} - -- name: base packages setup - hosts: t460p.local - roles: - - {role: workstation_packages, tags: [base, packages, workstation]} - -- name: user and ssh(d) setup - hosts: t460p.local - roles: - - {role: do1jlr.users, tags: [users, base]} - - {role: do1jlr.auth, tags: [auth, base]} - - {role: do1jlr.sshd, tags: [sshd, base]} - - {role: dotfiles, tags: [dotfiles, base]} - -- name: fancy schnickschnack - hosts: t460p.local - roles: - - {role: akku-warning, tags: akku} - # - {role: pulseaudio, tags: [pulse, audio, pulseaudio]} - - {role: networkmanager, tags: networkmanager, when: ansible_os_family == 'Archlinux'} - - {role: openvpn, tags: ovpn} - - {role: nextcloud, tags: nextcloud, when: ansible_os_family == 'Archlinux'} - - {role: bat, tags: bat, when: ansible_os_family == 'Debian'} - - {role: install-firefox, tags: firefox} - - {role: copy_files} - - {role: do1jlr.i3wm, tags: i3wm} - - {role: ntp, tags: ntp} - - {role: xrandr, tags: xrandr} - - {role: arch-fonts, tags: fonts} - # - {role: winehq, tags: wine} - - {role: no-sleep, tags: sleep} - - {role: do1jlr.avahi_daemon, tags: [avahi_daemon, avahi]} - - {role: do1jlr.avahi_client, tags: [avahi_client, mdns]} diff --git a/setup_workstation.yml b/setup_workstation.yml deleted file mode 100644 index 825dbdd..0000000 --- a/setup_workstation.yml +++ /dev/null @@ -1,38 +0,0 @@ ---- -- name: check if ansible is not to old - hosts: localhost - roles: - - {role: ansible_version, tags: always, gather_facts: false} - -- name: base packages setup - hosts: workstation.local - roles: - - {role: workstation_packages, tags: [base, packages, workstation]} - -- name: user and ssh(d) setup - hosts: workstation.local - roles: - - {role: do1jlr.users, tags: [users, base]} - - {role: do1jlr.auth, tags: [auth, base]} - - {role: do1jlr.sshd, tags: [sshd, base]} - - {role: dotfiles, tags: [dotfiles, base]} - -- name: fancy schnickschnack - hosts: workstation.local - roles: - - {role: akku-warning, tags: akku} - - {role: pulseaudio, tags: [pulse, audio, pulseaudio]} - - {role: networkmanager, tags: networkmanager, when: ansible_os_family == 'Archlinux'} - - {role: openvpn, tags: ovpn} - - {role: nextcloud, tags: nextcloud, when: ansible_os_family == 'Archlinux'} - - {role: bat, tags: bat, when: ansible_os_family == 'Debian'} - - {role: install-firefox, tags: firefox} - - {role: copy_files} - - {role: do1jlr.i3wm, tags: i3wm} - - {role: ntp, tags: ntp} - - {role: xrandr, tags: xrandr} - - {role: arch-fonts, tags: fonts} - - {role: winehq, tags: wine} - - {role: no-sleep, tags: sleep} - - {role: do1jlr.avahi_daemon, tags: [avahi_daemon, avahi]} - - {role: do1jlr.avahi_client, tags: [avahi_client, mdns]} diff --git a/site.yml b/site.yml index 93b41d6..2c27f54 100644 --- a/site.yml +++ b/site.yml @@ -16,28 +16,28 @@ - name: run do1jlr.base setup roles hosts: all roles: - #- {role: do1jlr.base, tags: [default, packages, base]} - #- {role: workstation_packages, tags: [default, workstation_packages, packages, setup]} + # - {role: do1jlr.base, tags: [default, packages, base]} + # - {role: workstation_packages, tags: [default, workstation_packages, packages, setup]} - {role: ntp, tags: ntp} - {role: do1jlr.avahi_client, tags: avahi} - {role: do1jlr.avahi_daemon, tags: avahi} - #- {role: arch-fonts, tags: [font, fonts, arch-fonts]} + # - {role: arch-fonts, tags: [font, fonts, arch-fonts]} -#- name: user specific setup -# hosts: private -# roles: - #- {role: dotfiles, tags: [default, dotfiles, fancy]} - #- {role: manage_users, tags: [ssh, manage, manage_users]} - #- {role: authorized_keys, tags: [ssh, auth, authorized_keys]} - #- {role: sshd, tags: [ssh, sshd]} - #- {role: akku-warning, tags: [akku, akku_warning, akku-warning]} - #- {role: pulseaudio, tags: pulseaudio} - #- {role: networkmanager, tags: [nm, networkmanager]} - #- {role: copy_files} - #- {role: do1jlr.i3wm, tags: i3wm} - # - {role: xrandr, tags: xrandr} - #- {role: install-firefox, tags: firefox} - #- {role: nextcloud, tags: nextcloud} - #- {role: openvpn, tags: openvpn} - #- {role: winehq, tags: [wine, winehq]} - #- {role: no-sleep, tags: no_sleep} +# - name: user specific setup +# hosts: private +# roles: +# - {role: dotfiles, tags: [default, dotfiles, fancy]} +# - {role: manage_users, tags: [ssh, manage, manage_users]} +# - {role: authorized_keys, tags: [ssh, auth, authorized_keys]} +# - {role: sshd, tags: [ssh, sshd]} +# - {role: akku-warning, tags: [akku, akku_warning, akku-warning]} +# - {role: pulseaudio, tags: pulseaudio} +# - {role: networkmanager, tags: [nm, networkmanager]} +# - {role: copy_files} +# - {role: do1jlr.i3wm, tags: i3wm} +# - {role: xrandr, tags: xrandr} +# - {role: install-firefox, tags: firefox} +# - {role: nextcloud, tags: nextcloud} +# - {role: openvpn, tags: openvpn} +# - {role: winehq, tags: [wine, winehq]} +# - {role: no-sleep, tags: no_sleep} From aff797b9bf123bd43491a23f944b227b48c53d06 Mon Sep 17 00:00:00 2001 From: L3D Date: Thu, 20 Apr 2023 22:18:51 +0200 Subject: [PATCH 15/18] Cleanup playbook and update modules --- collections/ansible_collections/community/general | 2 +- site.yml | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/collections/ansible_collections/community/general b/collections/ansible_collections/community/general index 42bc2cb..9b493d5 160000 --- a/collections/ansible_collections/community/general +++ b/collections/ansible_collections/community/general @@ -1 +1 @@ -Subproject commit 42bc2cb4d8a61b9f4f501cd45017101f743c858c +Subproject commit 9b493d53a9ff40139c185ff2dc4a7c5d6cf761a6 diff --git a/site.yml b/site.yml index 2c27f54..203d4d9 100644 --- a/site.yml +++ b/site.yml @@ -4,15 +4,6 @@ roles: - {role: ansible_version, tags: always, gather_facts: false} -- name: Test - hosts: all - tasks: - - name: TEST1 - ansible.builtin.debug: - msg: "{{ ansible_become_pass }}" - - name: T2 - ansible.builtin.debug: - msg: "{{ lookup('community.general.passwordstore', 'ansible/hosts/rarity.local/users/root') }}" - name: run do1jlr.base setup roles hosts: all roles: From 9f85458db0017f418399fa153d19e1aed47195ab Mon Sep 17 00:00:00 2001 From: L3D Date: Thu, 20 Apr 2023 23:16:37 +0200 Subject: [PATCH 16/18] update role namespaces --- .gitmodules | 4 ++-- roles/{bat => gantsign.bat} | 0 roles/l3d.ntp | 1 + roles/ntp | 1 - site.yml | 5 +++-- 5 files changed, 6 insertions(+), 5 deletions(-) rename roles/{bat => gantsign.bat} (100%) create mode 160000 roles/l3d.ntp delete mode 160000 roles/ntp diff --git a/.gitmodules b/.gitmodules index a95c1bd..828c29f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -27,7 +27,7 @@ url = https://github.com/DO1JLR/role_nextcloud_client.git branch = master [submodule "roles/ntp"] - path = roles/ntp + path = roles/l3d.ntp url = https://github.com/roles-ansible/ansible_role_ntp.git branch = main [submodule "roles/arch-fonts"] @@ -71,7 +71,7 @@ url = https://github.com/roles-ansible/ansible_role_base.git branch = main [submodule "roles/bat"] - path = roles/bat + path = roles/gantsign.bat url = https://github.com/gantsign/ansible_role_bat.git branch = master [submodule "roles/amdgpu_firmware"] diff --git a/roles/bat b/roles/gantsign.bat similarity index 100% rename from roles/bat rename to roles/gantsign.bat diff --git a/roles/l3d.ntp b/roles/l3d.ntp new file mode 160000 index 0000000..89c62be --- /dev/null +++ b/roles/l3d.ntp @@ -0,0 +1 @@ +Subproject commit 89c62be2cb6bb5af79516b358ffcabda62b26a86 diff --git a/roles/ntp b/roles/ntp deleted file mode 160000 index 8d33019..0000000 --- a/roles/ntp +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8d330190c4052981bdb146136dc7f41071a66289 diff --git a/site.yml b/site.yml index 203d4d9..a349178 100644 --- a/site.yml +++ b/site.yml @@ -4,14 +4,15 @@ roles: - {role: ansible_version, tags: always, gather_facts: false} -- name: run do1jlr.base setup roles +- name: Generic Workstation Preperation hosts: all roles: # - {role: do1jlr.base, tags: [default, packages, base]} # - {role: workstation_packages, tags: [default, workstation_packages, packages, setup]} - - {role: ntp, tags: ntp} + - {role: l3d.ntp, tags: ntp} - {role: do1jlr.avahi_client, tags: avahi} - {role: do1jlr.avahi_daemon, tags: avahi} + - {role: gantsign.bat, tags: bat} # - {role: arch-fonts, tags: [font, fonts, arch-fonts]} # - name: user specific setup From f83397998e758666817c899518f80a7b72d59989 Mon Sep 17 00:00:00 2001 From: L3D Date: Fri, 21 Apr 2023 13:46:46 +0200 Subject: [PATCH 17/18] Submoduls --- .gitmodules | 6 ++++++ roles/gantsign.bat | 1 + roles/l3d.ntp | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) create mode 160000 roles/gantsign.bat diff --git a/.gitmodules b/.gitmodules index b37642f..b7c545f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -90,3 +90,9 @@ path = collections/ansible_collections/community/general url = https://github.com/ansible-collections/community.general.git branch = main +[submodule "roles/gantsign.bat"] + path = roles/gantsign.bat + url = https://github.com/gantsign/ansible_role_bat.git +[submodule "roles/l3d.ntp"] + path = roles/l3d.ntp + url = https://github.com/roles-ansible/ansible_role_ntp.git diff --git a/roles/gantsign.bat b/roles/gantsign.bat new file mode 160000 index 0000000..b263e5e --- /dev/null +++ b/roles/gantsign.bat @@ -0,0 +1 @@ +Subproject commit b263e5e140ee3c5e868f9392b2e4a2eaa37eaf79 diff --git a/roles/l3d.ntp b/roles/l3d.ntp index 89c62be..c4ff771 160000 --- a/roles/l3d.ntp +++ b/roles/l3d.ntp @@ -1 +1 @@ -Subproject commit 89c62be2cb6bb5af79516b358ffcabda62b26a86 +Subproject commit c4ff7711a14a9a34af60cfa122c9331d15760582 From c1dc0f0d23c16ed992a8040a6a1d2658d12ae9c6 Mon Sep 17 00:00:00 2001 From: L3D Date: Fri, 21 Apr 2023 13:55:27 +0200 Subject: [PATCH 18/18] update workflow --- .github/workflows/ansible-linting-check.yml | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ansible-linting-check.yml b/.github/workflows/ansible-linting-check.yml index eb30892..5ed3e8a 100644 --- a/.github/workflows/ansible-linting-check.yml +++ b/.github/workflows/ansible-linting-check.yml @@ -2,7 +2,11 @@ name: Ansible Lint check # yamllint disable-line rule:truthy -on: [push, pull_request] +on: + push: + branches: '*' + pull_request: + branches: '*' jobs: build: @@ -10,9 +14,14 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - - - name: Lint Ansible Playbook - uses: ansible/ansible-lint-action@master + - name: 'checkout git repo' + uses: actions/checkout@v3 with: - targets: "site.yml" + lfs: true + submodules: true + fetch-depth: 0 + + - name: 'Lint Ansible Playbook' + uses: ansible/ansible-lint-action@v6 + with: + path: "."