summaryrefslogtreecommitdiffstats
path: root/ansible/roles/nexus/tasks/install.yml
blob: 1756b708aa30ad7d4b4c8187170dbc5b240347a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
---
- name: Change ownership of nexus_data
  file:
    path: "{{ app_data_path }}/nexus_data"
    owner: 200
    group: 200
    recurse: yes

- name: Load nexus image
  docker_image:
    name: sonatype/nexus3
    load_path: "{{ app_data_path }}/offline_data/docker_images_infra/sonatype_nexus3_latest.tar"
    state: present
    timeout: 120

- name: Create nexus network
  docker_network:
    name: nexus_network
    state: present

- name: Run nexus container
  docker_container:
    name: nexus
    image: sonatype/nexus3
    networks:
      - name: nexus_network
    volumes:
      - "{{ app_data_path }}/nexus_data:/nexus-data:rw"
    state: started
    restart_policy: unless-stopped