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.
pull/3217/head^2
int32bit 2019-09-11 19:04:12 +08:00 committed by 老广
parent 996da2d90e
commit 041bab88c0
1 changed files with 9 additions and 0 deletions

View File

@ -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': {