Skip to content

Commit

Permalink
Added support for Nexus 3.1.x release
Browse files Browse the repository at this point in the history
  • Loading branch information
samherve committed Oct 31, 2016
1 parent 8cb3348 commit 746cbca
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ All configuration can be updated by re-running the role, except for the [blobsto

Ansible variables, along with the default values (see `default/main.yml`) :

nexus_version: '3.0.1-01'
nexus_version: '3.1.0-04'
nexus_timezone: 'UTC'
nexus_package: "nexus-{{ nexus_version }}-unix.tar.gz"

The nexus version and package to install, see available versions at https://www.sonatype.com/download-oss-sonatype .
The nexus version and package to install, see available versions at https://www.sonatype.com/download-oss-sonatype . `nexus_timezone` is a Java Timezone name and can be useful in combination with `nexus_scheduled_tasks` cron expressions below.

nexus_download_dir: '/tmp'

Expand Down Expand Up @@ -212,7 +213,7 @@ The java and httpd requirements /can/ be fulfilled with the following galaxy rol
become: yes
vars:
nexus_version: '3.0.1-01'
nexus_version: '3.1.0-04'
nexus_timezone: 'Canada/Eastern'
nexus_admin_password: "{{ vault_nexus_admin_password }}"
httpd_server_name: 'nexus.vm'
Expand Down
2 changes: 1 addition & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
nexus_version: '3.0.2-02'
nexus_version: '3.1.0-04'
nexus_package: "nexus-{{ nexus_version }}-unix.tar.gz"
nexus_download_dir: '/tmp'
nexus_os_group: 'nexus'
Expand Down
15 changes: 14 additions & 1 deletion tasks/nexus_install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
- name: Delete unpacked data directory
file: path="{{ nexus_installation_dir }}/nexus-latest/data" state=absent

- name: Delete unpacked data directory
file: path="{{ nexus_installation_dir }}/sonatype-work" state=absent

- name: Allow nexus to create first-time install configuration files in {{ nexus_installation_dir }}/nexus-latest/etc
file:
path: "{{ nexus_installation_dir }}/nexus-latest/etc"
Expand Down Expand Up @@ -72,9 +75,19 @@
- name: Set nexus user
lineinfile: dest="/opt/nexus-latest/bin/nexus.rc" regexp=".*run_as_user=.*" line="run_as_user=\"{{ nexus_os_user }}\""

- name: Get path to default settings
set_fact:
nexus_default_settings_file: "{{ nexus_installation_dir }}/nexus-latest/etc/org.sonatype.nexus.cfg"
when: nexus_version < '3.1.0'

- name: Get path to default settings
set_fact:
nexus_default_settings_file: "{{ nexus_installation_dir }}/nexus-latest/etc/nexus-default.properties"
when: nexus_version >= '3.1.0'

- name: Bind nexus service to 127.0.0.1 only
lineinfile:
dest: "{{ nexus_installation_dir }}/nexus-latest/etc/org.sonatype.nexus.cfg"
dest: "{{ nexus_default_settings_file }}"
regexp: "^application-host=.*"
line: "application-host=127.0.0.1"
when: httpd_setup_enable
Expand Down

0 comments on commit 746cbca

Please sign in to comment.