Skip to content

Commit 7da27c8

Browse files
committed
first part cleanup and better handling of /etc/hosts files
1 parent 093e70d commit 7da27c8

File tree

17 files changed

+238
-93
lines changed

17 files changed

+238
-93
lines changed

org.eclipse.mylyn.releng/multipass/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ You will get certification warnings and must trust the self signed certificate.
8888
If you want to access the URLs from an other computer in your local environment you must add a line to your /etc/hosts file.
8989
Look into /etc/hosts of your installation host computer and you see the following line
9090
```
91-
192.168.64.3 mylynmstr01 mylyn.local traefik.mylyn.local jenkins.mylyn.local hello.mylyn.local artifactory.mylyn.local gitlab.mylyn.local
91+
192.168.64.3 mylynmstr01 mylyn.local traefik.mylyn.local jenkins.mylyn.local artifactory.mylyn.local gitlab.mylyn.local
9292
```
9393
copy this line and replace the IP adress with the local network IP address assinged to the mylynmstr01 vm
9494
```
95-
192.168.2.120 mylynmstr01 mylyn.local traefik.mylyn.local jenkins.mylyn.local hello.mylyn.local artifactory.mylyn.local gitlab.mylyn.local
95+
192.168.2.120 mylynmstr01 mylyn.local traefik.mylyn.local jenkins.mylyn.local artifactory.mylyn.local gitlab.mylyn.local
9696
```
9797
Now you shold be able to assess the URLs from the other computer

org.eclipse.mylyn.releng/multipass/create_vm.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
- hosts: localhost
55
gather_facts: true
66
pre_tasks:
7+
- file:
8+
path: mylyn_vars
9+
state: absent
710
- file:
811
path: mylyn_vars
912
state: directory
@@ -12,7 +15,7 @@
1215
copy:
1316
force: true
1417
dest: "mylyn_vars/{{ inventory_hostname }}.json"
15-
content: "{{ vars | dict2items | json_query('[?starts_with(key, `inst_`)]') | items2dict }}"
18+
content: "{{ vars | dict2items | json_query('[?starts_with(key, `mylyn_`)]') | items2dict }}"
1619
tasks:
1720
- name: include global mode
1821
ansible.builtin.include_tasks:
@@ -33,7 +36,7 @@
3336
delegate_to: localhost
3437
copy:
3538
dest: "mylyn_vars/{{ inventory_hostname }}.json"
36-
content: "{{ vars | dict2items | json_query('[?starts_with(key, `inst_`)]') | items2dict }}"
39+
content: "{{ vars | dict2items | json_query('[?starts_with(key, `mylyn_`)]') | items2dict }}"
3740
roles:
3841
- role: multipass_create_vm
3942
tags:
@@ -57,29 +60,29 @@
5760
delegate_to: localhost
5861
copy:
5962
dest: "mylyn_vars/{{ inventory_hostname }}.json"
60-
content: "{{ vars | dict2items | json_query('[?starts_with(key, `inst_`)]') | items2dict }}"
63+
content: "{{ vars | dict2items | json_query('[?starts_with(key, `mylyn_`)]') | items2dict }}"
6164
vars:
6265
rootca_name: "{{ hostvars['localhost'].rootca_server_name }}"
6366
roles:
6467
- role: crtrootca
6568
vars:
66-
common_domain_name: "{{ hostvars['localhost'].local_domain }}"
69+
common_domain_name: "{{ hostvars['localhost'].mylyn_service_domain }}"
6770
tags:
6871
- createValidCertificates
6972
- base_software
7073
- role: crtcertificate
7174
vars:
7275
subject_alt:
73-
- "DNS:*.{{ hostvars['localhost'].local_domain }}"
74-
common_domain_name: "{{ hostvars['localhost'].local_domain }}"
76+
- "DNS:*.{{ hostvars['localhost'].mylyn_service_domain }}"
77+
common_domain_name: "{{ hostvars['localhost'].mylyn_service_domain }}"
7578
tags:
7679
- createValidCertificates
7780
- base_software
7881

