From 3f49db94372e427025d679d1426b0d5f7b56e926 Mon Sep 17 00:00:00 2001 From: Keir Williams Date: Tue, 16 Apr 2024 10:30:24 +0100 Subject: [PATCH] onr(get): add task to ensure user and group exist Otherwise this role fails - as it's setting permissions for users and groups which may not exist yet. --- ansible/roles/onr-get/tasks/ensure-user-group.yml | 9 +++++++++ ansible/roles/onr-get/tasks/main.yml | 5 +++++ 2 files changed, 14 insertions(+) create mode 100644 ansible/roles/onr-get/tasks/ensure-user-group.yml diff --git a/ansible/roles/onr-get/tasks/ensure-user-group.yml b/ansible/roles/onr-get/tasks/ensure-user-group.yml new file mode 100644 index 000000000..af11d7f9e --- /dev/null +++ b/ansible/roles/onr-get/tasks/ensure-user-group.yml @@ -0,0 +1,9 @@ +--- +- name: Ensure {{ boe_install_group }} group exists + ansible.builtin.group: + name: {{ boe_install_group }} + +- name: Ensure {{ boe_install_user }} user exists + ansible.builtin.user: + name: {{ boe_install_user }} + group: {{ boe_install_group }} diff --git a/ansible/roles/onr-get/tasks/main.yml b/ansible/roles/onr-get/tasks/main.yml index f249dc7c6..feae7fa5a 100644 --- a/ansible/roles/onr-get/tasks/main.yml +++ b/ansible/roles/onr-get/tasks/main.yml @@ -1,4 +1,9 @@ --- +- import_tasks: ensure-user-group.yml + tags: + - amibuild + - ec2provision + - import_tasks: download-software.yml tags: - amibuild