Merge "Feature: Enable user_data's file generation"
This commit is contained in:
commit
be55c28d60
@ -32,3 +32,12 @@ iso_gen_utility: "mkisofs"
|
||||
# Ensure that Ansible is using python interpreter and dependencies inside the bifrost virtual environment
|
||||
bifrost_venv_dir: "{{ lookup('env', 'VENV') or '/opt/stack/bifrost' }}"
|
||||
ansible_python_interpreter: "{{ bifrost_venv_dir + '/bin/python3' }}"
|
||||
|
||||
# Define your user-data's script here (cloud-config syntax)
|
||||
# For example:
|
||||
# user_data_content: |
|
||||
# users:
|
||||
# name: myuser
|
||||
#
|
||||
# timezone: "Europe/Paris"
|
||||
+user_data_content:
|
||||
|
@ -83,6 +83,16 @@
|
||||
when:
|
||||
- addressing_mode is undefined or "dhcp" not in addressing_mode
|
||||
|
||||
- name: "Generate user_data"
|
||||
template:
|
||||
src: raw_user_data.j2
|
||||
dest: "{{ variable_configdrive_location.path }}/{{ uuid }}/openstack/{{ item }}/user_data"
|
||||
loop: "{{ metadata_versions }}"
|
||||
when:
|
||||
- user_data_content is defined
|
||||
- user_data_content | length > 0
|
||||
|
||||
|
||||
- name: "Make metadata folder - /openstack/content"
|
||||
file:
|
||||
state: directory
|
||||
|
@ -0,0 +1,3 @@
|
||||
#cloud-config
|
||||
|
||||
{{ user_data_content }}
|
17
releasenotes/notes/create-cloud-config-e4e15a422bc04adf.yaml
Normal file
17
releasenotes/notes/create-cloud-config-e4e15a422bc04adf.yaml
Normal file
@ -0,0 +1,17 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
bifrost introduce now the ``user_data content`` variable
|
||||
which allows to the user to provide its custom cloud-config file
|
||||
For example:
|
||||
.. code-block:: yaml
|
||||
|
||||
user_data_content: |
|
||||
users:
|
||||
name: myuser
|
||||
sudo: ALL=(ALL) NOPASSWD:ALL
|
||||
shell: /bin/bash
|
||||
passwd: <HASH_OF_MY_PASSWORD>
|
||||
lock_passwd: false
|
||||
|
||||
timezone: "Europe/Paris"
|
Loading…
x
Reference in New Issue
Block a user