Initial commit

This commit is contained in:
Ansible Core Team 2020-03-09 09:11:07 +00:00
commit aebc1b03fd
4861 changed files with 812621 additions and 0 deletions

View file

@ -0,0 +1,8 @@
wf_tmp_dir: '{{ remote_tmp_dir }}/wildfly_tmp'
wf_homedir: '{{ wf_tmp_dir }}/wildfly'
wf_service_file_path: /etc/systemd/system/wildfly.service
wf_version: 16.0.0.Final
wf_user: wildfly
jboss_root: '{{ wf_homedir }}'
deploy_dir: '{{ jboss_root }}/standalone/deployments'
default_deploy_root: /var/lib/jbossas/standalone/deployments

View file

@ -0,0 +1,8 @@
# The configuration you want to run
WILDFLY_CONFIG=standalone.xml
# The mode you want to run
WILDFLY_MODE=standalone
# The address to bind to
WILDFLY_BIND=0.0.0.0

View file

@ -0,0 +1,13 @@
- name: Stop wildfly (jboss)
systemd:
name: wildfly
state: stopped
ignore_errors: yes
- name: Remove files
file:
path: '{{ item }}'
state: absent
loop:
- '{{ wf_service_file_path }}'
- '{{ default_deploy_root }}'

View file

@ -0,0 +1,2 @@
dependencies:
- setup_remote_tmp_dir

View file

@ -0,0 +1,94 @@
- name: Skip unsupported platforms
meta: end_play
when: (ansible_distribution != 'CentOS') or
(ansible_distribution == 'CentOS' and ansible_distribution_major_version is not version('7', '>='))
- name: Install java
package:
name: java-1.8.0-openjdk-devel
- name: Create wf_tmp_dir
file:
path: '{{ wf_tmp_dir }}'
state: directory
- name: Download wildfly
get_url:
url: 'https://ansible-ci-files.s3.amazonaws.com/test/integration/targets/setup_wildfly_server/wildfly-{{ wf_version }}.tar.gz'
dest: '{{ wf_tmp_dir }}/wildfly-{{ wf_version }}.tar.gz'
- name: Unarchive tar
unarchive:
src: '{{ wf_tmp_dir }}/wildfly-{{ wf_version }}.tar.gz'
dest: '{{ wf_tmp_dir }}'
remote_src: yes
- name: Remove tar
file:
path: '{{ wf_tmp_dir }}/wildfly-{{ wf_version }}.tar.gz'
state: absent
- name: Create symlink
file:
src: '{{ wf_tmp_dir }}/wildfly-{{ wf_version }}'
dest: '{{ wf_tmp_dir }}/wildfly'
state: link
- name: Create group for wildfly
group:
name: '{{ wf_user }}'
system: yes
- name: Create user for wildfly
user:
name: '{{ wf_user }}'
system: yes
group: '{{ wf_user }}'
home: '{{ wf_homedir }}'
- name: Set permissions
file:
path: '{{ remote_tmp_dir }}'
state: directory
owner: '{{ wf_user }}'
group: '{{ wf_user }}'
recurse: yes
- name: Create config file
copy:
src: wildfly.conf
dest: '{{ wf_homedir }}/wildfly.conf'
- name: Create launcher
template:
src: launch.sh.j2
dest: '{{ wf_homedir }}/bin/launch.sh'
- name: Make scripts executable
shell: 'chmod +x {{ wf_homedir }}/bin/*.sh'
- name: Create service file
template:
src: wildfly.service.j2
dest: '{{ wf_service_file_path }}'
- name: Create directories for testing the default deploy_path
become: yes
file:
path: '{{ default_deploy_root }}'
state: directory
recurse: yes
owner: '{{ wf_user }}'
group: '{{ wf_user }}'
- name: Create simlink for testing the default deploy_path
file:
state: link
src: '{{ deploy_dir }}'
dest: '{{ default_deploy_root }}/deployments'
- name: Reload systemd and start wildfly
systemd:
daemon_reload: yes
name: wildfly
state: started

View file

@ -0,0 +1,11 @@
#!/usr/bin/env bash
if [ "x$WILDFLY_HOME" = "x" ]; then
WILDFLY_HOME="{{ wf_homedir }}"
fi
if [[ "$1" == "domain" ]]; then
$WILDFLY_HOME/bin/domain.sh -c "$2" -b "$3"
else
$WILDFLY_HOME/bin/standalone.sh -c "$2" -b "$3"
fi

View file

@ -0,0 +1,16 @@
[Unit]
Description=The WildFly Application Server
After=syslog.target network.target
Before=httpd.service
[Service]
Environment=LAUNCH_JBOSS_IN_BACKGROUND=1
EnvironmentFile=-{{ wf_homedir }}/wildfly.conf
User=wildfly
LimitNOFILE=102642
PIDFile=/var/run/wildfly/wildfly.pid
ExecStart={{ wf_homedir }}/bin/launch.sh $WILDFLY_MODE $WILDFLY_CONFIG $WILDFLY_BIND
StandardOutput=null
[Install]
WantedBy=multi-user.target