Skip to content

Commit c9acfa0

Browse files
Merge pull request #193 from RS-PYTHON/fix/missing-dependencies-bastion
fix: add yq dependencies on bastion + regex for registry replacement
2 parents 42854c0 + fcba2c6 commit c9acfa0

File tree

2 files changed

+42
-4
lines changed

2 files changed

+42
-4
lines changed

roles/app-installer/tasks/install_app.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,12 +102,12 @@
102102
s|image: (docker.io\/)?([a-z0-9\-]+\/[a-z0-9\-]+)(:[^@ ]+)?(@sha256:[a-f0-9]{64})?|image: {{ registry.harbor_url | regex_replace('^https?://', '') }}/proxycache/\2\3\4|
103103
b
104104
}
105-
/image: ([a-z0-9\-]+\/[a-z0-9\-]+)(:[^@ ]+)?(@sha256:[a-f0-9]{64})?/ {
106-
s|image: ([a-z0-9\-]+\/[a-z0-9\-]+)(:[^@ ]+)?(@sha256:[a-f0-9]{64})?|image: {{ registry.harbor_url | regex_replace('^https?://', '') }}/proxycache/\1\2\3|
105+
/^image: [a-z0-9\-]+\/[a-z0-9\-]+(:[^@ ]+)?(@sha256:[a-f0-9]{64})?$/ {
106+
s|^image: ([a-z0-9\-]+\/[a-z0-9\-]+)(:[^@ ]+)?(@sha256:[a-f0-9]{64})?|image: {{ registry.harbor_url | regex_replace('^https?://', '') }}/proxycache/\1\2\3|
107107
b
108108
}
109-
/image: ([a-z0-9\-]+)(:[^@ ]+)?(@sha256:[a-f0-9]{64})?/ {
110-
s|image: ([a-z0-9\-]+)(:[^@ ]+)?(@sha256:[a-f0-9]{64})?|image: {{ registry.harbor_url | regex_replace('^https?://', '') }}/proxycache/\1\2\3|
109+
/^image: [a-z0-9\-]+(:[^@ ]+)?(@sha256:[a-f0-9]{64})?$/ {
110+
s|^image: ([a-z0-9\-]+)(:[^@ ]+)?(@sha256:[a-f0-9]{64})?|image: {{ registry.harbor_url | regex_replace('^https?://', '') }}/proxycache/\1\2\3|
111111
}
112112
}' \
113113
| yq eval 'select(.kind == "Pod") |= .spec.imagePullSecrets += [{"name": "harbor-pull-secret"}] |

roles/terraform/cluster/tasks/main.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,45 @@
297297
state: link
298298
become: true
299299
delegate_to: "{{ bastion_ip.stdout }}"
300+
301+
- name: Create yq directory
302+
ansible.builtin.file:
303+
path: /opt/yq
304+
state: directory
305+
become: true
306+
delegate_to: "{{ bastion_ip.stdout }}"
307+
308+
- name: Download yq from makefarah github
309+
ansible.builtin.uri:
310+
url: https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
311+
dest: /opt/yq/yq
312+
follow_redirects: safe
313+
become: true
314+
delegate_to: "{{ bastion_ip.stdout }}"
300315

316+
- name: Change yq file permission
317+
ansible.builtin.file:
318+
path: /opt/yq/yq
319+
mode: '0700'
320+
become: true
321+
delegate_to: "{{ bastion_ip.stdout }}"
322+
323+
- name: Create a symlink to yq
324+
ansible.builtin.file:
325+
src: "/opt/yq/yq"
326+
dest: "/usr/local/bin/yq"
327+
state: link
328+
become: true
329+
delegate_to: "{{ bastion_ip.stdout }}"
330+
331+
- name: Create a symlink to yq
332+
ansible.builtin.file:
333+
src: "/opt/yq/yq"
334+
dest: "/usr/bin/yq"
335+
state: link
336+
become: true
337+
delegate_to: "{{ bastion_ip.stdout }}"
338+
301339
- name: Clean install scripts
302340
ansible.builtin.file:
303341
path: "{{ item }}"

0 commit comments

Comments
 (0)