From 041bab88c0bbf4c55be5d7e2b4ce9773b6538f98 Mon Sep 17 00:00:00 2001 From: int32bit Date: Wed, 11 Sep 2019 19:04:12 +0800 Subject: [PATCH] Assure group when push system user to asset (#3155) Some OS like SUSE12SP3 may not create group when create an OS user. In this case, the task "Set home dir permission" will always fail as the group doesn't exist in the system. --- apps/assets/tasks.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/assets/tasks.py b/apps/assets/tasks.py index 5fa7bc452..20bbcd5e6 100644 --- a/apps/assets/tasks.py +++ b/apps/assets/tasks.py @@ -384,6 +384,15 @@ def get_push_linux_system_user_tasks(system_user): ), } }, + { + 'name': 'Add group {}'.format(system_user.username), + 'action': { + 'module': 'group', + 'args': 'name={} state=present'.format( + system_user.username, + ), + } + }, { 'name': 'Check home dir exists', 'action': {