diff --git a/files/bec_set_account b/files/bec_set_account new file mode 100755 index 0000000..bf724fe Binary files /dev/null and b/files/bec_set_account differ diff --git a/tasks/main.yaml b/tasks/main.yaml index f9543b4..783c124 100644 --- a/tasks/main.yaml +++ b/tasks/main.yaml @@ -174,6 +174,20 @@ state: link when: not ansible_check_mode +- name: Copy BEC set account binary + become_user: "{{ bec_user }}" + ansible.builtin.copy: + src: bec_set_account + dest: "{{ bec_path }}/bec/bin/bec_set_account/bec_set_account" + mode: u+x,g=x,o= + +- name: Copy BEC set account script + become_user: "{{ bec_user }}" + ansible.builtin.template: + src: bec-set-account.j2 + dest: "{{ bec_path }}/bec-set-account" + mode: u+x,g=x,o= + # BEC client-related tasks - name: Add bec startup script ansible.builtin.template: diff --git a/templates/bec-set-account.j2 b/templates/bec-set-account.j2 new file mode 100755 index 0000000..1d47091 --- /dev/null +++ b/templates/bec-set-account.j2 @@ -0,0 +1,8 @@ +#!/bin/sh + +if [ $# -ne 1 ]; then + echo "Provide exactly one argument: the pgroup name." + exit 1 +fi + +exec {{ bec_path }}/bec/bin/bec_set_account/bec_set_account -redis-host {{ ansible_hostname }} -pgroup "$1"