diff --git a/magnum/drivers/k8s_fedora_coreos_v1/templates/fcct-config.yaml b/magnum/drivers/k8s_fedora_coreos_v1/templates/fcct-config.yaml new file mode 100644 index 0000000000..cfe145880f --- /dev/null +++ b/magnum/drivers/k8s_fedora_coreos_v1/templates/fcct-config.yaml @@ -0,0 +1,190 @@ +# Fedora CoreOS Configuration +# +# To generate user_data.json you need to use [0]. +# For detailed instructions, please refer to the upstream documentation [1]. +# +# You can use podman or docker to generate the ignition formatted json: +# podman run --rm \ +# -v ./fcct-config.yaml:/config.fcc:z \ +# quay.io/coreos/fcct:release \ +# --pretty --strict --input /config.fcc > ./user_data.json +# +# [0] https://github.com/coreos/fcct +# [1] https://github.com/coreos/fedora-coreos-docs/blob/master/modules/ROOT/pages/producing-ign.adoc +variant: fcos +version: 1.0.0 +passwd: + users: + - name: core + ssh_authorized_keys: + - "__SSH_KEY_VALUE__" +storage: + directories: + - path: /var/lib/cloud/data + # 493 (decimal) == 755 (octal) + mode: 493 + user: + name: root + group: + name: root + - path: /var/lib/heat-cfntools + # 493 (decimal) == 755 (octal) + mode: 493 + user: + name: root + group: + name: root + files: + - path: /etc/hostname + # 420 (decimal) == 644 (octal) + mode: 420 + group: + name: root + user: + name: root + contents: + inline: | + __HOSTNAME__ + - path: /etc/pki/ca-trust/source/anchors/openstack-ca.pem + # 420 (decimal) == 644 (octal) + mode: 420 + user: + name: root + group: + name: root + contents: + inline: | + __OPENSTACK_CA__ + - path: /root/configure-agent-env.sh + # 448 (decimal) == 700 (octal) + mode: 448 + user: + name: root + group: + name: root + contents: + inline: | + #!/bin/bash + + set -x + set -e + set +u + + until [ -f /etc/pki/ca-trust/source/anchors/openstack-ca.pem ] + do + echo "waiting for /etc/pki/ca-trust/source/anchors/openstack-ca.pem" + sleep 3s + done + + /usr/bin/update-ca-trust + + HTTP_PROXY="__HTTP_PROXY__" + HTTPS_PROXY="__HTTPS_PROXY__" + NO_PROXY="__NO_PROXY__" + + if [ -n "${HTTP_PROXY}" ]; then + export HTTP_PROXY + echo "http_proxy=${HTTP_PROXY}" >> /etc/environment + fi + + if [ -n "${HTTPS_PROXY}" ]; then + export HTTPS_PROXY + echo "https_proxy=${HTTPS_PROXY}" >> /etc/environment + fi + + if [ -n "${NO_PROXY}" ]; then + export NO_PROXY + echo "no_proxy=${NO_PROXY}" >> /etc/environment + fi + + # Create a keypair for the heat-container-agent to + # access the node over ssh. It is useful to operate + # in host mount namespace and apply configuration. + id + mkdir -p /srv/magnum/.ssh + chmod 0700 /srv/magnum/.ssh + #touch /srv/magnum/.ssh/heat_agent_rsa + ssh-keygen -q -t rsa -N '' -f /tmp/heat_agent_rsa + mv /tmp/heat_agent_rsa /srv/magnum/.ssh/heat_agent_rsa + mv /tmp/heat_agent_rsa.pub /srv/magnum/.ssh/heat_agent_rsa.pub + chmod 0400 /srv/magnum/.ssh/heat_agent_rsa + chmod 0400 /srv/magnum/.ssh/heat_agent_rsa.pub + # Add the public to the host authorized_keys file. + mkdir -p /root/.ssh + chmod 0700 /root/.ssh + cat /srv/magnum/.ssh/heat_agent_rsa.pub > /root/.ssh/authorized_keys + # Add localost to know_hosts + ssh-keyscan 127.0.0.1 > /srv/magnum/.ssh/known_hosts + # ssh configguration file, to be specified with ssh -F + cat > /srv/magnum/.ssh/config <