playbook adjustments
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Gitea 2021-08-07 14:08:17 -04:00
parent 72b8192f3b
commit 4bddee9ee9

View File

@ -9,38 +9,45 @@
return_content: true return_content: true
register: simpbot_latest register: simpbot_latest
- name: "installing simpbot {{ simpbot_latest.json.tag_name }}" - name: "downloading and installing simpbot {{ simpbot_latest.json[0].tag_name }}"
loop: "{{ simpbot_latest.json.[0].assets }}" block:
when: "'amd64.tar.gz' in item.name" - name: create temp directory
unarchive: tempfile:
remote_src: yes state: directory
src: "{{ item.browser_download_url }}" suffix: dwn
dest: "/tmp/simpbot" register: tempfolder_1
keep_newer: yes
extra_opts:
- --strip=1
- --no-anchored
- simpbot
- name: installing simpbot binary - name: download simpbot
copy: loop: "{{ simpbot_latest.json[0].assets }}"
src: /tmp/simpbot/simpbot when: "'amd64.tar.gz' in item.name"
dest: /usr/local/bin/ unarchive:
register: new_binary remote_src: yes
src: "{{ item.browser_download_url }}"
dest: "{{ tempfolder_1.path }}"
keep_newer: yes
- name: installing unit file - name: installing simpbot binary
copy: copy:
src: /tmp/simpbot/init/simpbot.service remote_src: yes
dest: /etc/systemd/system/simpbot.service src: "{{ tempfolder_1.path }}/simpbot"
register: new_unit dest: /usr/local/bin/
mode: '0755'
register: new_binary
- name: installing unit file
copy:
remote_src: yes
src: "{{ tempfolder_1.path }}/init/simpbot.service"
dest: /etc/systemd/system/simpbot.service
register: new_unit
- name: reload systemd with new unit - name: reload systemd with new unit
systemd: systemd:
daemon_reload: yes daemon_reload: yes
when: new_unit || new_binary when: new_unit.changed or new_binary.changed
- name: start service - name: start service
systemd: systemd:
name: simpbot name: simpbot
state: restarted state: restarted
when: new_binary when: new_binary.changed