Commit 909e5a1c authored by Christopher Harm's avatar Christopher Harm

Adding wildfly 11 role

parent 27b5a15e
---
# file: roles/wildfly10/defaults/main.yml
wildfly_user_home: no
connect
if (outcome == failed) of /subsystem=security/security-domain=psu-jaspi-security-domain:read-resource
/subsystem=security/security-domain=psu-jaspi-security-domain:add(cache-type=default)
end-if
if (outcome == failed) of /subsystem=security/security-domain=psu-jaspi-security-domain/authentication=jaspi:read-resource
/subsystem=security/security-domain=psu-jaspi-security-domain/authentication=jaspi:add( \
auth-modules=[ \
{"code"=>"Dummy", "login-module-stack-ref"=>"psu-lm-stack", "flag"=>"required"} \
] \
)
/subsystem=security/security-domain=psu-jaspi-security-domain/authentication=jaspi/login-module-stack=psu-lm-stack:add( \
login-modules=[ { \
"code"=>"edu.psu.javaee.security.login.DummyLoginModule", \
"flag"=>"optional" \
} ], \
operation-headers={"allow-resource-service-restart"=>"true"} \
)
end-if
connect
/subsystem=ejb3:write-attribute(name=default-slsb-instance-pool,value=slsb-strict-max-pool)
connect
deploy --force /usr/share/java/postgresql92-jdbc.jar
connect
/interface=management:undefine-attribute(name=inet-address)
/interface=management:write-attribute(name=any-address,value=true)
/interface=public:undefine-attribute(name=inet-address)
/interface=public:write-attribute(name=any-address,value=true)
/interface=unsecure:undefine-attribute(name=inet-address)
/interface=unsecure:write-attribute(name=any-address,value=true)
reload
\ No newline at end of file
connect
try
/subsystem=logging/logger=edu.psu:add(category=edu.psu,level=DEBUG)
catch
/subsystem=logging/logger=edu.psu:remove
/subsystem=logging/logger=edu.psu:add(category=edu.psu,level=DEBUG)
finally
/subsystem=logging/console-handler=CONSOLE:change-log-level(level=DEBUG)
end-try
---
# file: roles/wildfly10/handlers/main.yml
- name: restart wildfly
service: name={{ wildfly_service_name }} state=restarted
---
# File: roles/wildfly10/tasks/main.yml
- name: download the wildfly archive file
get_url: url="{{ wildfly_archive_url }}"
dest="~/{{ wildfly_archive_name }}"
- name: unzip the Wildfly archive file
shell: unzip -u ~/{{ wildfly_archive_name }} -d {{ wildfly_inst_directory }}
creates={{ wildfly_inst_directory }}/{{ wildfly_name }}
notify:
- restart wildfly
- name: create the wildfly group
group: name="{{ wildfly_group }}" state=present
- name: create the wildfly user
user: name="{{ wildfly_user }}" group="{{ wildfly_group }}" password="{{ wildfly_password }}" createhome={{ wildfly_user_home }} state=present
- name: make the wildfly user the owner of the wildfly files
file: path="{{ wildfly_inst_directory }}/{{ wildfly_name }}"
owner="{{ wildfly_user }}" group="{{ wildfly_group }}"
recurse=yes state=directory
- name: make a pretty symlink for wildfly
file: src="{{ wildfly_inst_directory }}/{{ wildfly_name }}"
path="{{ wildfly_inst_directory }}/{{ wildfly_service_name }}"
owner="{{ wildfly_user }}" group="{{ wildfly_group }}" state=link
- name: create the directories for wildfly's PID and log files
file: path="{{ item }}" state=directory
owner="{{ wildfly_user }}" group="{{ wildfly_group }}"
with_items:
- "{{ wildfly_log_directory }}"
- "{{ wildfly_pid_directory }}"
- name: set the JBOSS_USER environment variable in the startup script configuration file
lineinfile: dest="{{ wildfly_home_directory }}/docs/contrib/scripts/init.d/wildfly.conf"
regexp="^JBOSS_USER" insertafter="^# JBOSS_USER" line="JBOSS_USER={{ wildfly_user }}"
- name: set the WILDFLY_NAME in the Wildfly startup script
lineinfile: dest="{{ wildfly_home_directory }}/docs/contrib/scripts/init.d/wildfly-init-redhat.sh"
regexp="^WILDFLY_NAME=" line="WILDFLY_NAME=wildfly"
notify:
- restart wildfly
- name: create a symlink for the startup script configuration file
file: src="{{ wildfly_home_directory }}/docs/contrib/scripts/init.d/wildfly.conf"
path="/etc/default/{{ wildfly_service_name }}.conf"
state=link
- name: create a symlink for the startup script
file: src="{{ wildfly_home_directory }}/docs/contrib/scripts/init.d/wildfly-init-redhat.sh"
path="/etc/init.d/{{ wildfly_service_name }}"
state=link
- name: register the wildfly startup script with chkconfig
shell: chkconfig --add wildfly creates=/etc/rc0.d/K20wildfly
- name: configure chkconfig to run the wildfly startup script at the correct run-levels
shell: chkconfig --level 2345 wildfly on creates=/etc/rc2.d/S80wildfly
- name: save a copy of the wildfly distribution's standalone.xml
shell: mv standalone.xml standalone.xml.dist
chdir="{{ wildfly_conf_directory }}" creates=standalone.xml.dist
- name: copy the selected standalone wildfly profile to standalone.xml
shell: cp {{ wildfly_profile }}.xml standalone.xml
chdir="{{ wildfly_conf_directory }}" creates=standalone.xml
- name: copy the wildfly scripts to the remote host's deployment directory
copy: src="{{ item }}" dest=~
with_items:
- wildfly_set_interface_addresses.cli
- wildfly_set_logging_level.cli
- psu-security-domain.cli
- wildfly-slsb-pool.cli
- name: make sure wildfly is started
service: name="{{ wildfly_service_name }}" state="started"
- name: run some wildfly configuration scripts
shell: chdir=~ {{ wildfly_prog_directory }}/jboss-cli.sh --file="{{ item }}"
with_items:
- wildfly_set_interface_addresses.cli
- wildfly_set_logging_level.cli
- wildfly-slsb-pool.cli
- psu-security-domain.cli
- name: add an admin user for wildfly's web console
lineinfile: dest="{{ wildfly_conf_directory }}/mgmt-users.properties"
regexp="^vadmin=" insertafter="^#admin=" line="vadmin=d745a3c00ee100da10ad80d86e6f2dec"
- name: deploy the postgresql jdbc driver
jboss: src=/usr/share/java/postgresql92-jdbc.jar state=present
deploy_path={{ wildfly_deploy_directory }} deployment=postgresql92-jdbc.jar
when: db_postgresql_installed is defined and db_postgresql_installed == true
- name: create facts file
lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' create=true regexp='[wildfly]' line='[wildfly]'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_download_url' line='wildfly_download_url={{ wildfly_download_url }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_version' line='wildfly_version={{ wildfly_version }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_name' line='wildfly_name={{ wildfly_name }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_archive_name' line='wildfly_archive_name={{ wildfly_archive_name }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_archive_url' line='wildfly_archive_url={{ wildfly_archive_url }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_user' line='wildfly_user={{ wildfly_user }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_group' line='wildfly_group={{ wildfly_group }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_password' line='wildfly_password={{ wildfly_password }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_service_name' line='wildfly_service_name={{ wildfly_service_name }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_profile' line='wildfly_profile={{ wildfly_profile }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_inst_directory' line='wildfly_inst_directory={{ wildfly_inst_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_home_directory' line='wildfly_home_directory={{ wildfly_home_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_conf_directory' line='wildfly_conf_directory={{ wildfly_conf_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_deploy_directory' line='wildfly_deploy_directory={{ wildfly_deploy_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_prog_directory' line='wildfly_prog_directory={{ wildfly_prog_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_work_directory' line='wildfly_work_directory={{ wildfly_work_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_log_directory' line='wildfly_log_directory={{ wildfly_log_directory }}'"
- lineinfile: "dest='/etc/ansible/facts.d/build_vars.fact' regexp='wildfly_pid_directory' line='wildfly_pid_directory={{ wildfly_pid_directory }}'"
---
# file: roles/wildfly10/vars/main.yml
wildfly_download_url: "http://download.jboss.org/wildfly"
wildfly_version: "11.0.0.Final"
wildfly_name: "wildfly-{{ wildfly_version }}"
wildfly_archive_name: "{{ wildfly_name }}.zip"
wildfly_archive_url: "{{ wildfly_download_url }}/{{ wildfly_version }}/{{ wildfly_archive_name }}"
wildfly_user: "wildfly"
wildfly_group: "wildfly"
wildfly_password: "$1$salty$SzJsU4qDcXp536Acnlp6I."
wildfly_service_name: "wildfly"
wildfly_profile: standalone-full
wildfly_inst_directory: "/opt"
wildfly_home_directory: "{{ wildfly_inst_directory }}/wildfly"
wildfly_conf_directory: "{{ wildfly_home_directory }}/standalone/configuration"
wildfly_deploy_directory: "{{ wildfly_home_directory }}/standalone/deployments"
wildfly_prog_directory: "{{ wildfly_home_directory }}/bin"
wildfly_work_directory: "/var/lib/jboss-as/standalone"
wildfly_log_directory: "/var/log/{{ wildfly_service_name }}"
wildfly_pid_directory: "/var/run/{{ wildfly_service_name }}"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment