ansible / ansible-modules-extras

Ansible extra modules - these modules ship with ansible
948 stars 1.46k forks source link

Add 'state=obtain' for consul_kv module #3638

Closed nocode99 closed 7 years ago

nocode99 commented 7 years ago
ISSUE TYPE
COMPONENT NAME

consul_kv

ANSIBLE VERSION
2.2.1.0
SUMMARY

There doesn't seem to be an easy way to grab existing values from Consul keys. I have configurations that are added to consul via other sources and would like Ansible to grab those values to use for configurations or perhaps to run certain tasks or not.

- name: Get value from Consul key
  consul_kv:
    key: foo
    state: obtain
  register: key
- name: Output
  debug: msg="value={{ key.value }}"
gregdek commented 7 years ago

Thanks @nocode99. To the current maintainers, @sgargan please review according to guidelines (http://docs.ansible.com/ansible/developing_modules.html#module-checklist) and comment with text 'shipit', 'needs_revision' or 'close_me' as appropriate.

[This message brought to you by your friendly Ansibull-bot.]

nocode99 commented 7 years ago

https://github.com/ansible/ansible-modules-extras/pull/3371 already exists and closing mine.