Feature: Enable user_data's file generation
This feature allow custom user-data's file generation by the user. It is usefull for example when user needs to set up an advanced ssh configuration (special user, SSH certificate-based authentication) Signed-off-by: vguillard <vincent.guillard@b-com.com> Story: 2010475 Task: 47036 Change-Id: I2831e58d84f1da03485f8315eccdd2e79231e584
This commit is contained in:
parent
f06b8a7580
commit
bf1bb49c38
@ -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