From f13fb656d038a1aa20f23fc73d9090e446098b82 Mon Sep 17 00:00:00 2001 From: Steve Smith Date: Thu, 30 May 2019 11:35:22 +1000 Subject: [PATCH] DCD-386: Move user creation up to linux_common as NFS needs to share the UID. --- group_vars/aws_node_local.yml | 3 +++ roles/linux_common/tasks/main.yml | 6 ++++++ roles/product_common/tasks/main.yml | 5 ----- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/group_vars/aws_node_local.yml b/group_vars/aws_node_local.yml index e533d51..1285b68 100644 --- a/group_vars/aws_node_local.yml +++ b/group_vars/aws_node_local.yml @@ -14,6 +14,9 @@ postgres_version: "9.6" git_version: "2.14.4" atl_shared_mountpoint: "/media/atl" +# Simplify NFS mapping by using a fixed UID +atl_product_user_uid: '2001' + # FIXME: Some of these should be overridden from the environment? atl_home_base: "/var/atlassian/application-data" atl_product_home: "{{ atl_home_base }}/{{ atl_product_family }}" diff --git a/roles/linux_common/tasks/main.yml b/roles/linux_common/tasks/main.yml index d7df2ee..8ea4b52 100644 --- a/roles/linux_common/tasks/main.yml +++ b/roles/linux_common/tasks/main.yml @@ -14,3 +14,9 @@ - unzip - fontconfig - python-psycopg2 + +- name: Create product user + user: + name: "{{ atl_product_user }}" + uid: "{{ atl_product_user_uid }}" + comment: "Product runtime user" diff --git a/roles/product_common/tasks/main.yml b/roles/product_common/tasks/main.yml index 2dbc0e0..071ef0e 100644 --- a/roles/product_common/tasks/main.yml +++ b/roles/product_common/tasks/main.yml @@ -2,8 +2,3 @@ - name: Perform distro-specific tasks include_tasks: "{{ ansible_distribution|lower }}.yml" - -- name: Create product user - user: - name: "{{ atl_product_user }}" - comment: "Product runtime user"