7982
#
8083
# create Certificates for amm non Admin Nodes
8184
#
82-
- hosts: "{{ hostvars['localhost'].setup_noadmin_vm_list }}"
85+
- hosts: "{{ hostvars['localhost'].mylyn_noadmin_vm_hosts }}"
8386
gather_facts: true
8487
vars:
8588
rootca_name: "{{ hostvars['localhost'].rootca_server_name }}"
@@ -90,7 +93,7 @@
9093
- base_software
9194
vars:
9295
subject_alt: "{{ hostvars[inventory_hostname].default_etc_hosts.split() | map('regex_replace', '^', 'DNS:') | list }}"
93-
common_domain_name: "{{ hostvars['localhost'].local_domain }}"
96+
common_domain_name: "{{ hostvars['localhost'].mylyn_service_domain }}"
9497
- role: dockerhost
9598
tags:
9699
- base_software
@@ -122,7 +125,7 @@
122125
- base_software
123126
delegate_to: "{{ item }}"
124127
with_items:
125-
- "{{ hostvars['localhost'].setup_noadmin_vm_list }}"
128+
- "{{ hostvars['localhost'].mylyn_noadmin_vm_hosts }}"
126129

127130
#
128131
# Copy rootca to local and crete cacerts with our rootca

org.eclipse.mylyn.releng/multipass/global_setup.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
11
- name: set global var
22
ansible.builtin.set_fact:
33
grp_prefix: "{{ prefix | default('mylyn')}}"
4-
local_domain: "{{ local_dom | default('mylyn.local')}}"
5-
remote_domain: "{{ remote_dom | default('public.mydomain.de')}}"
4+
mylyn_service_domain: "{{ local_domain | default('mylyn.local')}}"
65
docker_swarm_recreate: "{{ swarm_recreate | default(false) }}"
76
docker_mode_global: "{{ docker_run_mode | default('container') }}"
8-
network_ip_matcher: "{{ local_network_ip_matcher | default('^192\\.168\\.2\\..*') }}"
7+
network_ip_matcher: "{{ local_network_ip_matcher | default('^192\\.168\\.64\\..*') }}"
98
tags:
109
- global
1110

1211
- name: build list 1
1312
ansible.builtin.set_fact:
1413
setup_lst_tmp:
1514
"{{ groups[grp_prefix + \"_admin\"] + groups[grp_prefix + \"_swarm_master\"] }}"
16-
setup_noadmin_vm_list:
15+
mylyn_noadmin_vm_hosts:
1716
"{{ groups[grp_prefix + \"_swarm_master\"] }}"
1817
tags:
1918
- global
@@ -22,32 +21,32 @@
2221
ansible.builtin.set_fact:
2322
setup_lst_tmp:
2423
"{{ setup_lst_tmp + groups[grp_prefix + \"_swarm_worker\" ] }}"
25-
setup_noadmin_vm_list:
26-
"{{ setup_noadmin_vm_list + groups[grp_prefix + \"_swarm_worker\" ] }}"
24+
mylyn_noadmin_vm_hosts:
25+
"{{ mylyn_noadmin_vm_hosts + groups[grp_prefix + \"_swarm_worker\" ] }}"
2726
tags:
2827
- global
2928
when: (docker_mode_global == 'swarm' or docker_mode_global == 'all')
3029
- name: set list admin server
3130
ansible.builtin.set_fact:
3231
rootca_server_name: "{{ groups[hostvars['localhost'].grp_prefix + \"_admin\"][0] }}"
33-
prim_install_server_name: "{{ groups[hostvars['localhost'].grp_prefix + \"_swarm_master\"][0] }}"
32+
mylyn_service_vm_name: "{{ groups[hostvars['localhost'].grp_prefix + \"_swarm_master\"][0] }}"
3433
tags:
3534
- global
3635
- name: build single
3736
ansible.builtin.set_fact:
3837
setup_lst_tmp:
3938
"{{ groups[grp_prefix + \"_swarm_master\" ] }}"
40-
setup_noadmin_vm_list:
39+
mylyn_noadmin_vm_hosts:
4140
"{{ groups[grp_prefix + \"_swarm_master\" ] }}"
4241
rootca_server_name:
43-
"{{ prim_install_server_name }}"
42+
"{{ mylyn_service_vm_name }}"
4443
tags:
4544
- global
4645
when: (docker_mode_global == 'single')
4746

