Skip to content

Commit

Permalink
Feature: Management user creation
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Diego Romero González committed Oct 1, 2015
1 parent 11008d9 commit 531adf5
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ Role Variables
--------------

It's important to change the bind addresses to localhost or internal network in
production environments.
production environments. The management user is also intended for
non-production environments, so you must change these variables for production
or undefine them and the user creation task will be skipped.

Defaults:

Expand Down Expand Up @@ -35,6 +37,9 @@ Defaults:
wildfly_manage_port: 9990
wildfly_http_port: 8080

wildfly_management_user: "admin"
wildfly_management_password: "admin"

Example Playbook
----------------

Expand Down
3 changes: 3 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ wildfly_bind_address: 0.0.0.0
wildfly_management_bind_address: 0.0.0.0
wildfly_manage_port: 9990
wildfly_http_port: 8080

wildfly_management_user: "admin"
wildfly_management_password: "admin"
9 changes: 9 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@
template: src=version.j2 dest={{ wildfly_version_file }} owner=wildfly
group=wildfly mode=0750

# This status will always be "changed" unless skipped because it will update
# the user after its creation.
- name: Create management user
command: >
{{ wildfly_dir }}/bin/add-user.sh
{{ wildfly_management_user }} {{ wildfly_management_password }}
when: wildfly_management_user is defined and
wildfly_management_password is defined

# If we don't do this, there's a false changed status in the next run for some
# reason. Try removing this task and running the role twice, it makes no sense.
- name: Fix permission limbo
Expand Down

0 comments on commit 531adf5

Please sign in to comment.