A set of Ansible roles and playbooks to set up and run either the Metal³ dev-env or the OpenShift Metal³ dev-scripts on a fresh host. Note: you should probably only run this against a user account you don't care about.
Edit the file /etc/ansible/hosts
to contain the following sections:
[metal3_test]
<Hostname or IP address of test box>
[metal3_test:vars]
ansible_become_password=<sudo password>
After providing the required authentication data, run the following command to set up the host and run dev-scripts:
ansible-playbook setup-openshift.yml
Once the cluster is up, to tear it down and recreate it with updated config
(from the file roles/openshift-dev/files/config.sh
), run the following
command:
ansible-playbook bounce-openshift.yml
To change the installation method, pass e.g. -e method=agent
. The available
methods are agent
and ipi
. The default is ipi
.
For the agent
method, the config file used is
roles/openshift-dev/files/config.sh
.
To run the OpenShift dev-scripts, two additional files are needed:
roles/openshift-dev/files/ci_token
- should contain a token obtained from the CI console.roles/openshift-dev/files/pull-secrets.json
- should contain the required pull secrets in JSON format. This file can look something like:
{
"auths": {
"cloud.openshift.com": {
"auth": "...",
"email": "<your_email>"
},
"quay.io": {
"auth": "...",
"email": "<your_email>"
},
"registry.connect.redhat.com": {
"auth": "...",
"email": "<your_email>"
},
"registry.redhat.io": {
"auth": "...",
"email": "<your_email>"
}
}
}
The playbooks can be configured to use a release image from the cluster-bot
Slack bot (which can contain patches from multiple unmerged PRs). This
requires a token from the cluster-bot CI
console in the file
roles/openshift-dev/files/clusterbot-ci_token
.
To use the cluster-bot build in the namespace
https://console.build01.ci.openshift.org/k8s/cluster/projects/ci-ln-<build-id>
,
pass the argument -e clusterbot_build_id=<build-id>
to ansible-playbook
.
The following commands/aliases are installed automatically:
oc
: aliased to always use the correct kubeconfig filebmo
: get the name of the current metal3 Podbmo-log
: display the BMO logbmo-log-tail
: follow the BMO log live
Run the following command to set up the host and run metal3-dev-env:
ansible-playbook setup-metal3-dev.yml