From 53e9407c568d4517e69247719f4663c59bbea5db Mon Sep 17 00:00:00 2001 From: L3D Date: Wed, 1 Sep 2021 23:36:05 +0200 Subject: [PATCH] initial commit avahi packages --- defaults/main.yml | 7 +++++++ tasks/install.yml | 14 ++++++++++++++ tasks/main.yml | 9 +++++++++ vars/Archlinux.yml | 3 +++ vars/Debian.yml | 5 +++++ vars/main.yml | 4 ++-- vars/os_fallback.yml | 3 +++ 7 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 tasks/install.yml create mode 100644 vars/Archlinux.yml create mode 100644 vars/Debian.yml create mode 100644 vars/os_fallback.yml diff --git a/defaults/main.yml b/defaults/main.yml index c8d9a89..2b5c147 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -1,3 +1,10 @@ --- +avahi_packages: + - 'avahi-daemon' + - 'avahi-utils' + #- 'avahi-discover' + #- 'mdns-scan' + + # should we do a version check? (recomended) submodules_versioncheck: false diff --git a/tasks/install.yml b/tasks/install.yml new file mode 100644 index 0000000..189369a --- /dev/null +++ b/tasks/install.yml @@ -0,0 +1,14 @@ +--- +- name: Update apt cache + become: true + ansible.builtin.apt: + cache_valid_time: 3600 + update_cache: true + when: + - ansible_pkg_mgr == "apt" + +- name: install avahi packages + become: true + ansible.builtin.package: + name: "{{ avahi_packages }}" + state: present diff --git a/tasks/main.yml b/tasks/main.yml index 7c5850f..0b83847 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -2,3 +2,12 @@ - name: run optional versionscheck ansible.builtin.include_tasks: versioncheck.yml when: submodules_versioncheck|bool + +- name: gather os specific variables + ansible.builtin.include_vars: "{{ item }}" + with_first_found: + - "vars/{{ ansible_os_family }}.yml" + - "vars/os_fallback.yml" + +- name: install avahi requirements + ansible.builtin.include_tasks: install.yml diff --git a/vars/Archlinux.yml b/vars/Archlinux.yml new file mode 100644 index 0000000..4248975 --- /dev/null +++ b/vars/Archlinux.yml @@ -0,0 +1,3 @@ +--- +avahi_packages: + - avahi diff --git a/vars/Debian.yml b/vars/Debian.yml new file mode 100644 index 0000000..feb47ee --- /dev/null +++ b/vars/Debian.yml @@ -0,0 +1,5 @@ +--- +avahi_packages: + - 'avahi-daemon' + - 'avahi-utils' + - 'avahi-discover' diff --git a/vars/main.yml b/vars/main.yml index bf4b0d9..5db3c75 100644 --- a/vars/main.yml +++ b/vars/main.yml @@ -1,4 +1,4 @@ --- # versionscheck -playbook_version_number: 02 # should be a integer -playbook_version_path: 'role-.version' +playbook_version_number: 3 +playbook_version_path: 'do1jlr.avahi_daemon.version' diff --git a/vars/os_fallback.yml b/vars/os_fallback.yml new file mode 100644 index 0000000..4248975 --- /dev/null +++ b/vars/os_fallback.yml @@ -0,0 +1,3 @@ +--- +avahi_packages: + - avahi