- name: install fluentbit on debian/ubuntu systems gather_facts: yes hosts: servers become: "{{become}}" tasks: # https://docs.ansible.com/ansible/latest/collections/ansible/builtin/deb822_repository_module.html #- name: add fluentbit repository for debian/ubuntu # ansible.builtin.deb822_repository: # name: fluentbit # types: deb # uris: https://packages.fluentbit.io/{{ansible_distribution}}/{{ansible_distribution_release}} # suites: '{{ansible_distribution_release}}' # components: main # architectures: amd64 # signed_by: https://packages.fluentbit.io/fluentbit.key # when: ansible_os_family == 'Debian' - name: install fluentbit ansible.builtin.script: cmd: scripts/fluentbit-install.bash chdir: /root register: script_output changed_when: >- "changed - all done" in script_output.stdout when: ansible_facts['os_family'] == "Debian" - name: display script stdout debug: var=script_output.stdout_lines when: script_output.stdout is defined - name: display script stderr debug: var=script_output.sterr_lines when: script_output.sterr is defined # https://docs.ansible.com/ansible/latest/collections/ansible/builtin/apt_module.html #- name: install fluentbit for debian/ubuntu # ansible.builtin.apt: # name: # - sysstat # for flb_metrics # - fluent-bit # state: latest # update_cache: true # as we just added that repo # when: ansible_os_family == 'Debian'