Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
seenickcode opened this issue Sep 8, 2017 · 0 comments
Open

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

seenickcode opened this issue Sep 8, 2017 · 0 comments

Comments

@seenickcode
Copy link
Contributor

seenickcode commented Sep 8, 2017

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 }}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant