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