| | |
| | | ## Sonatype Nexus Install |
| | | |
| | | ## |
| | | - name: Download Nexus template to master |
| | | get_url: |
| | | url: https://raw.githubusercontent.com/OpenShiftDemos/nexus/master/nexus{{nexus_version}}-persistent-template.yaml |
| | | - name: Copy Nexus template to master |
| | | copy: |
| | | src: files/nexus{{nexus_version}}-persistent-template.yaml |
| | | dest: /root/nexus-template.yaml |
| | | mode: 0440 |
| | | |
| | | - name: Check if Nexus was already provisioned |
| | | command: "oc get service nexus -n {{desired_project}}" |
| | | register: install_nexus |
| | | ignore_errors: true |
| | | changed_when: false |
| | | |
| | | ### We should add a check if a pv is already created (nexus requests a 10Gi pv) |
| | | - name: Instantiate Nexus from template |
| | | command: "oc process -f /root/nexus-template.yaml --param=VOLUME_CAPACITY=10Gi --param=MAX_MEMORY=2Gi -n {{desired_project}} | oc create -f - -n {{desired_project}}" |
| | | command: "oc new-app -f /root/nexus-template.yaml --param=VOLUME_CAPACITY=10Gi --param=MAX_MEMORY=2Gi -n {{desired_project}}" |
| | | when: install_nexus | failed |
| | | |
| | | # looks like we need a better check - it seems we're ready up to several |
| | |
| | | register: result |
| | | until: '"availableReplicas: 1" in result.stdout' |
| | | retries: 5 |
| | | delay: 60 |
| | | delay: 60 |
| | | changed_when: false |