48-
- name: build setup_lst
47+
- name: build mylyn_vm_hosts
4948
ansible.builtin.set_fact:
50-
setup_lst: "{{ setup_lst | default([]) + [ { 'name': item, 'ip4': hostvars[item].ansible_host, 'disk': hostvars[item].multipass_disk, 'memory': hostvars[item].multipass_memory, 'cpus': hostvars[item].multipass_cpus, 'launch_extra': hostvars[item].additional_launch_parms } ] }}"
49+
mylyn_vm_hosts: "{{ mylyn_vm_hosts | default([]) + [ { 'name': item, 'ip4': hostvars[item].ansible_host, 'disk': hostvars[item].multipass_disk, 'memory': hostvars[item].multipass_memory, 'cpus': hostvars[item].multipass_cpus, 'launch_extra': hostvars[item].additional_launch_parms } ] }}"
5150
with_items:
5251
- "{{ setup_lst_tmp }}"
5352
tags:
@@ -64,9 +63,11 @@
6463
vars:
6564
msg: |
6665
rootca_server_name = {{ rootca_server_name }}
67-
localhostPlatform = {{ localhostPlatform }}
68-
all hosts = {{ setup_lst }}
69-
all non admin vm = {{ setup_noadmin_vm_list }}
66+
localhostPlatform = {{ localhostPlatform }}
67+
all hosts = {{ mylyn_vm_hosts }}
68+
all non admin vm = {{ mylyn_noadmin_vm_hosts }}
69+
service vm = {{ mylyn_service_vm_name }}
70+
service domain = {{ mylyn_service_domain }}
7071
ansible.builtin.debug:
7172
msg: "{{ msg.split('\n') }}"
7273
verbosity: 0

org.eclipse.mylyn.releng/multipass/inventory.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ all:
1515
multipass_disk: 30G
1616
multipass_memory: 10G
1717
multipass_cpus: 4
18-
# only needed when you want to share your instance to other devices in Network or Internet
18+
# only needed when you want to share your instance to other devices in Network or Internet
19+
# en0 is valid for for mac os with apple silicon
1920
additional_launch_parms: '--network=en0'
2021
mylyn_swarm_worker:
2122
hosts:
@@ -38,7 +39,7 @@ all:
3839
ansible_user: ubuntu
3940
ansible_ssh_common_args: "-o StrictHostKeyChecking=no -o ControlMaster=no -o ControlPath=none"
4041
ansible_ssh_private_key_file: first_setup/ubuntu_key
41-
default_etc_hosts: "mylynmstr01 mylyn.local traefik.mylyn.local jenkins.mylyn.local hello.mylyn.local artifactory.mylyn.local gitlab.mylyn.local"
42+
default_etc_hosts: "mylynmstr01 mylyn.local traefik.mylyn.local jenkins.mylyn.local artifactory.mylyn.local gitlab.mylyn.local"
4243
mylynwrk01:
4344
ansible_connection: ssh
4445
ansible_host: "192.168.64.4"

