Skip to content

Commit

Permalink
improved readability output of service urls
Browse files Browse the repository at this point in the history
  • Loading branch information
brutesque committed Aug 21, 2021
1 parent 52aae22 commit c8d6356
Showing 1 changed file with 33 additions and 18 deletions.
51 changes: 33 additions & 18 deletions roles/output-service-urls/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,57 @@
---

- name: Traefik
debug:
msg: "https://{{ item }}/"
- name: Create list of services urls
set_fact:
services_urls: []
run_once: true

- name: Add traefik urls
set_fact:
services_urls: "{{ services_urls + [ 'https://' + item + '/' ] }}"
with_items: "{{ ['traefik'] | product(swarm_hostnames) | map('join', '.') }}"
run_once: true
no_log: yes

- name: Registry
debug:
msg: "https://{{ item }}/"
- name: Add registry urls
set_fact:
services_urls: "{{ services_urls + [ 'https://' + item + '/' ] }}"
with_items: "{{ ['registry'] | product(swarm_hostnames) | map('join', '.') }}"
when: enable_registry is defined and enable_registry
run_once: true
no_log: yes

- name: Portainer
debug:
msg: "https://{{ item }}/"
- name: Add portainer urls
set_fact:
services_urls: "{{ services_urls + [ 'https://' + item + '/' ] }}"
with_items: "{{ ['portainer'] | product(swarm_hostnames) | map('join', '.') }}"
when: enable_portainer is defined and enable_portainer
run_once: true
no_log: yes

- name: Swarmpit
debug:
msg: "https://{{ item }}/"
- name: Add swarmpit urls
set_fact:
services_urls: "{{ services_urls + [ 'https://' + item + '/' ] }}"
with_items: "{{ ['swarmpit'] | product(swarm_hostnames) | map('join', '.') }}"
when: enable_swarmpit is defined and enable_swarmpit
run_once: true
no_log: yes

- name: Swarmprom
debug:
msg: "https://{{ item }}/"
- name: Add swarmprom urls
set_fact:
services_urls: "{{ services_urls + [ 'https://' + item + '/' ] }}"
with_items: "{{ ['grafana', 'prometheus', 'unsee', 'alertmanager'] | product(swarm_hostnames) | map('join', '.') }}"
when: enable_swarmprom is defined and enable_swarmprom
run_once: true
no_log: yes

- name: Tests
debug:
msg: "https://{{ item }}/"
- name: Add test urls
set_fact:
services_urls: "{{ services_urls + [ 'https://' + item + '/' ] }}"
with_items: "{{ ['app1', 'app2', 'app3', 'app4'] | product(swarm_hostnames) | map('join', '.') }}"
when: enable_tests is defined and enable_tests
run_once: true
no_log: yes

- debug:
var: services_urls
run_once: true

0 comments on commit c8d6356

Please sign in to comment.