https://github.com/openstack/kolla-ansiblenode
https://git.openstack.org/cgit/openstack/kolla-ansible/mysql
執行命令Kolla-ansible –i multinode deploy後,koll會調用ansible-playbook命令,linux
接着執行ansible-playbook -i multinode -e @/etc/kolla/globals.yml -e @/etc/kolla/passwords.yml -e CONFIG_DIR=/etc/kolla -e action=deploy /usr/share/kolla-ansible/ansible/site.ymlgit
而後安裝site.yml裏的任務菜單按順序執行github
模塊:kolla_container_factssql
描述:用於檢查是否有容器正在運行mongodb
選項:
api_version:docker-py的api版本,非必要項,str類型,默認值是auto
name:容器名字,非必要項,str或list類型docker
調用例子:
- hosts: all
tasks:
- name: Gather docker facts
kolla_container_facts:ubuntu
- name: Gather glance container facts
kolla_container_facts:
name:
- glance_api
- glance_registryswift
模塊:kolla_docker
描述:用於控制Docker的容器
選項:
common_options:包含公共參數的字典選項,如登錄信息等,非必要項,dict類型,默認值爲dict()
action:模塊當中可供調用的動做方法,必要項,str類型,可選擇的action有:compare_container,compare_image,create_volume,get_container_env,get_container_state,pull_iamge,remove_volume,remove_container,recreate_or_restart_container,restart_container,start_container,stop_container
api_version:docker-py的api版本,非必要項,str類型, 默認值是auto
auth_email:用於認證的郵箱地址,非必要項,str類型
auth_password:用於認證的密碼,非必要項,str類型
auth_registry:用於認證的registry,非必要項,str類型
auth_username:用於認證的用戶名,非必要項,str類型
detach:在容器建立後進行分離,非必要項,bool類型, 默認值是True
name:要管理的容器或卷的名字,非必要項,str類型
environment:在容器裏設置的環境變量,非必要項,dict類型
image:docker鏡像的名字,非必要項,str類型
ipc_mode:設置docker的ipc命名空間,非必要項,str類型,默認值是None,可選擇的值有:host
cap_add:給容器添加capabilities,非必要項,list類型, 默認值是list()
security_opt:設置容器安全配置文件,非必要項,list類型, 默認值是list()
labels:應用於容器的標籤列表,非必要項,dict類型, 默認值是dict ()
pid_mode:設置docker pid命名空間,非必要項,str類型, 默認值是None ,可選擇的值有:host
privileged:給容器設置特權,非必要項,bool類型, 默認值是False
remove_on_exit:當沒有從容器分離時,在成功退出時刪除,非必要項,bool類型, 默認值是True
restart_policy:肯定當容器退出時docker應作什麼,非必要項,str類型,可選擇的值有:never,on-failure,always,unless-stopped
restart_retries:當restart_policy被設置時,容器重啓的次數,int類型, 默認值是10
volumes:設置要使用的卷,非必要項, list類型
volumes_from:要使用卷的容器的名字或ID,必要項 list類型
調用例子:
- hosts: kolla_docker
tasks:
- name: Start container
kolla_docker:
image: ubuntu
name: test_container
action: start_container
- name: Remove container
kolla_docker:
name: test_container
action: remove_container
- name: Pull image without starting container
kolla_docker:
action: pull_container
image: private-registry.example.com:5000/ubuntu
- name: Create named volume
action: create_volume
name: name_of_volume
- name: Remove named volume
action: remove_volume
name: name_of_volume
模塊:kolla_toolbox
描述:被kolla項目用於在kolla_toolbox容器裏調用ansible模塊
可選項:
module_name:調用的模塊名,必要項,str類型
module_args:傳遞給被調用模塊的參數,非必要項,str或dict類型
module_extra_vars: 傳遞給被調用模塊的額外參數,非必要項,str或dict類型
調用例子:
- hosts: controller
tasks:
- name: Ensure the direct absent
kolla_toolbox:
module_name: file
module_args: path=/tmp/a state=absent
- name: Create mysql database
kolla_toolbox:
module_name: mysql_db
module_args:
login_host: 192.168.1.10
login_user: root
login_password: admin
name: testdb
- name: Creating default user role
kolla_toolbox:
module_name: os_keystone_role
module_args:
name: _member_
auth: "{{ '{{ openstack_keystone_auth }}' }}"
module_extra_vars:
openstack_keystone_auth:
auth_url: http://127.0.0.1:5000
username: admin
password: password
project_name: "admin"
domain_name: "default"
描述:kolla-ansible部署的入口,kolla調用ansible執行playbook的入口文件
描述: kolla-ansible部署openstack時須要進行配置的全局變量。此配置文件能夠對kolla項目所用到的變量進行重載。此文件全部被註釋掉的參數的默認值能夠在kolla-ansible/ansible/group_vars/all.yml找到。
Kolla選項
config_strategy: "COPY_ALWAYS"; 可選項有[ COPY_ONCE, COPY_ALWAYS ]
kolla_base_distro: "centos";可選項有[ centos, oraclelinux, ubuntu ]
kolla_install_type: "source";可選項有[ binary, source ]
openstack_release: "4.0.3";容器鏡像的版本
node_custom_config: "/etc/kolla/config";能夠在此目錄下自定義一些配置文件
kolla_internal_vip_address: "192.168.215.209"; 此VIP必須是個未被使用的IP,它將被用於keepalived進行高可用
kolla_internal_fqdn: "{{ kolla_internal_vip_address }}";這是映射到VIP的DNS名
kolla_external_vip_address: "{{ kolla_internal_vip_address }}";此VIP必須是個未被使用的IP,它將被用於keepalived進行高可用,默認使用kolla_internal_vip_address時,容許內部和外部通訊共享相同的地址
kolla_external_fqdn: "{{ kolla_external_vip_address }}";用於與要在其中建立的端點的public_url中設置的OpenStack進行通訊的公共地址。
Docker選項
docker_registry: "192.168.215.202:4000"; docker鏡像倉庫的地址
docker_namespace: "lokolla";鏡像倉庫的命名空間
docker_registry_username: "sam";鏡像倉庫的帳號
docker_registry_password: "correcthorsebatterystaple";鏡像倉庫的密碼
Neutron選項
network_interface: "eth0";全部的aip服務默認是使用此網卡進行通訊。此網卡必須包含一個IPv4地址
如下這幾個能夠用於特定需求的網卡使用
#kolla_external_vip_interface: "{{ network_interface }}"
#api_interface: "{{ network_interface }}"
#storage_interface: "{{ network_interface }}"
#cluster_interface: "{{ network_interface }}"
#tunnel_interface: "{{ network_interface }}"
#dns_interface: "{{ network_interface }}"
neutron_external_interface: "eth1";這是給neutron做爲其外部網絡端口的原始接口
neutron_plugin_agent: "openvswitch";可選項有[ openvswitch, linuxbridge ]
keepalived選項
keepalived_virtual_router_id: "52";keepalived集羣的惟一ID,取值應該在0到255之間
TLS選項
要在kolla_external_vip_interface上提供加密和身份驗證,能夠啓用TLS。啓用TLS時,必須提供證書以容許客戶端執行身份驗證。
kolla_enable_tls_external: "no"
kolla_external_fqdn_cert: "{{ node_config_directory }}/certificates/haproxy.pem"
OpenStack選項
openstack_logging_debug: "False";可選項有[ True, False ]
nova_console: "novnc";可選項有[ novnc, spice ]
啓動或關掉openstack服務的選項
#enable_aodh: "no"
#enable_barbican: "no"
#enable_ceilometer: "no"
#enable_central_logging: "no"
#enable_ceph: "no"
#enable_ceph_rgw: "no"
#enable_chrony: "no"
enable_cinder: "yes"
#enable_cinder_backend_hnas_iscsi: "no"
#enable_cinder_backend_hnas_nfs: "no"
#enable_cinder_backend_iscsi: "no"
enable_cinder_backend_lvm: "yes"
#enable_cinder_backend_nfs: "no"
。。。。。。。。。。。
Ceph選項
Ceph能夠設置緩存來提升性能。要使用緩存,您必須提供不一樣於OSD的磁盤
ceph_enable_cache: "no"
ceph_cache_mode: "writeback";可選項有[ forward, none, writeback ]
ceph_pool_type: "replicated";可選項有[ erasure, replicated ];使用擦除編碼池的要求是必須設置緩存層
Keystone Identity選項
keystone_token_provider: 'uuid';可選項有[ uuid, fernet ]
fernet_token_expiry: 86400
Glance Image選項
glance_backend_file: "yes"
glance_backend_ceph: "no"
Ceilometer選項
ceilometer_database_type: "mongodb";可選項有[ mongodb, mysql, gnocchi ]
ceilometer_event_type: "mongodb";可選項有[ mongodb, gnocchi, panko ]
Barbican選項
barbican_crypto_plugin: "simple_crypto";可選項有[ simple_crypto, p11_crypto ]
barbican_library_path: "/usr/lib/libCryptoki2_64.so"
Barbican選項
panko_database_type: "mysql";可選項有[ mongodb, mysql ]
Gnocchi選項
gnocchi_backend_storage: "{{ 'ceph' if enable_ceph|bool else 'file' }}";可選項有[ file, ceph ]
Cinder - Block Storage選項
#cinder_backend_ceph: "{{ enable_ceph }}"
cinder_volume_group: "cinder-volumes"
#cinder_backup_driver: "nfs"
#cinder_backup_share: ""
#cinder_backup_mount_options_nfs: ""
Designate選項
designate_backend: "bind9"
designate_ns_record: "sample.openstack.org"
Nova - Compute選項
#nova_backend_ceph: "{{ enable_ceph }}"
Horizon - Dashboard選項
#horizon_backend_database: "{{ enable_murano | bool }}"
Manila - Shared File System選項
# HNAS backend configuration
#hnas_ip:
#hnas_user:
#hnas_password:
#hnas_evs_id:
#hnas_evs_ip:
#hnas_file_system_name:
Swift - Object Storage選項
Swift但願可使用塊設備進行存儲。支持兩種類型的存儲:1-具備特殊分區名稱和文件系統標籤的存儲設備;2-具備文件系統的未分區磁盤。該文件系統的標籤用於檢測Swift將要使用的磁盤。
#swift_devices_match_mode: "strict";可選項有[ prefix, strict ]
#swift_devices_name: "KOLLA_SWIFT_DATA";此參數定義匹配模式:若是選擇了「strict」模式,對於swift_devices_match_mode,swift_device_name應指定特殊swift分區的名稱,例如:「KOLLA_SWIFT_DATA」,若是選擇「前綴」模式,則swift_devices_name應指定匹配的模式 到文件系統的標籤爲快速準備
Tempest選項(openstack集成測試套件)
tempest_image_id:
tempest_flavor_ref_id:
tempest_public_network_id:
tempest_floating_network_name:
# tempest_image_alt_id: "{{ tempest_image_id }}"
# tempest_flavor_ref_alt_id: "{{ tempest_flavor_ref_id }}"