|
|
@ -1,3 +1,4 @@
|
|
|
|
|
|
|
|
|
|
|
|
- name: register basic session with consul
|
|
|
|
- name: register basic session with consul
|
|
|
|
consul_session:
|
|
|
|
consul_session:
|
|
|
|
name: session1
|
|
|
|
name: session1
|
|
|
@ -13,8 +14,10 @@
|
|
|
|
- name: add checks for session health check
|
|
|
|
- name: add checks for session health check
|
|
|
|
consul:
|
|
|
|
consul:
|
|
|
|
check_name: session_check
|
|
|
|
check_name: session_check
|
|
|
|
script: /usr/bin/true
|
|
|
|
script: /bin/true
|
|
|
|
interval: 15
|
|
|
|
interval: 1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- pause: seconds=2
|
|
|
|
|
|
|
|
|
|
|
|
- name: register a session with check
|
|
|
|
- name: register a session with check
|
|
|
|
consul_session:
|
|
|
|
consul_session:
|
|
|
@ -43,7 +46,7 @@
|
|
|
|
- with_delay.changed
|
|
|
|
- with_delay.changed
|
|
|
|
- with_delay.session_id | length == 36
|
|
|
|
- with_delay.session_id | length == 36
|
|
|
|
- with_delay.name == 'session_with_delay'
|
|
|
|
- with_delay.name == 'session_with_delay'
|
|
|
|
- with_delay.delay == 20
|
|
|
|
- with_delay.delay == "20"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: retrieve session by id
|
|
|
|
- name: retrieve session by id
|
|
|
@ -65,11 +68,9 @@
|
|
|
|
- 3 <= retrieved_by_list.sessions[0]
|
|
|
|
- 3 <= retrieved_by_list.sessions[0]
|
|
|
|
|
|
|
|
|
|
|
|
- name: remove sessions
|
|
|
|
- name: remove sessions
|
|
|
|
consul_session: id={{item}} state=absent
|
|
|
|
consul_session: id='{{basic_result.session_id}}' state=absent
|
|
|
|
with_items:
|
|
|
|
- consul_session: id='{{with_check.session_id}}' state=absent
|
|
|
|
- basic_result.session_id
|
|
|
|
- consul_session: id='{{with_delay.session_id}}' state=absent
|
|
|
|
- with_check.session_id
|
|
|
|
|
|
|
|
- with_delay.session_id
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
- name: remove check
|
|
|
|
- name: remove check
|
|
|
|
consul:
|
|
|
|
consul:
|
|
|
|