025ec0024b
Currently, Amphora configuration data is being sent as personality files as considered by Nova and some providers have limitations and must use cloud-init user-data. This patch introduces a new config option to enable user-data. If enabled the files that were built, such as the amphora config and certificates for the agent, will be templated into a cloud-init user-data script that loads the files as expected. After this we need to restart the agent as cloud-init happens at a higher level than service scripts. This does increase the boot time. This is configurable so there is no impact if it's not needed. Change-Id: I60fa87722302eee9d3d1fd6ff1b5b5b697a2406e Closes-Bug: #1541231
35 lines
1.2 KiB
Plaintext
35 lines
1.2 KiB
Plaintext
{# Copyright 2016 Rackspace
|
|
#
|
|
# 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.
|
|
-#}
|
|
#cloud-config
|
|
# vim: syntax=yaml
|
|
#
|
|
# This configuration with take user-data dict and build a cloud-init
|
|
# script utilizing the write_files module. The user-data dict should be a
|
|
# Key Value pair where the Key is the path to store the file and the Value
|
|
# is the data to store at that location
|
|
#
|
|
# Example:
|
|
# {'/root/path/to/file.cfg': 'I'm a file, write things in me'}
|
|
write_files:
|
|
{%- for key, value in user_data.items() %}
|
|
- path: {{ key }}
|
|
content: |
|
|
{{ value|indent(8) }}
|
|
{%- endfor -%}
|
|
|
|
{# restart agent now that configurations are in place #}
|
|
runcmd:
|
|
- service amphora-agent restart
|