Skip to content

Commit

Permalink
run install and uninstall tasks as root user
Browse files Browse the repository at this point in the history
should fix issue #8
  • Loading branch information
bmillemathias committed Jan 15, 2022
1 parent 9e41df9 commit d65d74c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
name:
- tar
- gzip
become: true

- name: create seaweedfs user
user:
Expand All @@ -21,13 +22,15 @@
groups: "{{ weed.user.groups | default(omit) }}"
system: true
create_home: false
become: true

- name: Download seaweed archive
unarchive:
src: "{{ download_url }}"
dest: "{{ weed.location }}"
remote_src: yes
register: weed_download
become: true

- name: check correct weed version is installed
command:
Expand All @@ -38,6 +41,7 @@

- name: configure master server
when: "'weed_master' in group_names"
become: true
block:
- name: Ensure master datapath exists
file:
Expand Down Expand Up @@ -68,6 +72,8 @@
timeout: 30

- name: configure volume server
when: "'weed_volume' in group_names"
become: true
block:
- name: Ensure volume datapath exists
file:
Expand Down Expand Up @@ -99,6 +105,7 @@

- name: configure filer server
when: "'weed_filer' in group_names"
become: true
block:
- name: Ensure filer datapath exists
file:
Expand Down
5 changes: 5 additions & 0 deletions tasks/uninstall.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
- name: remove filer server
when: "'weed_filer' in group_names"
become: true
block:
- name: stop seaweedfs-filer.service
systemd:
Expand Down Expand Up @@ -31,6 +32,7 @@

- name: remove volume server
when: "'weed_volume' in group_names"
become: true
block:
- name: stop seaweedfs-volume.service
systemd:
Expand Down Expand Up @@ -61,6 +63,7 @@

- name: remove master server
when: "'weed_master' in group_names"
become: true
block:
- name: stop seaweedfs-master.service
systemd:
Expand Down Expand Up @@ -89,11 +92,13 @@
- wipe_data is true

- name: remove seaweed binary
become: true
file:
path: "{{ weed.location }}/weed"
state: absent

- name: delete seaweedfs user
become: true
user:
name: "{{ weed.user.name }}"
state: absent
Expand Down

0 comments on commit d65d74c

Please sign in to comment.