Bug #15074
closedcloud init fails to mark instance as built
Description
When building instance that uses cloud-init the phone home function uses a POST while the foreman routing only supports GET.
the cloud-init cc_phone_home script uses a POST to mark the end of a foreman build,
but when this task is executed by cloud-init the following error shows in the foreman/production.log and the status of the instance in the foreman gui is "pending installation."
foreman/production log:
@2016-05-17T01:34:47 [app] [I] Started POST "/unattended/built?token=136dec6f-d643-4dac-ba29-2037fb3979d0" for 127.0
.0.1 at 2016-05-17 01:34:47 +0000
Log trace: /usr/share/foreman/vendor/ruby/2.0.0/gems/railties-3.2.21/lib/rails/rack/logger.rb:31 method: call_app
2016-05-17T01:34:47 [app] [F]
| ActionController::RoutingError (No route matches [POST] "/unattended/built"):
|
|
@
cloud init log on the new host;test36-pp-use1 [CLOUDINIT] util.py[WARNING]: Failed to post phone home data to https://foremanmaster.testurl.com:443/unattended/built?token= in 10 tries
user_data script:
phone_home:
url: <%= foreman_url('built') %>
tries: 10
Updated by Dominic Cleal over 8 years ago
- Is duplicate of Bug #5754: Cloud-init phone_home raise 500 error because of POST content added
Updated by Dominic Cleal over 8 years ago
- Status changed from New to Duplicate
I think this can be fixed by specifying post: []
as we do in #5754 and our templates: https://github.com/theforeman/community-templates/blob/develop/cloudinit/userdata_cloudinit.erb#L47