mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-10-22 03:53:59 -07:00
Add new consul modules and reuse code between them. (#7878)
Refactored consul modules and added new roles.
This commit is contained in:
parent
5c72ab34bf
commit
29f9865497
17 changed files with 1508 additions and 568 deletions
|
@ -77,12 +77,10 @@
|
|||
- name: Start Consul (dev mode enabled)
|
||||
shell: nohup {{ consul_cmd }} agent -dev -config-file {{ remote_tmp_dir }}/consul_config.hcl </dev/null >/dev/null 2>&1 &
|
||||
- name: Bootstrap ACL
|
||||
command: '{{ consul_cmd }} acl bootstrap --format=json'
|
||||
register: consul_bootstrap_result_string
|
||||
consul_acl_bootstrap:
|
||||
register: consul_bootstrap_result
|
||||
- set_fact:
|
||||
consul_management_token: '{{ consul_bootstrap_json_result["SecretID"] }}'
|
||||
vars:
|
||||
consul_bootstrap_json_result: '{{ consul_bootstrap_result_string.stdout | from_json }}'
|
||||
consul_management_token: '{{ consul_bootstrap_result.result.SecretID }}'
|
||||
- name: Create some data
|
||||
command: '{{ consul_cmd }} kv put -token={{consul_management_token}} data/value{{ item }} foo{{ item }}'
|
||||
loop:
|
||||
|
@ -94,6 +92,9 @@
|
|||
- import_tasks: consul_session.yml
|
||||
- import_tasks: consul_policy.yml
|
||||
- import_tasks: consul_role.yml
|
||||
- import_tasks: consul_token.yml
|
||||
- import_tasks: consul_auth_method.yml
|
||||
- import_tasks: consul_binding_rule.yml
|
||||
always:
|
||||
- name: Kill consul process
|
||||
shell: kill $(cat {{ remote_tmp_dir }}/consul.pid)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue