Add Butane test and Ignition logs
This commit is contained in:
parent
dc637d9a57
commit
00de277d3a
2 changed files with 33 additions and 33 deletions
|
|
@ -856,41 +856,40 @@ fi
|
||||||
##
|
##
|
||||||
##################################################################
|
##################################################################
|
||||||
|
|
||||||
# TODO(runcom): change this to butane to check that too
|
BU_PATH="${HTTPD_PATH}"/butane
|
||||||
|
sudo mkdir -p ${BU_PATH}
|
||||||
|
BU_CONFIG_PATH="${BU_PATH}/bu_config.bu"
|
||||||
|
sudo tee "$BU_CONFIG_PATH" > /dev/null << EOF
|
||||||
|
variant: r4e
|
||||||
|
version: 1.0.0
|
||||||
|
ignition:
|
||||||
|
config:
|
||||||
|
merge:
|
||||||
|
- source: "http://192.168.100.1/ignition/sample.ign"
|
||||||
|
timeouts:
|
||||||
|
http_total: 30
|
||||||
|
passwd:
|
||||||
|
users:
|
||||||
|
- name: core
|
||||||
|
password_hash: "\$6\$GRmb7S0p8vsYmXzH\$o0E020S.9JQGaHkszoog4ha4AQVs3sk8q0DvLjSMxoxHBKnB2FBXGQ/OkwZQfW/76ktHd0NX5nls2LPxPuUdl."
|
||||||
|
ssh_authorized_keys:
|
||||||
|
- "${SSH_KEY_PUB}"
|
||||||
|
groups:
|
||||||
|
- wheel
|
||||||
|
EOF
|
||||||
|
|
||||||
IGN_PATH="${HTTPD_PATH}/ignition"
|
IGN_PATH="${HTTPD_PATH}/ignition"
|
||||||
sudo mkdir -p ${IGN_PATH}
|
sudo mkdir -p ${IGN_PATH}
|
||||||
IGN_CONFIG_PATH="${IGN_PATH}/config.ign"
|
IGN_CONFIG_PATH="${IGN_PATH}/config.ign"
|
||||||
sudo tee "$IGN_CONFIG_PATH" > /dev/null << EOF
|
|
||||||
{
|
# Run butane using standard in and standard out
|
||||||
"ignition": {
|
greenprint "Running butane using butane's configuration file"
|
||||||
"config": {
|
podman run -i --rm quay.io/coreos/butane:release --pretty --strict < "${BU_CONFIG_PATH}" > config.ign
|
||||||
"merge": [
|
sudo cp config.ign "${IGN_CONFIG_PATH}"
|
||||||
{
|
sudo rm -rf ./config.ign
|
||||||
"source": "http://192.168.100.1/ignition/sample.ign"
|
# Output Ignition configuration
|
||||||
}
|
greenprint "Generated Ignition configuration"
|
||||||
]
|
cat "${IGN_CONFIG_PATH}"
|
||||||
},
|
|
||||||
"timeouts": {
|
|
||||||
"httpTotal": 30
|
|
||||||
},
|
|
||||||
"version": "3.3.0"
|
|
||||||
},
|
|
||||||
"passwd": {
|
|
||||||
"users": [
|
|
||||||
{
|
|
||||||
"groups": [
|
|
||||||
"wheel"
|
|
||||||
],
|
|
||||||
"name": "core",
|
|
||||||
"passwordHash": "\$6\$GRmb7S0p8vsYmXzH\$o0E020S.9JQGaHkszoog4ha4AQVs3sk8q0DvLjSMxoxHBKnB2FBXGQ/OkwZQfW/76ktHd0NX5nls2LPxPuUdl.",
|
|
||||||
"sshAuthorizedKeys": [
|
|
||||||
"${SSH_KEY_PUB}"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
|
|
||||||
BASE64_IGN_CONFIG=$(cat "$IGN_CONFIG_PATH" | base64)
|
BASE64_IGN_CONFIG=$(cat "$IGN_CONFIG_PATH" | base64)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -65,7 +65,8 @@
|
||||||
- set_fact:
|
- set_fact:
|
||||||
total_counter: "{{ total_counter | int + 1 }}"
|
total_counter: "{{ total_counter | int + 1 }}"
|
||||||
rescue:
|
rescue:
|
||||||
# TODO: gather Ignition logs
|
- name: Gather Ignition logs
|
||||||
|
shell: journalctl --identifier=ignition --all
|
||||||
- name: failed count + 1
|
- name: failed count + 1
|
||||||
set_fact:
|
set_fact:
|
||||||
failed_counter: "{{ failed_counter | int + 1 }}"
|
failed_counter: "{{ failed_counter | int + 1 }}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue