|
@@ -29,16 +29,19 @@
|
|
|
cpu_period: 10000
|
|
|
memory: 128M
|
|
|
restart_policy: unless-stopped
|
|
|
- state: started
|
|
|
+ state: '{{ onion_service_container_state }}'
|
|
|
register: _container
|
|
|
- name: wait for onion service address
|
|
|
wait_for:
|
|
|
path: "{{ (_container.container.Mounts | items2dict(key_name='Destination', value_name='Source'))['/onion-service'] }}/hostname"
|
|
|
register: _address_file
|
|
|
+ when: _container.container.State.Running | default(False)
|
|
|
- name: read onion service address
|
|
|
slurp:
|
|
|
src: '{{ _address_file.path }}'
|
|
|
register: _address_base64
|
|
|
+ when: not (_address_file.skipped | default(False))
|
|
|
- name: decode onion service address
|
|
|
set_fact:
|
|
|
onion_service_address: '{{ _address_base64.content | b64decode | trim }}'
|
|
|
+ when: not (_address_base64.skipped | default(False))
|