| --- |
| - name: Add nexus simulation hosts to /etc/hosts |
| lineinfile: |
| regexp: "^{{ ansible_default_ipv4.address | regex_escape() }} {{ etc_hosts | join(' ') | regex_escape() }}$" |
| line: "{{ ansible_default_ipv4.address }} {{ etc_hosts | join(' ') }}" |
| insertafter: EOF |
| path: /etc/hosts |
| unsafe_writes: true |
| |
| - name: "Create needed dirs for nexus role" |
| file: |
| path: "{{ item }}" |
| state: directory |
| mode: "u+rw,g+wx,o+rwx" |
| recurse: true |
| loop: |
| - "{{ app_data_path }}/nexus_data" |
| - "{{ infra_images_path }}" |
| - "{{ aux_data_path }}" |
| |
| - name: Download and archive docker images for the nexus role to use |
| delegate_to: localhost |
| docker_image: |
| name: "{{ item.name }}" |
| tag: "{{ item.tag | default('latest') }}" # Tag given in 'name' has precedence over the one declared here |
| archive_path: "{{ item.archive_path }}" |
| loop: "{{ prepare_nexus_images }}" |
| |
| - name: Copy docker images to node |
| copy: |
| src: "{{ item.archive_path }}" |
| dest: "{{ item.dest }}" |
| loop: "{{ prepare_nexus_images }}" |