Choose the user type and shell.

master
Andrea Dell'Amico 2 years ago
parent 707bb6adf7
commit 4fe65d83d8
Signed by: andrea.dellamico
GPG Key ID: 147ABE6CEB9E20FF

@ -1,5 +1,7 @@
---
springboot_config: True
springboot_system_user: true
springboot_user_shell: /usr/sbin/nologin
springboot_install_artifact: True
springboot_apps: []
# - { name: 'foo', log_dir: '/var/log/foo', install_dir: '/usr/lib/foo', state: 'present', app_conf_file: '', remote_conf_url: '', logback_url: '', logback_file: '', user: 'foo', java_opts: '', maven_repo_url: '', maven_id: '', maven_group_id: '', maven_extension: '', maven_version: '' }

@ -2,7 +2,7 @@
- name: User under with the service will run
block:
- name: Create the user that will run the springboot app {{ item.name }}
user: name={{ item.user }} home={{ item.install_dir }} createhome=no shell=/usr/sbin/nologin system=yes
user: name={{ item.user }} home={{ item.install_dir }} createhome=no shell={{ item.user_shell | default(springboot_user_shell) }} system={{ item.system_user | default(springboot_system_user) }}
with_items: '{{ springboot_apps }}'
when: item.user is defined

Loading…
Cancel
Save