forked from openshift/ironic-image
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Merge pull request openshift#407 from openshift/revert-405-re…
- Loading branch information
Showing
20 changed files
with
191 additions
and
180 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
# http TRACE can be subjected to abuse and should be disabled | ||
TraceEnable off | ||
|
||
# provide minimal server information | ||
ServerTokens Prod | ||
ServerSignature Off | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{% set service %} | ||
[Unit] | ||
Description=Ironic Agent | ||
After=network-online.target | ||
Wants=network-online.target | ||
|
||
[Service] | ||
TimeoutStartSec=0 | ||
ExecStartPre=/bin/podman pull {{ env.IRONIC_AGENT_IMAGE }} {{ env.IRONIC_AGENT_PODMAN_FLAGS }} {% if env.IRONIC_AGENT_PULL_SECRET %}--authfile=/etc/authfile.json{% endif %} | ||
ExecStart=/bin/podman run --privileged --network host --mount type=bind,src=/etc/ironic-python-agent.conf,dst=/etc/ironic-python-agent/ignition.conf --mount type=bind,src=/dev,dst=/dev --mount type=bind,src=/sys,dst=/sys --mount type=bind,src=/,dst=/mnt/coreos --name ironic-agent {{ env.IRONIC_AGENT_IMAGE }} | ||
|
||
[Install] | ||
WantedBy=multi-user.target | ||
{% endset -%} | ||
|
||
{% set ipa_config %} | ||
[DEFAULT] | ||
api_url = {{ env.IRONIC_BASE_URL }}:{{ env.IRONIC_ACCESS_PORT }} | ||
inspection_callback_url = {{ env.IRONIC_BASE_URL }}:{{ env.IRONIC_INSPECTOR_ACCESS_PORT }}/v1/continue | ||
|
||
collect_lldp = True | ||
enable_vlan_interfaces = {{ env.IRONIC_INSPECTOR_VLAN_INTERFACES }} | ||
inspection_collectors = default,extra-hardware,logs | ||
inspection_dhcp_all_interfaces = True | ||
{% endset -%} | ||
|
||
|
||
{ | ||
"ignition": { | ||
"version": "3.0.0" | ||
}, | ||
{% if env.IRONIC_RAMDISK_SSH_KEY %} | ||
"passwd": { | ||
"users": [ | ||
{ | ||
"name": "core", | ||
"sshAuthorizedKeys": [ | ||
"{{ env.IRONIC_RAMDISK_SSH_KEY | trim }}" | ||
] | ||
} | ||
] | ||
}, | ||
{% endif -%} | ||
"storage": { | ||
"files": [ | ||
{ | ||
"path": "/etc/ironic-python-agent.conf", | ||
"contents": {"source": "data:,{{ ipa_config | urlencode }}"} | ||
}{% if env.IRONIC_AGENT_PULL_SECRET %}, | ||
{ | ||
"path": "/etc/authfile.json", | ||
"contents": {"source": "data:;base64,{{ env.IRONIC_AGENT_PULL_SECRET | trim }}"} | ||
} | ||
{% endif %} | ||
] | ||
}, | ||
"systemd": { | ||
"units": [ | ||
{ | ||
"contents": "{{ service | trim | replace('\n', '\\n') }}", | ||
"enabled": true, | ||
"name": "ironic-agent.service" | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/bash | ||
|
||
# shellcheck disable=SC1091 | ||
. /bin/ironic-common.sh | ||
. /bin/coreos-ipa-common.sh | ||
|
||
# Base64 encoded pull secret | ||
export IRONIC_AGENT_PULL_SECRET=${IRONIC_AGENT_PULL_SECRET:-} | ||
|
||
set -x | ||
|
||
export IRONIC_INSPECTOR_VLAN_INTERFACES=${IRONIC_INSPECTOR_VLAN_INTERFACES:-all} | ||
export IRONIC_AGENT_IMAGE | ||
export IRONIC_AGENT_PODMAN_FLAGS=${IRONIC_AGENT_PODMAN_FLAGS:---tls-verify=false} | ||
|
||
IRONIC_CERT_FILE=/certs/ironic/tls.crt | ||
|
||
wait_for_interface_or_ip | ||
|
||
if [[ -f "$IRONIC_CERT_FILE" ]]; then | ||
export IRONIC_BASE_URL="https://${IRONIC_URL_HOST}" | ||
else | ||
export IRONIC_BASE_URL="http://${IRONIC_URL_HOST}" | ||
fi | ||
|
||
render_j2_config /tmp/ironic-python-agent.ign.j2 "$IGNITION_FILE" | ||
# Print the generated ignition for debugging purposes. | ||
sed '/authfile/,+1 s/data:.*"/<redacted>"/' "$IGNITION_FILE" | ||
|
||
if [[ -f "$ISO_FILE" ]]; then | ||
coreos-installer iso ignition embed -i "$IGNITION_FILE" -f "$ISO_FILE" | ||
fi |
Oops, something went wrong.