{"action":"closed","issue":{"url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/3307","repository_url":"https://api.github.com/repos/ansible/ansible-modules-extras","labels_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/3307/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/3307/comments","events_url":"https://api.github.com/repos/ansible/ansible-modules-extras/issues/3307/events","html_url":"https://github.com/ansible/ansible-modules-extras/issues/3307","id":185754500,"number":3307,"title":"logentries module fails to correctly unfollow logs","user":{"login":"jmehnle","id":286913,"avatar_url":"https://avatars.githubusercontent.com/u/286913?v=3","gravatar_id":"","url":"https://api.github.com/users/jmehnle","html_url":"https://github.com/jmehnle","followers_url":"https://api.github.com/users/jmehnle/followers","following_url":"https://api.github.com/users/jmehnle/following{/other_user}","gists_url":"https://api.github.com/users/jmehnle/gists{/gist_id}","starred_url":"https://api.github.com/users/jmehnle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jmehnle/subscriptions","organizations_url":"https://api.github.com/users/jmehnle/orgs","repos_url":"https://api.github.com/users/jmehnle/repos","events_url":"https://api.github.com/users/jmehnle/events{/privacy}","received_events_url":"https://api.github.com/users/jmehnle/received_events","type":"User","site_admin":false},"labels":[{"id":437719515,"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/affects_1.9","name":"affects_1.9","color":"5319e7","default":false},{"id":132898023,"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/bug_report","name":"bug_report","color":"fbca04","default":false},{"id":415779102,"url":"https://api.github.com/repos/ansible/ansible-modules-extras/labels/waiting_on_maintainer","name":"waiting_on_maintainer","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-10-27T19:08:45Z","updated_at":"2016-12-07T16:22:35Z","closed_at":"2016-12-07T16:22:35Z","body":"##### ISSUE TYPE\n- Bug Report\n##### COMPONENT NAME\n\n`logentries` module\n##### ANSIBLE VERSION\n\n```\nansible 1.9.3\n  configured module search path = None\n```\n\n(but broken in Ansible 2 as well)\n##### OS / ENVIRONMENT\n\nManaging Ubuntu 14.04 and 16.04.\n`logentries` agent 1.4.39 (latest as of 2016-10-27), but tried various versions.\n##### SUMMARY\n\nThe `logentries` module fails to correctly unfollow logs. The `le` command it issues is `le rm <logfile-path>`, but that only results in an error message:\n\n```\nfailed: [<hostname>] => (item={'path': '/var/log/diskutil.log', 'state': 'absent', 'name': 'Diskutil'}) => {\"failed\": true, \"item\": {\"name\": \"Diskutil\", \"path\": \"/var/log/diskutil.log\", \"state\": \"absent\"}}\nmsg: failed to remove '/var/log/diskutil.log': Error: Resource var not found.\n```\n\nThe play in the playbook is:\n\n```\n- name: logentries\n  hosts: all\n  sudo: yes\n  roles:\n    - role: logentries\n      logentries_logs:\n        - …\n        - name: \"Diskutil\"\n          path: \"/var/log/diskutil.log\"\n          state: absent\n```\n\nThe relevant task is:\n\n```\n- name: Follow logs\n  logentries: path={{ item.path }} state={{ item.state | default('present') }}\n  with_items: logentries_logs\n```\n\nAccording to https://docs.logentries.com/docs/linux-agent and https://github.com/logentries/le/issues/66, the correct argument to pass to `le rm` is not the log file's file system path but a virtual path composed of 1. the prefix `hosts/`, 2. the fully qualified name of the host, and 3. the symbolic name of the log file specified during the initial `follow` action (defaulting to the base name of the log file path), e.g., `hosts/<hostname>/diskutil.log`.\n"}}
{"actor":{"display_login":"jmehnle"}}