ansible-role-nexus-oss/tasks/main.yml

44 lines
1.5 KiB
YAML

---
- block:
- name: Create a user for the Nexus OSS service
user: name={{ nexus_user }} home=/dev/null createhome=no shell=/usr/sbin/nologin system=yes
- name: Create the nexus logs directory
file: dest={{ nexus_logdir }} state=directory owner={{ nexus_user }} group={{ nexus_user }} mode=0755
- name: Install the systemd unit
template: src=nexus.service.j2 dest=/etc/systemd/system/nexus.service owner=root group=root mode='0644'
notify: Reload the systemd data
- meta:
free_form: flush_handlers
tags: [ 'nexus', 'nexus_oss' ]
- block:
- name: Create the nexus wrapper log directory
file: dest={{ nexus_wrapper_logdir }} state=directory owner={{ nexus_user }} group={{ nexus_user }} mode=0755
- name: Install the nexus wrapper configuration
template: src=wrapper.conf.j2 dest={{ nexus_wrapper_conf_dir }}/wrapper.conf owner=root group=root mode='0644'
notify: Restart Nexus
- name: Install the nexus base config
template: src=nexus.properties.j2 dest={{ nexus_webapp_dir }}/conf/nexus.properties owner=root group=root mode='0644'
notify: Restart Nexus
- name: Install the nexus access logs configuration
template: src=logback-access.xml.j2 dest={{ nexus_webapp_dir }}/conf/logback-access.xml owner=root group=root mode='0644'
- meta:
free_form: flush_handlers
when: nexus_major_version == '2'
tags: [ 'nexus', 'nexus_oss' ]
- block:
- name: Ensure that the Nexus service is started and enabled
service: name=nexus state=started enabled=yes
tags: [ 'nexus', 'nexus_oss' ]