#include to grab local file via file:///path/file

Asked by tmblue

Not even sure if this is still monitored, nothing local but I've been banging my head.

I figured based on looking at some source, that #include does various curl commands to grab the url

#include
http://blah..

I'm been attempting this

#include
file:///tmp/config <--- is a #cloud-config file

but am getting errors like so

/var/lib/cloud/instance/scripts/part-001: line 11: file:///tmp/config: No such file or directory
2016-05-15 06:06:40,324 - util.py[WARNING]: Failed running /var/lib/cloud/instance/scripts/part-001 [127]
2016-05-15 06:06:40,325 - cc_scripts_user.py[WARNING]: Failed to run module scripts-user (scripts in /var/lib/cloud/instance/scripts)
2016-05-15 06:06:40,325 - util.py[WARNING]: Running scripts-user (<module 'cloudinit.config.cc_scripts_user' from '/usr/lib/python2.7/site-packages/cloudinit/config/cc_scripts_user.pyc'>) failed
Cloud-init v. 0.7.5 finished at Sun, 15 May 2016 06:06:40 +0000. Datasource DataSourceEc2. Up 547.18 seconds

I can absolutely run curl file:///tmp/config from the command line and it gives me my file as expected. But with cloud-init 0.7.5 it actually crashes the process and the instance will not come up (it does not allow for the process to complete ). This partially is explained in "https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/634102", and seems to have been fixed in 0.7.7 however it appears no one but Ubuntu has gotten that far (CentOS is still 0.7.5)

My multipart file looks like so:

Content-Type: multipart/mixed; boundary="===============0432566452=="
MIME-Version: 1.0

--===============0432566452==
Content-Type: text/x-shellscript; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="boot.txt"

#!/bin/sh

# Grab the curl_s3 file in order to grab the protected cloud config
curl -O "http://bucket.s3-us-west-1.amazonaws.com/Public/curl_s3"

# run the referenced curl_s3 to grab our prod-cloud configuration from a private bucket
sh curl_s3 "IAM ROLE" "bucketProd/cloud-minimal" "/tmp/config"

--===============0432566452==
Content-Type: text/x-include-url; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="include.txt"

file:///tmp/config

--===============0432566452==--

Question information

Language:
English Edit question
Status:
Expired
For:
Ubuntu cloud-init Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Launchpad Janitor (janitor) said :
#1

This question was expired because it remained in the 'Open' state without activity for the last 15 days.