Skip to content

Commit 23bf0fd

Browse files
committed
allow adding tomcat user to tomcat group
1 parent 8db84d1 commit 23bf0fd

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

defaults/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ tomcat_user: tomcat
1515
tomcat_group: tomcat
1616
tomcat_allow_user_restart: false
1717
tomcat_umask: '0022'
18+
tomcat_add_user_to_group: false
1819

1920
# This will be randomly generated every ansible run if not set
2021
tomcat_shutdown_value: 'SETME'

tasks/main.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@
1717
- name: ensure tomcat is installed (rpm)
1818
include_tasks: install_repo.yml
1919
when: tomcat_install_from_repo
20+
tags: ['tomcat']
21+
22+
- name: Add tomcat user to tomcat group if configured
23+
user:
24+
name: "{{ tomcat_user }}"
25+
append: true
26+
groups: ["{{ tomcat_group }}"]
27+
when: tomcat_add_user_to_group
28+
tags: ['tomcat']
2029

2130
- set_fact:
2231
tomcat_shutdown_value: "{{ lookup('password', '/dev/null length=20 chars=ascii_letters') }}"

0 commit comments

Comments
 (0)