Kolla-ansible源码分析

1. 基本认识

1.1. kolla-ansible

kolla-ansible是从kolla项目中分离出来的一个可交付的项目。kolla-ansible负责部署容器化的openstack各个服务和基础设施组件;而kolla项目现在则单独负责镜像的构建,为kolla-ansible部署提供生产级别的openstack各服务镜像。

1.2. ansible和docker

kolla-ansible利用ansible进行openstack服务的配置、编排openstack各个服务容器的部署。
利用容器的隔离性,达到openstack各服务容器的升级、回退,控制升级、回退的影响范围,降低openstack集群运维的复杂度。

2. 源码目录

Directories

  • ansible - Contains Ansible playbooks to deploy OpenStack services and infrastructure components in Docker containers.
  • contrib - Contains demos scenarios for Heat, Magnum and Tacker and a development environment for Vagrant
  • doc - Contains documentation.
  • etc - Contains a reference etc directory structure which requires configuration of a small number of configuration variables to achieve a working All-in-One (AIO) deployment.
  • specs - Contains the Kolla-Ansible communities key arguments about architectural shifts in the code base.
  • tests - Contains functional testing tools.
  • tools - Contains tools for interacting with Kolla-Ansible.

3. ansible

3.1. ansible代码结构

ansible

├── action_plugins

│   ├── merge_configs.py

│   └── merge_yaml.py

├── bifrost.yml

├── certificates.yml

├── destroy.yml

├── group_vars

│   └── all.yml

├── inventory

│   ├── all-in-one

│   └── multinode

├── kolla-host.yml

├── library

│   ├── bslurp.py

│   ├── kolla_container_facts.py

│   ├── kolla_docker.py

│   ├── kolla_toolbox.py

│   ├── merge_configs.py

│   └── merge_yaml.py

├── mariadb_recovery.yml

├── post-deploy.yml

└── roles

    ├── aodh

    ├── barbican

    ├── baremetal

    ├── bifrost

    ├── ceilometer

    ├── ceph

    ├── certificates

    ├── chrony

    ├── cinder

    ├── cloudkitty

    ├── collectd

    ├── common

    ├── congress

    ├── designate

    ├── destroy

    ├── elasticsearch

    ├── etcd

    ├── freezer

    ├── glance

    ├── gnocchi

    ├── grafana

    ├── haproxy

    ├── heat

    ├── horizon

    ├── influxdb

    ├── ironic

    ├── iscsi

    ├── karbor

    ├── keystone

    ├── kibana

    ├── kuryr

    ├── magnum

    ├── manila

    ├── mariadb

    ├── memcached

    ├── mistral

    ├── monasca

    ├── mongodb

    ├── multipathd

    ├── murano

    ├── neutron

    ├── nova

    ├── nova-hyperv

    ├── octavia

    ├── opendaylight

    ├── openvswitch

    ├── ovs-dpdk

    ├── panko

    ├── prechecks

    ├── qdrouterd

    ├── rabbitmq

    ├── rally

    ├── redis

    ├── sahara

    ├── searchlight

    ├── senlin

    ├── skydive

    ├── solum

    ├── stop

    ├── swift

    ├── tacker

    ├── telegraf

    ├── tempest

    ├── trove

    ├── vmtp

    ├── watcher

    └── zun

├── site.yml

└── stop.yml

3.3. action_plugins目录

action_plugins目录下存放的是是kolla-ansible自定义的ansible插件
merge_configs.py,在playboy内通过使用merge_config来合并配置文件模板,生成openstack各服务的配置文件。

3.4. ./group_vars/all.yml文件

all.yml文件作为ansible的变量文件,定义了各类配置信息。比如:配置文件路径、网卡、IP、端口号、各服务的开启等。(部分配置在globa.yml内也做了定义,global.yml具有更高优先级)

all.yml部分内容:

# 配置文件路径

node_config_directory: "/etc/kolla/{ { project }}"

 

###################

# Kolla options  定义vip

###################

kolla_internal_vip_address: "{ { kolla_internal_address }}"

 

####################

# Networking options 网卡、端口等的配置

####################

network_interface: "eth0"

你可能感兴趣的:(OpenStack,kolla-ansible,kolla,ansible,openstack)