From c4e7412708e2a9738049282c278eb9324200a47e Mon Sep 17 00:00:00 2001 From: lavenderguitar Date: Fri, 18 Mar 2022 23:54:00 -0400 Subject: [PATCH] [501] become_user requires become to work as expected --- tasks/configure.yml | 50 ++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/tasks/configure.yml b/tasks/configure.yml index 97cf99d..68c09ee 100644 --- a/tasks/configure.yml +++ b/tasks/configure.yml @@ -1,31 +1,29 @@ --- -- name: kuma | Setup kuma - command: npm run setup - args: - chdir: "{{ kuma__path }}" - become_user: "{{ kuma__user }}" +- block: + - name: kuma | Setup kuma + command: npm run setup + args: + chdir: "{{ kuma__path }}" -- name: kuma | Clear all pm2 apps - command: pm2 delete all - args: - chdir: "{{ kuma__path }}" - become_user: "{{ kuma__user }}" + - name: kuma | Clear all pm2 apps + command: pm2 delete all + args: + chdir: "{{ kuma__path }}" -- name: kuma | Create systemd startup script - command: env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u {{ kuma__user }} --hp /home/{{ kuma__user }} - args: - chdir: "{{ kuma__path }}" - become: yes - become_user: "{{ kuma__user }}" + - name: kuma | Create systemd startup script + command: env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u {{ kuma__user }} --hp /home/{{ kuma__user }} + args: + chdir: "{{ kuma__path }}" + become: yes -- name: kuma | Start kuma - command: pm2 start server/server.js --name kuma - args: - chdir: "{{ kuma__path }}" - become_user: "{{ kuma__user }}" + - name: kuma | Start kuma + command: pm2 start server/server.js --name kuma + args: + chdir: "{{ kuma__path }}" -- name: kuma | Ensure pm2 startup configuration is enabled for reboots. - command: pm2 save - args: - chdir: "{{ kuma__path }}" - become_user: "{{ kuma__user }}" \ No newline at end of file + - name: kuma | Ensure pm2 startup configuration is enabled for reboots. + command: pm2 save + args: + chdir: "{{ kuma__path }}" + become_user: "{{ kuma__user }}" + become: yes \ No newline at end of file