Skip to content

Config not re-inited when "inventory_hostname" is changed #26

Description

@seenickcode

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 }}"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions