Make role parametric to provision several instanes of IS registry

This commit is contained in:
Antonio Calanducci 2023-10-10 14:35:28 +02:00
parent bf16289e8a
commit f7851fd616
10 changed files with 45 additions and 23 deletions

View File

@ -0,0 +1,5 @@
start_scopes: 'devNext'
complete_start_scope: '/gcube/devNext'
gcore_host: 'node14-d-d4s.d4science.org'

View File

@ -0,0 +1,3 @@
start_scopes: 'devsec'
complete_start_scope: '/gcube/devsec'
gcore_host: 'node3.d.d4science.research-infrastructures.eu'

View File

@ -1,2 +0,0 @@
[docker_swarm_test_cluster]
10.1.28.135

6
inventory/hosts.devnext Normal file
View File

@ -0,0 +1,6 @@
[is_registry_devnext]
10.1.28.135

6
inventory/hosts.devsec Normal file
View File

@ -0,0 +1,6 @@
[is_registry_devsec]
10.1.28.135

12
is-registry.yml Normal file
View File

@ -0,0 +1,12 @@
---
- name: Configurazione IS Registry
#hosts: is_registry_devsec:is_registry_devnext
hosts: all
# tasks:
# - name:
# debug:
# var: start_scopes
roles:
- { role: is-registry }

View File

@ -5,10 +5,10 @@ infrastructure: 'gcube'
complete_start_scope: '/gcube/devNext'
gcore_host: 'node14-d-d4s.d4science.org'
config_dir: 'etc/is-registry-service'
is_registry_compose_dir: '/srv/is-registry_stack'
is_registry_docker_stack_name: 'is-registry-stack'
is_registry_docker_service_server_name: 'is-registry'
is_registry_compose_dir: '/srv/is-registry-stack-{{ start_scopes }}'
is_registry_docker_stack_name: 'is-registry-stack-{{ start_scopes }}'
is_registry_docker_service_server_name: 'is-registry-{{ start_scopes }}'
is_registry_docker_server_image: 'd4science/gcore-is-registry:latest'
is_registry_docker_network: 'is-registry-network'
is_registry_service_port: 8080
#is_registry_service_port: 8080
is_registry_haproxy_public_net: 'haproxy-public'

View File

@ -43,19 +43,19 @@
- name: Create the secret for GHNConfig.xml
community.docker.docker_secret:
name: ghn-config
name: ghn-config-{{ start_scopes }}
data_src: '{{ is_registry_compose_dir }}/GHNConfig.xml'
state: present
- name: Create the secret for jndi-config.xml
community.docker.docker_secret:
name: jndi-config
name: jndi-config-{{ start_scopes }}
data_src: '{{ is_registry_compose_dir }}/jndi-config.xml'
state: present
- name: Create the secret for server-config.wsdd
community.docker.docker_secret:
name: server-config
name: server-config-{{ start_scopes }}
data_src: '{{ is_registry_compose_dir }}/server-config.wsdd'
state: present

View File

@ -6,29 +6,27 @@ networks:
# external: true
secrets:
ghn-config:
ghn-config-{{ start_scopes }}:
external: true
jndi-config:
jndi-config-{{ start_scopes }}:
external: true
server-config:
server-config-{{ start_scopes }}:
external: true
services:
{{ is_registry_docker_service_server_name }}:
image: {{ is_registry_docker_server_image }}
#ports:
# - "{{ is_registry_service_port }}:{{ is_registry_service_port }}"
networks:
- {{ is_registry_docker_network }}
- {{ is_registry_haproxy_public_net }}
secrets:
- source: ghn-config
- source: ghn-config-{{ start_scopes }}
target: /home/gcube/gCore/config/GHNConfig.xml
mode: 0444
- source: jndi-config
- source: jndi-config-{{ start_scopes }}
target: /home/gcube/gCore/etc/is-registry-service/jndi-config.xml
mode: 0444
- source: server-config
- source: server-config-{{ start_scopes }}
target: /home/gcube/gCore/etc/globus_wsrf_core/server-config.wsdd
mode: 0444
deploy:

View File

@ -1,6 +0,0 @@
---
- hosts: docker_swarm_test_cluster
serial: 1
roles:
- { role: is-registry }