org.eclipse.mylyn.releng/multipass/mylyn_setup.yml

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
#
44
- hosts: localhost
55
gather_facts: true
6+
pre_tasks:
7+
- include_vars:
8+
dir: mylyn_vars
9+
extensions:
10+
- json
611
tasks:
712
- name: include global mode
813
ansible.builtin.include_tasks:
@@ -16,8 +21,13 @@
1621
#
1722
# start all non admin Docker Nodes
1823
#
19-
- hosts: "{{ hostvars['localhost'].setup_noadmin_vm_list }}"
24+
- hosts: "{{ hostvars['localhost'].mylyn_noadmin_vm_hosts }}"
2025
gather_facts: true
26+
pre_tasks:
27+
- include_vars:
28+
dir: mylyn_vars
29+
extensions:
30+
- json
2131
vars:
2232
rootca_name: "{{ hostvars['localhost'].rootca_server_name }}"
2333
tasks:
@@ -29,14 +39,22 @@
2939
- name: debug distribution
3040
debug:
3141
msg: "{{ ansible_facts['distribution'] +'/' + ansible_facts['architecture'] + ' on ' + hostvars['localhost'].localhostPlatform }}"
42+
- name: debug mylyn_service_domain
43+
debug:
44+
msg: "{{ hostvars['localhost'].mylyn_service_domain }}"
3245
#
3346
# 1) install Docker Swarm Leader (if needed)
3447
# 2) stop all Docker Services / Container
3548
#
36-
- hosts: "{{ hostvars['localhost'].prim_install_server_name }}"
49+
- hosts: "{{ hostvars['localhost'].mylyn_service_vm_name }}"
3750
gather_facts: false
51+
pre_tasks:
52+
- include_vars:
53+
dir: mylyn_vars
54+
extensions:
55+
- json
3856
vars:
39-
swarm_master_name: "{{ hostvars['localhost'].prim_install_server_name }}"
57+
swarm_master_name: "{{ hostvars['localhost'].mylyn_service_vm_name }}"
4058
roles:
4159
- role: swarm_delete
4260
when: ((hostvars['localhost'].docker_swarm_recreate | bool == true) or (hostvars['localhost'].docker_mode_global == "container"))
@@ -51,8 +69,13 @@
5169
#
5270
# cleanup all docker instances
5371
#
54-
- hosts: "{{ hostvars['localhost'].setup_noadmin_vm_list }}"
72+
- hosts: "{{ hostvars['localhost'].mylyn_noadmin_vm_hosts }}"
5573
gather_facts: true
74+
pre_tasks:
75+
- include_vars:
76+
dir: mylyn_vars
77+
extensions:
78+
- json
5679
vars:
5780
rootca_name: "{{ hostvars['localhost'].rootca_server_name }}"
5881
roles:
@@ -63,44 +86,41 @@
6386
# Services installieren
6487
# install Docker Services / Container
6588
#
66-
- hosts: "{{ hostvars['localhost'].prim_install_server_name }}"
89+
- hosts: "{{ hostvars['localhost'].mylyn_service_vm_name }}"
6790
gather_facts: false
6891
pre_tasks:
6992
- include_vars:
7093
dir: mylyn_vars
7194
extensions:
7295
- json
7396
vars:
74-
swarm_master_name: "{{ hostvars['localhost'].prim_install_server_name }}"
97+
swarm_master_name: "{{ hostvars['localhost'].mylyn_service_vm_name }}"
7598
docker_mode: "{{ hostvars['localhost'].docker_mode_global }}"
7699
roles:
77100
- role: traeefik
78101
vars:
79-
common_domain_name: "{{ hostvars['localhost'].local_domain }}"
102+
common_domain_name: "{{ hostvars['localhost'].mylyn_service_domain }}"
80103
- role: socket-proxy
81104
- role: mylyn_idx
82105
vars:
83-
common_domain_name: "{{ hostvars['localhost'].local_domain }}"
84-
remote_domain_name: "{{ hostvars['localhost'].remote_domain }}"
106+
common_domain_name: "{{ hostvars['localhost'].mylyn_service_domain }}"
85107
- role: artifactory
86108
tags:
87109
- artifactory
88110
vars:
89-
common_domain_name: "{{ hostvars['localhost'].local_domain }}"
90-
# remote_domain_name: "{{ hostvars['localhost'].remote_domain }}"
111+
common_domain_name: "{{ hostvars['localhost'].mylyn_service_domain }}"
91112
- role: gitlab
92113
tags:
93114
- gitlab
94115
vars:
95-
common_domain_name: "{{ hostvars['localhost'].local_domain }}"
116+
common_domain_name: "{{ hostvars['localhost'].mylyn_service_domain }}"
96117
gitlabImageVersion: "16.11.1"
97-
gitlabHostURL: "gitlab.{{ hostvars['localhost'].local_domain }}"
118+
gitlabHostURL: "gitlab.{{ hostvars['localhost'].mylyn_service_domain }}"
98119
- role: jenkins
99120
tags:
100121
- jenkins
101122
vars:
102-
common_domain_name: "{{ hostvars['localhost'].local_domain }}"
103-
remote_domain_name: "{{ hostvars['localhost'].remote_domain }}"
123+
common_domain_name: "{{ hostvars['localhost'].mylyn_service_domain }}"
104124
jenkins_instances:
105125
# - { servmame: "jenkins-2_303_3", port1: 8081, port2: 50001, data_dir: "jenkins-2.303.3", image_tag: "jenkins/jenkins:2.303.3-lts-jdk11", extra_info: '' }
106126
# - { servmame: "jenkins-1_651_1", port1: 8084, port2: 50004, data_dir: "jenkins-2.303.3", image_tag: "jenkins:1.651.1", extra_info: '"' }
@@ -110,13 +130,12 @@
110130
tags:
111131
- bugzilla
112132
vars:
113-
common_domain_name: "{{ hostvars['localhost'].local_domain }}"
114-
remote_domain_name: "{{ hostvars['localhost'].remote_domain }}"
133+
common_domain_name: "{{ hostvars['localhost'].mylyn_service_domain }}"
115134
bugzilla_instances:
116135
- { git_branch: "release-4.4.13", servmame: "bugzilla-4_4", port1: 8090, port2: 8490, image_tag: "4.4", extra_info: '"default": "true"' }
117136
# - { git_branch: "release-4.4.13", servmame: "bugzilla-4_4-custom-wf", port1: 8091, port2: 8491, image_tag: "4.4-custom_wf", extra_info: '"custom_wf":"true"' }
118137
# - { git_branch: "release-4.4.13", servmame: "bugzilla-4_4-custom-wf-and-status", port1: 8092, port2: 8492, image_tag: "4.4-custom_wf_a_s", extra_info: '"custom_wf_and_status":"true"' }
119138
# - { git_branch: "release-4.4.13", servmame: "bugzilla-4_4-bugaliases", port1: 8093, port2: 8493, image_tag: "4.4-bugaliases", extra_info: '"use_bug_alias":"true"' }
120139
# - { git_branch: "5.2", servmame: "bugzilla-5_2", port1: 8094, port2: 8494, image_tag: "5.2", extra_info: '' }
121-
# - { git_branch: "5.2", servmame: "bugzilla-5_2-rest", port1: 8095, port2: 8495, image_tag: "5.2-rest", extra_info: '"rest_enabled":"true", "default": "true", "testdataVersion": "Version1"' }
122-
# - { git_branch: "5.2", servmame: "bugzilla-5_2-rest-api", port1: 8096, port2: 8496, image_tag: "5.2-rest-api", extra_info: '"rest_enabled": "true", "api_key_enabled": "true", "testdataVersion": "Version1"' }
140+
- { git_branch: "5.2", servmame: "bugzilla-5_2-rest", port1: 8095, port2: 8495, image_tag: "5.2-rest", extra_info: '"rest_enabled":"true", "default": "true", "testdataVersion": "Version1"' }
141+
- { git_branch: "5.2", servmame: "bugzilla-5_2-rest-api", port1: 8096, port2: 8496, image_tag: "5.2-rest-api", extra_info: '"rest_enabled": "true", "api_key_enabled": "true", "testdataVersion": "Version1"' }
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
## @formatter:off
2+
## JFROG ARTIFACTORY SYSTEM CONFIGURATION FILE
3+
## HOW TO USE: comment-out any field and keep the correct yaml indentation by deleting only the leading '#' character.
4+
configVersion: 1
5+
## NOTE: JFROG_HOME is a place holder for the JFrog root directory containing the deployed product, the home directory for all JFrog products.
6+
## Replace JFROG_HOME with the real path! For example, in RPM install, JFROG_HOME=/opt/jfrog
7+
8+
## NOTE: Sensitive information such as passwords and join key are encrypted on first read.
9+
## NOTE: The provided commented key and value is the default.
10+
11+
## SHARED CONFIGURATIONS
12+
## A shared section for keys across all services in this config
13+
shared:
14+
## Java 17 distribution to use
15+
#javaHome: "JFROG_HOME/artifactory/app/third-party/java"
16+
17+
## Extra Java options to pass to the JVM. These values add to or override the defaults.
18+
#extraJavaOpts: "-Xms512m -Xmx2g"
19+
20+
## Security Configuration
21+
security:
22+
## Join key value for joining the cluster (takes precedence over 'joinKeyFile')
23+
# joinKey: "<Your joinKey>"
24+
25+
## Join key file location
26+
# joinKeyFile: "<For example: JFROG_HOME/artifactory/var/etc/security/join.key>"
27+
28+
## Master key file location
29+
## Generated by the product on first startup if not provided
30+
# masterKeyFile: "<For example: JFROG_HOME/artifactory/var/etc/security/master.key>"
31+
32+
## Maximum time to wait for key files (master.key and join.key)
33+
# bootstrapKeysReadTimeoutSecs: 120
34+
#
35+
## Node Settings
36+
node:
37+
## A unique id to identify this node.
38+
## Default auto generated at startup.
39+
# id: "art1"
40+
41+
## Default auto resolved by startup script
42+
# ip:
43+
44+
## Sets this node as primary in HA installation
45+
# primary: true
46+
47+
## Sets this node as part of HA installation
48+
# haEnabled: true
49+
50+
## Database Configuration
51+
database:
52+
## To run Artifactory with any database other than PostgreSQL allowNonPostgresql set to true.
53+
allowNonPostgresql: true
54+
## One of mysql, oracle, mssql, postgresql, mariadb
55+
## Default Embedded derby
56+
57+
## Example for postgresql
58+
# type: postgresql
59+
# driver: org.postgresql.Driver
60+
# url: "jdbc:postgresql://<your db url, for example: localhost:5432>/artifactory"
61+
# username: artifactory
62+
# password: password
63+
access:
64+
65+
## Extra Java options to pass to the JVM. These values add to or override the defaults.
66+
#extraJavaOpts: "-XX:InitialRAMPercentage=20 -XX:MaxRAMPercentage=25"

0 commit comments

Comments
 (0)