jriguera.configdrive

ansible-role-configdrive

This repository is not actively maintained. Please use the fork maintained by David Blaisonneau: https://gitlab.com/davidblaisonneau-orange/ansible-role-configdrive


This Ansible role creates config-drives for OpenStack Ironic. It generates data for nodes and can set up complex network configurations like bonding, VLANs, and bridges on Debian and RedHat systems. Remember that the images must support these features (kernel modules, packages, etc.). This tool only creates configuration files that will be used by the host at boot time with Cloud-Init.

This playbook should run before deploying nodes through Ironic. It creates a basic config-drive with network settings, an SSH key for user access, and files like /etc/hosts and /etc/resolv.conf. It can also include a user_data file. More information can be found at https://help.ubuntu.com/community/CloudInit.

Works with Ansible 2.0 on Ubuntu Trusty, Xenial, and CentOS 7.

Requirements

The role doesn’t install packages on the target host; it only creates the necessary folders and files for the config-drive volume. Be sure to install genisoimage, base64, and gzip as needed.

Configuration

Role parameters

# You need to edit these role variables!
# Network configuration will be generated based on this!
configdrive_os_family: "Debian"
configdrive_uuid: "uuid-test-01"
configdrive_fqdn: "test.example.com"
configdrive_name: "test"
configdrive_ssh_public_key:
configdrive_availability_zone: ""
configdrive_network_info: True
configdrive_config_dir: "/var/lib/ironic/images/"
configdrive_volume_path: "/var/lib/ironic/images/"

# Additional metadata
configdrive_meta: {}

# Paths for ssh public key and cloud-config file
configdrive_ssh_public_key_path:
configdrive_config_user_data_path:

# Automatically assigned UUID
# configdrive_instance_dir:
# Delete the instance directory after creation
configdrive_config_dir_delete: False

# Populate /etc/resolv.conf
# configdrive_resolv:
#    domain: "example.com"
#    search: "hola.example.com"
#    dns: ['8.8.8.8']

# Populate /etc/hosts
# configdrive_hosts:
#  - ['127.0.1.1', 'host1.domain.com']
#  - ['127.0.1.2', 'host3.domain.com']

# List of network devices
# configdrive_network_device_list:
#  - device: "eth1"
#    bootproto: "dhcp"
#  - device: "eth2"
#    bootproto: "dhcp"
#    type: "phy"
#  - device: "eth0.500"
#    type: "vlan"
#    address: "10.1.1.10"
#    netmask: "255.255.255.0"
#    gateway: "10.1.1.1"
#    nameservers: 
#      - 8.8.8.8
#      - 9.9.9.9
#    domain: "hola.com"
#    backend: ["eth0"]

Usage

Check the site.yml file and run vagrant up. Then, go to the folder /tmp/configdrive in the Vagrant VM. You’ll find the compressed ISO volume along with the complete folder and file structure it includes.

Author and License Information

Copyright 2019 Jose Riguera Lopez

Licensed under the Apache License, Version 2.0 (the "License"); you cannot use this file except in compliance with the License. You can find the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless specified by law or agreed upon, software under this License is distributed "AS IS", WITHOUT ANY WARRANTIES OR CONDITIONS, either express or implied. See the License for details on permissions and limitations.

Informazioni sul progetto

Creates a configdrive for OpenStack

Installa
ansible-galaxy install jriguera.configdrive
Licenza
apache-2.0
Download
229.7k