Giter VIP home page Giter VIP logo

ansible-logentries's People

Contributors

dchancogne avatar hxpro avatar michal-organek avatar porn avatar ricbra avatar riemers avatar seenickcode avatar smaant avatar tristanbes avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ansible-logentries's Issues

Doesn't re-register if host is removed on logentries

If you have someone that deleted the host (on logentries), while this should not be the case it will not reregister. The register command will fail with:

Warning: Server already registered. Use --force to override current registration.

So you could do a catch on that and "re-register", if i read it correctly, something like:

when: "'already registered' in result_register.stderr"

As a note, if you don't have the latest ansible extra modules, the "name" entry will fail. Was updated at some point, but mine came with an older version it seemed.

Follow all files in a directory

Is it possible to follow all log files in a directory.

For an example app logs - app/storage/logs/* ( Multiple files , file name depends on date etc )

Feature req: set logentries_hostname even if already setup

Useful if folks want to change the hostname config var if re-deploying, no? Right now it only sets this when: result|failed and logentries_set_key is not defined

i.e. https://github.com/ricbra/ansible-logentries/blob/6b72f788f9e60ffaed9a3867664330b999bfd30e/tasks/main.yml

- name: Register host shell: "le register --force --name={{ logentries_hostname | default(ansible_fqdn) }} --hostname={{ logentries_hostname | default(ansible_fqdn) }} --yes --account-key={{ logentries_account_key }}" when: result|failed and logentries_set_key is not defined

Okay to reference this in the Logentries docs?

Hey Richard,

Cheers for putting this together :) Would you mind if we reference to this page on our documentation? We haven't done anything for Ansible and I think it would be pretty cool to write up some instructions and reference you!

Ensure service is started if stopped?

Hey there. I noticed that is the service is stopped for some reason, there's no way to make sure it is indeed started. We have a "Restart logentries" handler but that's only triggered for things like config updates.

Am I missing something or can maybe someone help me figure out where to place a task to ensure the service is started after the step to "Follow logs"?

Maybe something like this, or?

- name: Ensure logentries service started if stopped
  service: name={{ logentries_service }} state=started

Thanks.

Config not re-inited when "inventory_hostname" is changed

Would be nice to have this feature in case the agent hostname changes.

What about something like this?

- name: Check current agent hostname
  shell: "sudo le whoami | grep hostname"
  register: result
  ignore_errors: true
  changed_when: false
  when: logentries_hostname is defined

- name: Re-register hostname if it has changed
  shell: "le register --force --hostname={{ logentries_hostname }}"
  when: logentries_hostname is defined and result.stdout != "hostname = {{ logentries_hostname }}"

breaks on ansible 2.0

Specifiying method: keyserver in the apt-key task is no longer valid, results in errors like

failed: [master] => (item={u'id': u'C43C79AD', u'value': u'pgp.mit.edu', u'method': u'keyserver'}) => {"failed": true, "item": {"id": "C43C79AD", "method": "keyserver", "value": "pgp.mit.edu"}, "msg": "unsupported parameter for module: {{ item.method }}"}

ansible_managed

please use:

{{ ansible_managed | comment}}

instead

#{{ ansible_managed }}

On install it fails with Daemon already running? at restart.

Each time I try to use this module the first run fails with

Packer Running Ansible Provisioner

    amazon-ebs: RUNNING HANDLER [ricbra.logentries : Restart logentries] ***********************
    amazon-ebs: fatal: [default]: FAILED! => {"changed": false, "failed": true, "msg": "Pidfile /var/run/logentries.pid already exists. Daemon already running?\n"}
    amazon-ebs: 	to retry, use: --limit @/Users/donovan/code/lendinghome-infrastructure/lendinghome_wordpress/ansible/playbook.retry

or ansible running with an inventory

RUNNING HANDLER [ricbra.logentries : Restart logentries] ***********************
fatal: [35.160.183.61]: FAILED! => {"changed": false, "failed": true, "msg": "Pidfile /var/run/logentries.pid already exists. Daemon already running?\n"}
fatal: [52.24.63.164]: FAILED! => {"changed": false, "failed": true, "msg": "Pidfile /var/run/logentries.pid already exists. Daemon already running?\n"}
fatal: [35.166.202.218]: FAILED! => {"changed": false, "failed": true, "msg": "Pidfile /var/run/logentries.pid already exists. Daemon already running?\n"}
	to retry, use: --limit @/Users/donovan/code/lendinghome-infrastructure/lendinghome_wordpress/ansible/playbook.retry

when I checked after the inital failure there was no pid at the pidfile.

I went through the log, and there is no start, or previous restart. It must come from the package.

a subsequent run corrects the problem, unfortunately that doesn't work with packer, its always first run with packer, and it always hits this issue then aborts.

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.04
DISTRIB_CODENAME=trusty
DISTRIB_DESCRIPTION="Ubuntu 14.04.5 LTS"

ansible 2.2.1.0

packer 0.12.2

gpg: no valid OpenPGP data found.

failed: [samxiao.com] => (item={'id': 'C43C79AD', 'value': 'pgp.mit.edu', 'method': 'keyserver'}) => {"cmd": "apt-key adv --keyserver pgp.mit.edu --recv C43C79AD", "failed": true, "item": {"id": "C43C79AD", "method": "keyserver", "value": "pgp.mit.edu"}, "rc": 2}
stderr: gpg: requesting key C43C79AD from hkp server pgp.mit.edu
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0

stdout: Executing: gpg --ignore-time-conflict --no-options --no-default-keyring --homedir /tmp/tmp.5iP4mStIpF --no-auto-check-trustdb --trust-model always --keyring /etc/apt/trusted.gpg --primary-keyring /etc/apt/trusted.gpg --keyserver pgp.mit.edu --recv C43C79AD
?: pgp.mit.edu: Connection timed out
gpgkeys: HTTP fetch error 7: couldn't connect: Connection timed out

msg: gpg: requesting key C43C79AD from hkp server pgp.mit.edu
gpg: no valid OpenPGP data found.
gpg: Total number processed: 0

FATAL: all hosts have already failed -- aborting

autoscaling

Hi,

As far as I can see it looks like this role doesn't support the autoscaling feature of logentries. The LE documentation (https://logentries.com/doc/linux-agent-autoscaling/) mentions that the config would need to set pull-server-side-config=False and set the destination parameter for each file/path.

I was wondering whether you had any suggestions for adding support for this? I tried to work on a PR but I think the le agent only supports the destination parameter via the config file and not the CLI. Thoughts?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.