summaryrefslogtreecommitdiffstats
path: root/ansible/roles/nexus
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles/nexus')
-rw-r--r--ansible/roles/nexus/.yamllint11
-rw-r--r--ansible/roles/nexus/defaults/main.yml2
-rw-r--r--ansible/roles/nexus/molecule/default/molecule.yml30
-rw-r--r--ansible/roles/nexus/molecule/default/playbook.yml11
-rw-r--r--ansible/roles/nexus/molecule/default/prepare.yml8
-rw-r--r--ansible/roles/nexus/tasks/install.yml1
-rw-r--r--ansible/roles/nexus/vars/main.yml2
7 files changed, 63 insertions, 2 deletions
diff --git a/ansible/roles/nexus/.yamllint b/ansible/roles/nexus/.yamllint
new file mode 100644
index 00000000..ad0be760
--- /dev/null
+++ b/ansible/roles/nexus/.yamllint
@@ -0,0 +1,11 @@
+extends: default
+
+rules:
+ braces:
+ max-spaces-inside: 1
+ level: error
+ brackets:
+ max-spaces-inside: 1
+ level: error
+ line-length: disable
+ truthy: disable
diff --git a/ansible/roles/nexus/defaults/main.yml b/ansible/roles/nexus/defaults/main.yml
index 8f636979..194f88bf 100644
--- a/ansible/roles/nexus/defaults/main.yml
+++ b/ansible/roles/nexus/defaults/main.yml
@@ -6,4 +6,6 @@ populate_nexus: false
# but all images are pre-populated either at buildtime or at install time (populate_nexus).
runtime_images: {}
# Default rule for tarball naming translation
+nexus_url: "{{ nexus_url_scheme | default('https') }}://nexus.{{ hostvars[groups.infrastructure[0]].ansible_nodename }}{{ nexus_port | default('') }}"
nexus3_image_tar: "{{ nexus3_image | regex_replace('(\\/|\\:)', '_') }}.tar"
+nexus3_published_ports: []
diff --git a/ansible/roles/nexus/molecule/default/molecule.yml b/ansible/roles/nexus/molecule/default/molecule.yml
new file mode 100644
index 00000000..63c47724
--- /dev/null
+++ b/ansible/roles/nexus/molecule/default/molecule.yml
@@ -0,0 +1,30 @@
+---
+dependency:
+ name: galaxy
+driver:
+ name: docker
+lint:
+ name: yamllint
+platforms:
+ - name: infrastructure-server
+ image: molecule-${PREBUILD_PLATFORM_DISTRO:-centos}:${PREBUILD_DISTRO_VERSION:-centos7.6}
+ pre_build_image: true
+ privileged: true
+ override_command: false
+ volumes:
+ - /var/lib/docker
+ groups:
+ - infrastructure
+provisioner:
+ name: ansible
+ env:
+ ANSIBLE_ROLES_PATH: ../../../../test/roles
+ inventory:
+ links:
+ group_vars: ../../../../group_vars
+ lint:
+ name: ansible-lint
+verifier:
+ name: testinfra
+ lint:
+ name: flake8
diff --git a/ansible/roles/nexus/molecule/default/playbook.yml b/ansible/roles/nexus/molecule/default/playbook.yml
new file mode 100644
index 00000000..e10ea55b
--- /dev/null
+++ b/ansible/roles/nexus/molecule/default/playbook.yml
@@ -0,0 +1,11 @@
+---
+- name: Converge
+ hosts: all
+ vars:
+ nexus_port: ":8081"
+ nexus3_published_ports:
+ - "{{ '8081' + nexus_port }}"
+ nexus_url_scheme: http
+ populate_nexus: true
+ roles:
+ - nexus
diff --git a/ansible/roles/nexus/molecule/default/prepare.yml b/ansible/roles/nexus/molecule/default/prepare.yml
new file mode 100644
index 00000000..f7290bd5
--- /dev/null
+++ b/ansible/roles/nexus/molecule/default/prepare.yml
@@ -0,0 +1,8 @@
+---
+- name: Prepare
+ hosts: all
+ vars_files:
+ - ../../defaults/main.yml
+ roles:
+ - prepare-docker-dind
+ - prepare-nexus
diff --git a/ansible/roles/nexus/tasks/install.yml b/ansible/roles/nexus/tasks/install.yml
index c88e5855..6ac2b131 100644
--- a/ansible/roles/nexus/tasks/install.yml
+++ b/ansible/roles/nexus/tasks/install.yml
@@ -24,6 +24,7 @@
image: "{{ nexus3_image }}"
networks:
- name: nexus_network
+ published_ports: "{{ nexus3_published_ports }}"
volumes:
- "{{ app_data_path }}/nexus_data:/nexus-data:rw"
state: started
diff --git a/ansible/roles/nexus/vars/main.yml b/ansible/roles/nexus/vars/main.yml
deleted file mode 100644
index 5ec51869..00000000
--- a/ansible/roles/nexus/vars/main.yml
+++ /dev/null
@@ -1,2 +0,0 @@
----
-nexus_url: "https://nexus.{{ hostvars[groups.infrastructure[0]].ansible_nodename }}"