forked from openshift-eng/two-node-toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.yml
More file actions
58 lines (52 loc) · 1.8 KB
/
config.yml
File metadata and controls
58 lines (52 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
- name: Read config file to check for CI registry usage
set_fact:
config_content: "{{ lookup('file', config_file[method]) }}"
delegate_to: localhost
become: false
- name: Parse pull secret JSON
block:
- name: Read pull secret to check for CI registry auth
set_fact:
pull_secret_content: "{{ lookup('file', 'pull-secret.json') | from_json }}"
delegate_to: localhost
become: false
rescue:
- name: Fail with pull secret parse error
fail:
msg: >-
Failed to parse pull-secret.json. Ensure the file contains valid JSON.
You can validate it with: python3 -m json.tool pull-secret.json
- name: Warn if using CI registry images without CI auth in pull secret
fail:
msg: >-
Your config uses a CI registry image (registry.ci.openshift.org) but your
pull secret does not include credentials for registry.ci.openshift.org.
Either add CI registry credentials to your pull secret or switch to a
public release image (e.g. quay.io/openshift-release-dev/ocp-release).
See the setup guide for instructions on obtaining CI registry credentials.
when:
- "'registry.ci.openshift.org' in config_content"
- "'registry.ci.openshift.org' not in (pull_secret_content.auths | default({}) | list)"
- name: Copy pull secrets
copy:
dest: "{{dev_scripts_path}}/pull_secret.json"
src: pull-secret.json
- name: Get username
command: whoami
changed_when: false
become: false
register: whoami
- name: Configure dev-scripts
copy:
dest: "{{dev_scripts_path}}/config_{{whoami.stdout}}.sh"
src: "{{config_file[method]}}"
register: dev_scripts_config
- name: Install dependencies
ansible.builtin.dnf:
name:
- podman
- runc
- containernetworking-plugins
state: present
become: true