Skip to content

Commit

Permalink
stop service before copy if exists
Browse files Browse the repository at this point in the history
  • Loading branch information
mvrahden committed Apr 22, 2024
1 parent 5312fdf commit 677ccde
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion molecule/default/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
bitcoind_version: 27.0

tasks:
- name: "Retrieve information from /usr/local/bitcoin-core-{{ bitcoind_version }}"
- name: "Retrieve information from /usr/local/bin/*"
ansible.builtin.stat:
path: "/usr/local/bin/{{ item }}"
register: bitcoind_bins
Expand Down
9 changes: 9 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,15 @@
extra_opts:
- --strip-components=1

- name: "Bitcoind | Ensure 'bitcoind-{{ bitcoind_network }}.service' systemd unit is stopped"
ansible.builtin.systemd:
name: bitcoind-{{ bitcoind_network }}.service
state: stopped
register: _bitcoind_systemd_stop
failed_when:
- _bitcoind_systemd_stop.failed
- "'Could not find the requested service' not in _bitcoind_systemd_stop.msg"

- name: "Bitcoind | Install binaries into '/usr/local/bin/*'"
ansible.builtin.copy:
src: /tmp/bitcoin-core-{{ bitcoind_version }}/bin/
Expand Down

0 comments on commit 677ccde

Please sign in to comment.