From 800a6b6ebc5776a50399884b090dcba0f95e9d43 Mon Sep 17 00:00:00 2001 From: Aravinth Manivannan Date: Sat, 9 Dec 2023 03:30:10 +0530 Subject: [PATCH] fix: dont use atm user --- ansible/base.yml | 1 - ansible/cache.yml | 1 - ansible/locust.yml | 1 - ansible/mcaptcha.yml | 1 - ansible/ping.yml | 1 - ansible/roles/docker/tasks/main.yml | 4 ++-- ansible/vars/mcaptcha/mariadb.yml | 4 ++-- 7 files changed, 4 insertions(+), 9 deletions(-) diff --git a/ansible/base.yml b/ansible/base.yml index 6804a12..401a6a7 100644 --- a/ansible/base.yml +++ b/ansible/base.yml @@ -5,7 +5,6 @@ --- - name: Install and enable firewall hosts: all - remote_user: atm pre_tasks: - name: Ensure all VMs are reachable ansible.builtin.ping: diff --git a/ansible/cache.yml b/ansible/cache.yml index 04231df..b5fff3d 100644 --- a/ansible/cache.yml +++ b/ansible/cache.yml @@ -7,7 +7,6 @@ - name: Install redis cache hosts: mcaptcha_hosts - remote_user: atm pre_tasks: - name: Ensure all VMs are reachable ansible.builtin.ping: diff --git a/ansible/locust.yml b/ansible/locust.yml index 695279c..401980d 100644 --- a/ansible/locust.yml +++ b/ansible/locust.yml @@ -7,7 +7,6 @@ - name: Configure Locust instances hosts: [mcaptcha_dos] - remote_user: atm pre_tasks: - name: Ensure all VMs are reachable ansible.builtin.ping: diff --git a/ansible/mcaptcha.yml b/ansible/mcaptcha.yml index c96999f..67ba5bb 100644 --- a/ansible/mcaptcha.yml +++ b/ansible/mcaptcha.yml @@ -42,7 +42,6 @@ - name: Install mCaptcha binary hosts: mcaptcha_hosts - remote_user: atm vars_files: - vars/mcaptcha/vars.yml roles: diff --git a/ansible/ping.yml b/ansible/ping.yml index 8fcead6..400907d 100644 --- a/ansible/ping.yml +++ b/ansible/ping.yml @@ -5,7 +5,6 @@ --- - name: Ping all servers hosts: all - remote_user: atm tasks: - name: Ensure all VMs are reachable diff --git a/ansible/roles/docker/tasks/main.yml b/ansible/roles/docker/tasks/main.yml index a204433..d900e03 100644 --- a/ansible/roles/docker/tasks/main.yml +++ b/ansible/roles/docker/tasks/main.yml @@ -39,8 +39,8 @@ name: docker state: present -- name: Add user atm to docker group +- name: Add user to docker group become: true ansible.builtin.user: - name: atm # TODO: add admin user to docker group + name: "{{ ansible_user_id }}" groups: docker,users,admin diff --git a/ansible/vars/mcaptcha/mariadb.yml b/ansible/vars/mcaptcha/mariadb.yml index e142d47..c45df2f 100644 --- a/ansible/vars/mcaptcha/mariadb.yml +++ b/ansible/vars/mcaptcha/mariadb.yml @@ -1,8 +1,8 @@ --- # Set this to the user ansible is logging in as - should have root # or sudo access -mysql_user_home: /home/atm -mysql_user_name: atm +mysql_user_home: "/home/{{ ansible_user_id }}" +mysql_user_name: "{{ ansible_user_id }}" # The default root user installed by mysql - almost always root mysql_root_home: /root