geerlingguy / ansible-role-fluentd

Ansible role - Fluentd (td-agent)
https://galaxy.ansible.com/geerlingguy/fluentd
MIT License
34 stars 28 forks source link

Error "apt cache update failed" in Ubuntu 20.04 LTS ARM #14

Closed gdevdeiv closed 3 years ago

gdevdeiv commented 3 years ago

Hi there! I'm trying to use this package with my Ansible provisioning pipeline. Target server is running Ubuntu 20.04 LTS on a ARM Amazon server.

Provision log

PLAY [Provision machines] *****************************************************************************************************************************************

TASK [Gathering Facts] ********************************************************************************************************************************************
ok: [x.x.x.x]

TASK [geerlingguy.fluentd : include_tasks] ************************************************************************************************************************
skipping: [x.x.x.x]

TASK [geerlingguy.fluentd : include_tasks] ************************************************************************************************************************
included: /root/.ansible/roles/geerlingguy.fluentd/tasks/setup-Debian.yml for x.x.x.x

TASK [geerlingguy.fluentd : Add required dependencies.] ***********************************************************************************************************
ok: [x.x.x.x]

TASK [geerlingguy.fluentd : Add td-agent apt key.] ****************************************************************************************************************
ok: [x.x.x.x]

TASK [geerlingguy.fluentd : Add td-agent repository.] *************************************************************************************************************
fatal: [x.x.x.x]: FAILED! => {"changed": false, "msg": "apt cache update failed"}

PLAY RECAP ********************************************************************************************************************************************************
x.x.x.x              : ok=4    changed=0    unreachable=0    failed=1    skipped=1    rescued=0    ignored=0

Steps to reproduce

  1. Add geerlingguy.fluentd to requirements, run install command.
  2. Add geerlingguy.fluentd role to role array.
  3. Run provision.

Custom variables

fluentd_plugins:
  - fluent-plugin-newrelic

fluentd_conf_sources: |
  <source>
    @type tail
    <parse>
      @type none
    </parse>
    path /var/log/apache2/error.log
    tag apache.error
  </source>
  <source>
    @type tail
    <parse>
      @type none
    </parse>
    path /var/log/apache2/example.com/error.log
    tag apache.vhost.example.error
  </source>

fluentd_conf_filters: |
  <filter apache.vhost.*>
    @type record_transformer
    <record>
      service_name ${tag}
      hostname "#{Socket.gethostname}"
    </record>
  </filter>

fluentd_conf_matches: |
  <match **>
    @type newrelic
    license_key ...
    base_uri https://log-api.eu.newrelic.com/log/v1
  </match>
gdevdeiv commented 3 years ago

I have solved it by: