install.yml 1.28 KB
---
# tasks file for jboss

- name: Check that Java is present
  yum:
    name: "{{ java_version }}"
    state: present
  tags:
    - java_install
    - install_yml

- name: Add a System user that runs the JBoss process
  user:
    name: "{{ system_user }}"
    state: present
    system: yes
  tags:
    - add_system_user
    - install_yml

- name: Copy the zip file to the remote server and unzip 
  unarchive:
    src: "{{ pkg_location | default('files/') }}{{ jboss_zip }}"
    dest: "{{ install_location }}"
    owner: "{{ system_user }}"
    group: "{{ system_user }}"
    creates: "{{ install_location }}{{ jboss_zip[:-6] }}/"
  tags:
    - copy_installer_zip
    - install_yml

- name: Copy the init script to /etc/init.d/
  copy:
    src: "{{ jboss_service_conf_home }}{{ jboss_service_script }}"
    dest: /etc/init.d/{{ service_name }}
    mode: 0755
    remote_src: yes
  tags:
    - copy_init_script
    - install_yml

- name: copy the JBoss service config to /etc/default/
  template:
    src: templates/{{ jboss_service_conf }}
    dest: /etc/default/
    owner: "{{ system_user }}"
    group: "{{ system_user }}"
  notify: restart jboss
  tags:
    - copy_service_config
    - install_yml

- name: reload daemon
  systemd:
    daemon_reload: yes
  tags:
    - reload_daemon
    - install_yml