53 lines
1.6 KiB
YAML
53 lines
1.6 KiB
YAML
|
|
---
|
||
|
|
- name: Build phoenixd command line arguments
|
||
|
|
set_fact:
|
||
|
|
phoenixd_args: >-
|
||
|
|
{{ (['--agree-to-terms-of-service'] if phoenixd_agree_tos else [])
|
||
|
|
+ ['--chain', phoenixd_chain]
|
||
|
|
+ ['--auto-liquidity', phoenixd_auto_liquidity]
|
||
|
|
+ ['--http-bind-ip', phoenixd_http_bind_ip]
|
||
|
|
+ ['--http-bind-port', phoenixd_http_bind_port | string]
|
||
|
|
+ (['--max-mining-fee', phoenixd_max_mining_fee | string] if phoenixd_max_mining_fee else [])
|
||
|
|
+ (['--webhook', phoenixd_webhook_url] if phoenixd_webhook_url else [])
|
||
|
|
+ ['--silent'] }}
|
||
|
|
|
||
|
|
- name: Create phoenixd systemd service
|
||
|
|
ansible.builtin.template:
|
||
|
|
src: phoenixd.service.j2
|
||
|
|
dest: /etc/systemd/system/phoenixd.service
|
||
|
|
owner: root
|
||
|
|
group: root
|
||
|
|
mode: "0644"
|
||
|
|
notify: Restart phoenixd
|
||
|
|
|
||
|
|
- name: Reload systemd daemon
|
||
|
|
systemd:
|
||
|
|
daemon_reload: yes
|
||
|
|
|
||
|
|
- name: Enable and start phoenixd
|
||
|
|
systemd:
|
||
|
|
name: phoenixd
|
||
|
|
enabled: yes
|
||
|
|
state: started
|
||
|
|
|
||
|
|
- name: Flush handlers so phoenixd is running before we inspect its data dir
|
||
|
|
meta: flush_handlers
|
||
|
|
|
||
|
|
# --- First boot checks ---
|
||
|
|
- name: Wait for phoenixd to write its config file
|
||
|
|
wait_for:
|
||
|
|
path: "{{ phoenixd_data_dir }}/phoenix.conf"
|
||
|
|
state: present
|
||
|
|
timeout: 120
|
||
|
|
|
||
|
|
- name: Check that the seed file exists
|
||
|
|
stat:
|
||
|
|
path: "{{ phoenixd_data_dir }}/seed.dat"
|
||
|
|
register: phoenixd_seed_file
|
||
|
|
|
||
|
|
- name: Fail if phoenixd did not create a seed
|
||
|
|
assert:
|
||
|
|
that:
|
||
|
|
- phoenixd_seed_file.stat.exists
|
||
|
|
fail_msg: "phoenixd started but {{ phoenixd_data_dir }}/seed.dat is missing - check 'journalctl -u phoenixd'"
|