Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adapt start/stop uploaders for multi user setup #255

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions resources/ansible/start_uploaders.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@
hosts: all
become: True
tasks:
- name: stop all autonomi uploader service
- name: get list of ant users
ansible.builtin.shell: "getent passwd | grep '^ant[0-9]\\+:' | cut -d: -f1"
register: ant_users
changed_when: false

- name: start all ant uploader services
ansible.builtin.systemd:
name: "ant_uploader_{{ item }}"
name: "ant_uploader_{{ item | regex_replace('ant([0-9]+)', '\\1') }}"
state: started
enabled: yes
become: true
loop: "{{ range(1, ant_uploader_instances | int + 1) | list }}"
loop: "{{ ant_users.stdout_lines }}"
14 changes: 9 additions & 5 deletions resources/ansible/stop_uploaders.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
---
- name: ensure the safe uploader service is stopped
- name: ensure the ant uploader service is stopped
hosts: all
become: True
tasks:
- name: stop all autonomi uploader service
- name: get list of ant users
ansible.builtin.shell: "getent passwd | grep '^ant[0-9]\\+:' | cut -d: -f1"
register: ant_users
changed_when: false

- name: stop all ant uploader services
ansible.builtin.systemd:
name: "ant_uploader_{{ item }}"
name: "ant_uploader_{{ item | regex_replace('ant([0-9]+)', '\\1') }}"
state: stopped
enabled: yes
become: true
loop: "{{ range(1, ant_uploader_instances | int + 1) | list }}"
ignore_errors: "{{ skip_err | default(false) }}"
loop: "{{ ant_users.stdout_lines }}"
Loading