Last active
September 18, 2019 17:22
-
-
Save strigazi/e014f2d83d75837e921fb31ce8a87628 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
Content-Type: multipart/mixed; boundary="===============1175957420267015713==" | |
MIME-Version: 1.0 | |
--===============1175957420267015713== | |
Content-Type: text/cloud-config; charset="us-ascii" | |
MIME-Version: 1.0 | |
Content-Transfer-Encoding: 7bit | |
Content-Disposition: attachment; filename="cloud-config" | |
# Capture all subprocess output into a logfile | |
# Useful for troubleshooting cloud-init issues | |
output: {all: '| tee -a /var/log/cloud-init-output.log'} | |
--===============1175957420267015713== | |
Content-Type: text/cloud-boothook; charset="us-ascii" | |
MIME-Version: 1.0 | |
Content-Transfer-Encoding: 7bit | |
Content-Disposition: attachment; filename="boothook.sh" | |
#!/bin/bash | |
# FIXME(shadower) this is a workaround for cloud-init 0.6.3 present in Ubuntu | |
# 12.04 LTS: | |
# https://bugs.launchpad.net/heat/+bug/1257410 | |
# | |
# The old cloud-init doesn't create the users directly so the commands to do | |
# this are injected though nova_utils.py. | |
# | |
# Once we drop support for 0.6.3, we can safely remove this. | |
# in case heat-cfntools has been installed from package but no symlinks | |
# are yet in /opt/aws/bin/ | |
cfn-create-aws-symlinks | |
# Do not remove - the cloud boothook should always return success | |
exit 0 | |
--===============1175957420267015713== | |
Content-Type: text/part-handler; charset="us-ascii" | |
MIME-Version: 1.0 | |
Content-Transfer-Encoding: 7bit | |
Content-Disposition: attachment; filename="part-handler.py" | |
# part-handler | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); you may | |
# not use this file except in compliance with the License. You may obtain | |
# a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | |
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | |
# License for the specific language governing permissions and limitations | |
# under the License. | |
import datetime | |
import errno | |
import os | |
import sys | |
def list_types(): | |
return(["text/x-cfninitdata"]) | |
def handle_part(data, ctype, filename, payload): | |
if ctype == "__begin__": | |
try: | |
os.makedirs('/var/lib/heat-cfntools', int("700", 8)) | |
except OSError: | |
ex_type, e, tb = sys.exc_info() | |
if e.errno != errno.EEXIST: | |
raise | |
return | |
if ctype == "__end__": | |
return | |
timestamp = datetime.datetime.now() | |
with open('/var/log/part-handler.log', 'a') as log: | |
log.write('%s filename:%s, ctype:%s\n' % (timestamp, filename, ctype)) | |
if ctype == 'text/x-cfninitdata': | |
with open('/var/lib/heat-cfntools/%s' % filename, 'w') as f: | |
f.write(payload) | |
# TODO(sdake) hopefully temporary until users move to heat-cfntools-1.3 | |
with open('/var/lib/cloud/data/%s' % filename, 'w') as f: | |
f.write(payload) | |
--===============1175957420267015713== | |
Content-Type: text/plain; charset="us-ascii" | |
MIME-Version: 1.0 | |
Content-Transfer-Encoding: 7bit | |
Content-Disposition: attachment; filename | |
{ | |
"ignition": { "version": "3.0.0" }, | |
"systemd": { | |
"units": [ | |
{ | |
"contents": "[Unit]\nDescription=Run heat-container-agent\nAfter=network-online.target\nWants=network-online.target\n\n[Service]\nExecStartPre=mkdir -p /var/lib/heat-container-agent\nExecStartPre=mkdir -p /var/run/heat-config\nExecStartPre=mkdir -p /var/run/os-collect-config\nExecStartPre=mkdir -p /opt/stack/os-config-refresh\nExecStartPre=mkdir -p /srv/magnum\nExecStartPre=-/bin/podman kill heat-container-agent\nExecStartPre=-/bin/podman rm heat-container-agent\nExecStartPre=-/bin/podman pull docker.io/openstackmagnum/heat-container-agent:train-dev\nExecStart=/bin/podman run \\\n --name heat-container-agent \\\n --privileged \\\n --volume /srv/magnum:/srv/magnum \\\n --volume /opt/stack/os-config-refresh:/opt/stack/os-config-refresh \\\n --volume /run/systemd:/run/systemd \\\n --volume /etc/:/etc/ \\\n --volume /var/lib:/var/lib \\\n --volume /var/run:/var/run \\\n --volume /var/log:/var/log \\\n --volume /tmp:/tmp \\\n --volume /dev:/dev \\\n --net=host \\\n docker.io/openstackmagnum/heat-container-agent:train-dev \\\n /usr/bin/start-heat-container-agent\n\nExecStop=/bin/podman stop heat-container-agent\n\n[Install]\nWantedBy=multi-user.target\n", | |
"enabled": true, | |
"name": "heat-container-agent.service" | |
} | |
] | |
}, | |
"storage": { | |
"files": [ | |
{ | |
"filesystem": "root", | |
"path": "/etc/hostname", | |
"mode": 420, | |
"contents": { "source": "data:,strigazi-foo1" } | |
} | |
] | |
}, | |
"passwd": { | |
"users": [ | |
{ | |
"name": "root", | |
"sshAuthorizedKeys": [ | |
"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAlKi4GIqp9BG9buHOziaL0TeW7bHrd+nVkhuW8BNQC5H4VPj2AJXq2d/2UrRRrdLFiQTEKuPFWhwYw3GzTYq8fZTMVjU7buIbqKx5xCa//k7htNIwNRj5ao/6B3sBubQUI+jeDmDil/sRgL9lfC77eqVFr5G7SGmKWBm+3rGYkPu6M1xFmeodpLeuwIhBj2rfiP+cU6nacnpIgp/FjVSilmEW94yuf1g7RwkeYlu6nEas1SHXI0Lf50lEwiY322prlrhzgOTnEo6cpFwZjM4L+ih1enLAhHRc5QsfArP3M2Jn9LEKy5t9BLgIHfEimTTM7eTjHm9t2hSoUTT6Ts/w0Q== [email protected]" | |
] | |
} | |
] | |
} | |
} | |
--===============1175957420267015713== | |
Content-Type: text/x-cfninitdata; charset="us-ascii" | |
MIME-Version: 1.0 | |
Content-Transfer-Encoding: 7bit | |
Content-Disposition: attachment; filename="cfn-init-data" | |
{"os-collect-config": {"cfn": {"stack_name": "strigazi-foo1", "metadata_url": "***", "path": "kube-master.Metadata", "secret_access_key": "***", "access_key_id": "***"}, "collectors": ["ec2", "cfn", "local"]}, "deployments": []} | |
--===============1175957420267015713==-- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment