Merge "Add solum ansible role"
This commit is contained in:
commit
89dcde15ff
@ -178,6 +178,10 @@ ironic_api_port: "6385"
|
|||||||
|
|
||||||
magnum_api_port: "9511"
|
magnum_api_port: "9511"
|
||||||
|
|
||||||
|
solum_application_deployment_port: "9777"
|
||||||
|
|
||||||
|
solum_image_builder_port: "9778"
|
||||||
|
|
||||||
rgw_port: "6780"
|
rgw_port: "6780"
|
||||||
|
|
||||||
mistral_api_port: "8989"
|
mistral_api_port: "8989"
|
||||||
@ -285,6 +289,7 @@ enable_rally: "no"
|
|||||||
enable_sahara: "no"
|
enable_sahara: "no"
|
||||||
enable_searchlight: "no"
|
enable_searchlight: "no"
|
||||||
enable_senlin: "no"
|
enable_senlin: "no"
|
||||||
|
enable_solum: "no"
|
||||||
enable_swift: "no"
|
enable_swift: "no"
|
||||||
enable_telegraf: "no"
|
enable_telegraf: "no"
|
||||||
enable_tempest: "no"
|
enable_tempest: "no"
|
||||||
|
@ -105,6 +105,9 @@ control
|
|||||||
[sahara:children]
|
[sahara:children]
|
||||||
control
|
control
|
||||||
|
|
||||||
|
[solum:children]
|
||||||
|
control
|
||||||
|
|
||||||
[mistral:children]
|
[mistral:children]
|
||||||
control
|
control
|
||||||
|
|
||||||
@ -322,6 +325,19 @@ magnum
|
|||||||
[magnum-conductor:children]
|
[magnum-conductor:children]
|
||||||
magnum
|
magnum
|
||||||
|
|
||||||
|
# Solum
|
||||||
|
[solum-api:children]
|
||||||
|
solum
|
||||||
|
|
||||||
|
[solum-worker:children]
|
||||||
|
solum
|
||||||
|
|
||||||
|
[solum-deployer:children]
|
||||||
|
solum
|
||||||
|
|
||||||
|
[solum-conductor:children]
|
||||||
|
solum
|
||||||
|
|
||||||
# Mistral
|
# Mistral
|
||||||
[mistral-api:children]
|
[mistral-api:children]
|
||||||
mistral
|
mistral
|
||||||
|
@ -108,6 +108,9 @@ control
|
|||||||
[murano:children]
|
[murano:children]
|
||||||
control
|
control
|
||||||
|
|
||||||
|
[solum:children]
|
||||||
|
control
|
||||||
|
|
||||||
[ironic:children]
|
[ironic:children]
|
||||||
control
|
control
|
||||||
|
|
||||||
@ -334,6 +337,19 @@ sahara
|
|||||||
[sahara-engine:children]
|
[sahara-engine:children]
|
||||||
sahara
|
sahara
|
||||||
|
|
||||||
|
# Solum
|
||||||
|
[solum-api:children]
|
||||||
|
solum
|
||||||
|
|
||||||
|
[solum-worker:children]
|
||||||
|
solum
|
||||||
|
|
||||||
|
[solum-deployer:children]
|
||||||
|
solum
|
||||||
|
|
||||||
|
[solum-conductor:children]
|
||||||
|
solum
|
||||||
|
|
||||||
# Mistral
|
# Mistral
|
||||||
[mistral-api:children]
|
[mistral-api:children]
|
||||||
mistral
|
mistral
|
||||||
|
@ -98,5 +98,6 @@
|
|||||||
- { name: "sahara", enabled: "{{ enable_sahara }}" }
|
- { name: "sahara", enabled: "{{ enable_sahara }}" }
|
||||||
- { name: "searchlight", enabled: "{{ enable_searchlight }}" }
|
- { name: "searchlight", enabled: "{{ enable_searchlight }}" }
|
||||||
- { name: "senlin", enabled: "{{ enable_senlin }}" }
|
- { name: "senlin", enabled: "{{ enable_senlin }}" }
|
||||||
|
- { name: "solum", enabled: "{{ enable_solum }}" }
|
||||||
- { name: "swift", enabled: "{{ enable_swift }}" }
|
- { name: "swift", enabled: "{{ enable_swift }}" }
|
||||||
- { name: "watcher", enabled: "{{ enable_watcher }}" }
|
- { name: "watcher", enabled: "{{ enable_watcher }}" }
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
"/var/log/kolla/solum/*.log"
|
||||||
|
{
|
||||||
|
}
|
@ -26,6 +26,7 @@
|
|||||||
( 'sahara', enable_sahara ),
|
( 'sahara', enable_sahara ),
|
||||||
( 'searchlight', enable_searchlight ),
|
( 'searchlight', enable_searchlight ),
|
||||||
( 'senlin', enable_senlin ),
|
( 'senlin', enable_senlin ),
|
||||||
|
( 'solum', enable_solum ),
|
||||||
( 'swift', enable_swift )
|
( 'swift', enable_swift )
|
||||||
] %}
|
] %}
|
||||||
{
|
{
|
||||||
|
@ -341,6 +341,34 @@ listen senlin_api_external
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if enable_solum | bool %}
|
||||||
|
listen solum_application_deployment
|
||||||
|
bind {{ kolla_internal_vip_address }}:{{ solum_application_deployment_port }}
|
||||||
|
{% for host in groups['solum-application-deployment'] %}
|
||||||
|
server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ solum_application_deployment_port }} check inter 2000 rise 2 fall 5
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
listen solum_image_builder
|
||||||
|
bind {{ kolla_internal_vip_address }}:{{ solum_image_builder_port }}
|
||||||
|
{% for host in groups['solum-image-builder'] %}
|
||||||
|
server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ solum_image_builder_port }} check inter 2000 rise 2 fall 5
|
||||||
|
{% endfor %}
|
||||||
|
{% if haproxy_enable_external_vip | bool %}
|
||||||
|
|
||||||
|
listen solum_application_deployment_external
|
||||||
|
bind {{ kolla_external_vip_address }}:{{ solum_application_deployment_port }} {{ tls_bind_info }}
|
||||||
|
{% for host in groups['solum-application-deployment'] %}
|
||||||
|
server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ solum_application_deployment_port }} check inter 2000 rise 2 fall 5
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
listen solum_image_builder_external
|
||||||
|
bind {{ kolla_external_vip_address }}:{{ solum_image_builder_port }} {{ tls_bind_info }}
|
||||||
|
{% for host in groups['solum-image-builder'] %}
|
||||||
|
server {{ hostvars[host]['ansible_hostname'] }} {{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ solum_image_builder_port }} check inter 2000 rise 2 fall 5
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if enable_swift | bool %}
|
{% if enable_swift | bool %}
|
||||||
listen swift_api
|
listen swift_api
|
||||||
bind {{ kolla_internal_vip_address }}:{{ swift_proxy_server_port }}
|
bind {{ kolla_internal_vip_address }}:{{ swift_proxy_server_port }}
|
||||||
|
@ -720,6 +720,46 @@
|
|||||||
- inventory_hostname in groups['swift-object-server']
|
- inventory_hostname in groups['swift-object-server']
|
||||||
- enable_swift | bool
|
- enable_swift | bool
|
||||||
|
|
||||||
|
- name: Checking free port for Solum Application Deployment
|
||||||
|
wait_for:
|
||||||
|
host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
|
||||||
|
port: "{{ solum_application_deployment_port }}"
|
||||||
|
connect_timeout: 1
|
||||||
|
state: stopped
|
||||||
|
when:
|
||||||
|
- inventory_hostname in groups['solum-api']
|
||||||
|
- enable_solum | bool
|
||||||
|
|
||||||
|
- name: Checking free port for Solum Image Builder
|
||||||
|
wait_for:
|
||||||
|
host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
|
||||||
|
port: "{{ solum_image_builder_port }}"
|
||||||
|
connect_timeout: 1
|
||||||
|
state: stopped
|
||||||
|
when:
|
||||||
|
- inventory_hostname in groups['solum-api']
|
||||||
|
- enable_solum | bool
|
||||||
|
|
||||||
|
- name: Checking free port for Solum Application Deployment HAProxy
|
||||||
|
wait_for:
|
||||||
|
host: "{{ kolla_internal_vip_address }}"
|
||||||
|
port: "{{ solum_application_deployment_port }}"
|
||||||
|
connect_timeout: 1
|
||||||
|
state: stopped
|
||||||
|
when:
|
||||||
|
- inventory_hostname in groups['haproxy']
|
||||||
|
- enable_solum | bool
|
||||||
|
|
||||||
|
- name: Checking free port for Solum Image Builder HAProxy
|
||||||
|
wait_for:
|
||||||
|
host: "{{ kolla_internal_vip_address }}"
|
||||||
|
port: "{{ solum_image_builder_port }}"
|
||||||
|
connect_timeout: 1
|
||||||
|
state: stopped
|
||||||
|
when:
|
||||||
|
- inventory_hostname in groups['haproxy']
|
||||||
|
- enable_solum | bool
|
||||||
|
|
||||||
- name: Checking free port for Swift Object Server
|
- name: Checking free port for Swift Object Server
|
||||||
wait_for:
|
wait_for:
|
||||||
host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
|
host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}"
|
||||||
|
47
ansible/roles/solum/defaults/main.yml
Normal file
47
ansible/roles/solum/defaults/main.yml
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
---
|
||||||
|
project_name: "solum"
|
||||||
|
|
||||||
|
####################
|
||||||
|
# Database
|
||||||
|
####################
|
||||||
|
solum_database_name: "solum"
|
||||||
|
solum_database_user: "solum"
|
||||||
|
solum_database_address: "{{ kolla_internal_fqdn }}:{{ database_port }}"
|
||||||
|
|
||||||
|
|
||||||
|
####################
|
||||||
|
# Docker
|
||||||
|
####################
|
||||||
|
solum_worker_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-solum-worker"
|
||||||
|
solum_worker_tag: "{{ openstack_release }}"
|
||||||
|
solum_worker_image_full: "{{ solum_worker_image }}:{{ solum_worker_tag }}"
|
||||||
|
|
||||||
|
solum_deployer_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-solum-deployer"
|
||||||
|
solum_deployer_tag: "{{ openstack_release }}"
|
||||||
|
solum_deployer_image_full: "{{ solum_deployer_image }}:{{ solum_deployer_tag }}"
|
||||||
|
|
||||||
|
solum_conductor_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-solum-conductor"
|
||||||
|
solum_conductor_tag: "{{ openstack_release }}"
|
||||||
|
solum_conductor_image_full: "{{ solum_conductor_image }}:{{ solum_conductor_tag }}"
|
||||||
|
|
||||||
|
solum_api_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-solum-api"
|
||||||
|
solum_api_tag: "{{ openstack_release }}"
|
||||||
|
solum_api_image_full: "{{ solum_api_image }}:{{ solum_api_tag }}"
|
||||||
|
|
||||||
|
|
||||||
|
####################
|
||||||
|
# OpenStack
|
||||||
|
####################
|
||||||
|
solum_image_builder_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ solum_image_builder_port }}"
|
||||||
|
solum_image_builder_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ solum_image_builder_port }}"
|
||||||
|
solum_image_builder_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ solum_image_builder_port }}"
|
||||||
|
|
||||||
|
solum_application_deployment_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ solum_application_deployment_port }}"
|
||||||
|
solum_application_deployment_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ solum_application_deployment_port }}"
|
||||||
|
solum_application_deployment_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ solum_application_deployment_port }}"
|
||||||
|
|
||||||
|
solum_logging_debug: "{{ openstack_logging_debug }}"
|
||||||
|
|
||||||
|
solum_keystone_user: "solum"
|
||||||
|
|
||||||
|
openstack_solum_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}'}"
|
3
ansible/roles/solum/meta/main.yml
Normal file
3
ansible/roles/solum/meta/main.yml
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
dependencies:
|
||||||
|
- { role: common }
|
41
ansible/roles/solum/tasks/bootstrap.yml
Normal file
41
ansible/roles/solum/tasks/bootstrap.yml
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
---
|
||||||
|
- name: Creating Solum database
|
||||||
|
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
||||||
|
-m mysql_db
|
||||||
|
-a "login_host='{{ database_address }}'
|
||||||
|
login_port='{{ database_port }}'
|
||||||
|
login_user='{{ database_user }}'
|
||||||
|
login_password='{{ database_password }}'
|
||||||
|
name='{{ solum_database_name }}'"
|
||||||
|
register: database
|
||||||
|
changed_when: "{{ database.stdout.find('localhost | SUCCESS => ') != -1 and
|
||||||
|
(database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
||||||
|
failed_when: database.stdout.split()[2] != 'SUCCESS'
|
||||||
|
run_once: True
|
||||||
|
delegate_to: "{{ groups['solum-api'][0] }}"
|
||||||
|
|
||||||
|
- name: Reading json from variable
|
||||||
|
set_fact:
|
||||||
|
database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
||||||
|
|
||||||
|
- name: Creating Solum database user and setting permissions
|
||||||
|
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
||||||
|
-m mysql_user
|
||||||
|
-a "login_host='{{ database_address }}'
|
||||||
|
login_port='{{ database_port }}'
|
||||||
|
login_user='{{ database_user }}'
|
||||||
|
login_password='{{ database_password }}'
|
||||||
|
name='{{ solum_database_name }}'
|
||||||
|
password='{{ solum_database_password }}'
|
||||||
|
host='%'
|
||||||
|
priv='{{ solum_database_name }}.*:ALL'
|
||||||
|
append_privs='yes'"
|
||||||
|
register: database_user_create
|
||||||
|
changed_when: "{{ database_user_create.stdout.find('localhost | SUCCESS => ') != -1 and
|
||||||
|
(database_user_create.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
||||||
|
failed_when: database_user_create.stdout.split()[2] != 'SUCCESS'
|
||||||
|
run_once: True
|
||||||
|
delegate_to: "{{ groups['solum-api'][0] }}"
|
||||||
|
|
||||||
|
- include: bootstrap_service.yml
|
||||||
|
when: database_created
|
20
ansible/roles/solum/tasks/bootstrap_service.yml
Normal file
20
ansible/roles/solum/tasks/bootstrap_service.yml
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
---
|
||||||
|
- name: Running Solum bootstrap container
|
||||||
|
kolla_docker:
|
||||||
|
action: "start_container"
|
||||||
|
common_options: "{{ docker_common_options }}"
|
||||||
|
detach: False
|
||||||
|
environment:
|
||||||
|
KOLLA_BOOTSTRAP:
|
||||||
|
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
|
||||||
|
image: "{{ solum_api_image_full }}"
|
||||||
|
labels:
|
||||||
|
BOOTSTRAP:
|
||||||
|
name: "bootstrap_solum"
|
||||||
|
restart_policy: "never"
|
||||||
|
volumes:
|
||||||
|
- "{{ node_config_directory }}/solum-api/:{{ container_config_directory }}/:ro"
|
||||||
|
- "/etc/localtime:/etc/localtime:ro"
|
||||||
|
- "kolla_logs:/var/log/kolla/"
|
||||||
|
run_once: True
|
||||||
|
delegate_to: "{{ groups['solum-api'][0] }}"
|
40
ansible/roles/solum/tasks/config.yml
Normal file
40
ansible/roles/solum/tasks/config.yml
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
---
|
||||||
|
- name: Ensuring config directories exist
|
||||||
|
file:
|
||||||
|
path: "{{ node_config_directory }}/{{ item }}"
|
||||||
|
state: "directory"
|
||||||
|
recurse: yes
|
||||||
|
with_items:
|
||||||
|
- "solum-api"
|
||||||
|
- "solum-worker"
|
||||||
|
- "solum-deployer"
|
||||||
|
- "solum-conductor"
|
||||||
|
|
||||||
|
- name: Copying over config.json files for services
|
||||||
|
template:
|
||||||
|
src: "{{ item }}.json.j2"
|
||||||
|
dest: "{{ node_config_directory }}/{{ item }}/config.json"
|
||||||
|
with_items:
|
||||||
|
- "solum-api"
|
||||||
|
- "solum-worker"
|
||||||
|
- "solum-deployer"
|
||||||
|
- "solum-conductor"
|
||||||
|
|
||||||
|
- name: Copying over solum.conf
|
||||||
|
merge_configs:
|
||||||
|
vars:
|
||||||
|
service_name: "{{ item }}"
|
||||||
|
sources:
|
||||||
|
- "{{ role_path }}/templates/solum.conf.j2"
|
||||||
|
- "{{ node_config_directory }}/config/global.conf"
|
||||||
|
- "{{ node_config_directory }}/config/database.conf"
|
||||||
|
- "{{ node_config_directory }}/config/messaging.conf"
|
||||||
|
- "{{ node_config_directory }}/config/solum.conf"
|
||||||
|
- "{{ node_config_directory }}/config/solum/{{ item }}.conf"
|
||||||
|
- "{{ node_config_directory }}/config/solum/{{ inventory_hostname }}/solum.conf"
|
||||||
|
dest: "{{ node_config_directory }}/{{ item }}/solum.conf"
|
||||||
|
with_items:
|
||||||
|
- "solum-api"
|
||||||
|
- "solum-worker"
|
||||||
|
- "solum-deployer"
|
||||||
|
- "solum-conductor"
|
18
ansible/roles/solum/tasks/deploy.yml
Normal file
18
ansible/roles/solum/tasks/deploy.yml
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
---
|
||||||
|
- include: register.yml
|
||||||
|
when: inventory_hostname in groups['solum-api']
|
||||||
|
|
||||||
|
- include: config.yml
|
||||||
|
when: inventory_hostname in groups['solum-api'] or
|
||||||
|
inventory_hostname in groups['solum-deploy'] or
|
||||||
|
inventory_hostname in groups['solum-worker'] or
|
||||||
|
inventory_hostname in groups['solum-conductor']
|
||||||
|
|
||||||
|
- include: bootstrap.yml
|
||||||
|
when: inventory_hostname in groups['solum-api']
|
||||||
|
|
||||||
|
- include: start.yml
|
||||||
|
when: inventory_hostname in groups['solum-api'] or
|
||||||
|
inventory_hostname in groups['solum-deploy'] or
|
||||||
|
inventory_hostname in groups['solum-worker'] or
|
||||||
|
inventory_hostname in groups['solum-conductor']
|
2
ansible/roles/solum/tasks/main.yml
Normal file
2
ansible/roles/solum/tasks/main.yml
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
- include: "{{ action }}.yml"
|
1
ansible/roles/solum/tasks/precheck.yml
Normal file
1
ansible/roles/solum/tasks/precheck.yml
Normal file
@ -0,0 +1 @@
|
|||||||
|
---
|
28
ansible/roles/solum/tasks/pull.yml
Normal file
28
ansible/roles/solum/tasks/pull.yml
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
---
|
||||||
|
- name: Pulling solum-api image
|
||||||
|
kolla_docker:
|
||||||
|
action: "pull_image"
|
||||||
|
common_options: "{{ docker_common_options }}"
|
||||||
|
image: "{{ solum_api_image_full }}"
|
||||||
|
when: inventory_hostname in groups['solum-api']
|
||||||
|
|
||||||
|
- name: Pulling solum-worker image
|
||||||
|
kolla_docker:
|
||||||
|
action: "pull_image"
|
||||||
|
common_options: "{{ docker_common_options }}"
|
||||||
|
image: "{{ solum_worker_image_full }}"
|
||||||
|
when: inventory_hostname in groups['solum-worker']
|
||||||
|
|
||||||
|
- name: Pulling solum-deployer image
|
||||||
|
kolla_docker:
|
||||||
|
action: "pull_image"
|
||||||
|
common_options: "{{ docker_common_options }}"
|
||||||
|
image: "{{ solum_deployer_image_full }}"
|
||||||
|
when: inventory_hostname in groups['solum-deployer']
|
||||||
|
|
||||||
|
- name: Pulling solum-conductor image
|
||||||
|
kolla_docker:
|
||||||
|
action: "pull_image"
|
||||||
|
common_options: "{{ docker_common_options }}"
|
||||||
|
image: "{{ solum_conductor_image_full }}"
|
||||||
|
when: inventory_hostname in groups['solum-conductor']
|
76
ansible/roles/solum/tasks/reconfigure.yml
Normal file
76
ansible/roles/solum/tasks/reconfigure.yml
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
---
|
||||||
|
- name: Ensuring the containers up
|
||||||
|
kolla_docker:
|
||||||
|
name: "{{ item.name }}"
|
||||||
|
action: "get_container_state"
|
||||||
|
register: container_state
|
||||||
|
failed_when: container_state.Running == false
|
||||||
|
when: inventory_hostname in groups[item.group]
|
||||||
|
with_items:
|
||||||
|
- { name: solum_api, group: solum-api }
|
||||||
|
- { name: solum_worker, group: solum-worker }
|
||||||
|
- { name: solum_deployer, group: solum-deployer }
|
||||||
|
- { name: solum_conductor, group: solum-conductor }
|
||||||
|
|
||||||
|
- include: config.yml
|
||||||
|
|
||||||
|
- name: Check the configs
|
||||||
|
command: docker exec {{ item.name }} /usr/local/bin/kolla_set_configs --check
|
||||||
|
changed_when: false
|
||||||
|
failed_when: false
|
||||||
|
register: check_results
|
||||||
|
when: inventory_hostname in groups[item.group]
|
||||||
|
with_items:
|
||||||
|
- { name: solum_api, group: solum-api }
|
||||||
|
- { name: solum_worker, group: solum-worker }
|
||||||
|
- { name: solum_deployer, group: solum-deployer }
|
||||||
|
- { name: solum_conductor, group: solum-conductor }
|
||||||
|
|
||||||
|
- name: Containers config strategy
|
||||||
|
kolla_docker:
|
||||||
|
name: "{{ item.name }}"
|
||||||
|
action: "get_container_env"
|
||||||
|
register: container_envs
|
||||||
|
when: inventory_hostname in groups[item.group]
|
||||||
|
with_items:
|
||||||
|
- { name: solum_api, group: solum-api }
|
||||||
|
- { name: solum_worker, group: solum-worker }
|
||||||
|
- { name: solum_deployer, group: solum-deployer }
|
||||||
|
- { name: solum_conductor, group: solum-conductor }
|
||||||
|
|
||||||
|
- name: Remove the containers
|
||||||
|
kolla_docker:
|
||||||
|
name: "{{ item[0]['name'] }}"
|
||||||
|
action: "remove_container"
|
||||||
|
register: remove_containers
|
||||||
|
when:
|
||||||
|
- inventory_hostname in groups[item[0]['group']]
|
||||||
|
- config_strategy == "COPY_ONCE" or item[1]['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE'
|
||||||
|
- item[2]['rc'] == 1
|
||||||
|
with_together:
|
||||||
|
- [{ name: solum_api, group: solum-api },
|
||||||
|
{ name: solum_worker, group: solum-worker },
|
||||||
|
{ name: solum_deployer, group: solum-deployer },
|
||||||
|
{ name: solum_conductor, group: solum-conductor }]
|
||||||
|
- "{{ container_envs.results }}"
|
||||||
|
- "{{ check_results.results }}"
|
||||||
|
|
||||||
|
- include: start.yml
|
||||||
|
when: remove_containers.changed
|
||||||
|
|
||||||
|
- name: Restart containers
|
||||||
|
kolla_docker:
|
||||||
|
name: "{{ item[0]['name'] }}"
|
||||||
|
action: "restart_container"
|
||||||
|
when:
|
||||||
|
- inventory_hostname in groups[item[0]['group']]
|
||||||
|
- config_strategy == 'COPY_ALWAYS'
|
||||||
|
- item[1]['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE'
|
||||||
|
- item[2]['rc'] == 1
|
||||||
|
with_together:
|
||||||
|
- [{ name: solum_api, group: solum-api },
|
||||||
|
{ name: solum_worker, group: solum-worker },
|
||||||
|
{ name: solum_deployer, group: solum-deployer },
|
||||||
|
{ name: solum_conductor, group: solum-conductor }]
|
||||||
|
- "{{ container_envs.results }}"
|
||||||
|
- "{{ check_results.results }}"
|
63
ansible/roles/solum/tasks/register.yml
Normal file
63
ansible/roles/solum/tasks/register.yml
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
---
|
||||||
|
- name: Creating the Solum image builder service and endpoint
|
||||||
|
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
||||||
|
-m kolla_keystone_service
|
||||||
|
-a "service_name=solum_image_builder
|
||||||
|
service_type=image_builder
|
||||||
|
description='Openstack Solum Image Builder'
|
||||||
|
endpoint_region={{ openstack_region_name }}
|
||||||
|
url='{{ item.url }}'
|
||||||
|
interface='{{ item.interface }}'
|
||||||
|
region_name={{ openstack_region_name }}
|
||||||
|
auth={{ '{{ openstack_solum_auth }}' }}"
|
||||||
|
-e "{'openstack_solum_auth':{{ openstack_solum_auth }}}"
|
||||||
|
register: solum_image_builder_endpoint
|
||||||
|
changed_when: "{{ solum_image_builder_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (solum_image_builder_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
||||||
|
until: solum_image_builder_endpoint.stdout.split()[2] == 'SUCCESS'
|
||||||
|
retries: 10
|
||||||
|
delay: 5
|
||||||
|
run_once: True
|
||||||
|
with_items:
|
||||||
|
- {'interface': 'admin', 'url': '{{ solum_image_builder_admin_endpoint }}'}
|
||||||
|
- {'interface': 'internal', 'url': '{{ solum_image_builder_internal_endpoint }}'}
|
||||||
|
- {'interface': 'public', 'url': '{{ solum_image_builder_public_endpoint }}'}
|
||||||
|
|
||||||
|
- name: Creating the Solum application deployment service and endpoint
|
||||||
|
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
||||||
|
-m kolla_keystone_service
|
||||||
|
-a "service_name=solum_application_deployment
|
||||||
|
service_type=application_deployment
|
||||||
|
description='Openstack Solum Application Deployment'
|
||||||
|
endpoint_region={{ openstack_region_name }}
|
||||||
|
url='{{ item.url }}'
|
||||||
|
interface='{{ item.interface }}'
|
||||||
|
region_name={{ openstack_region_name }}
|
||||||
|
auth={{ '{{ openstack_solum_auth }}' }}"
|
||||||
|
-e "{'openstack_solum_auth':{{ openstack_solum_auth }}}"
|
||||||
|
register: solum_application_deployment_endpoint
|
||||||
|
changed_when: "{{ solum_application_deployment_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (solum_application_deployment_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
||||||
|
until: solum_application_deployment_endpoint.stdout.split()[2] == 'SUCCESS'
|
||||||
|
retries: 10
|
||||||
|
delay: 5
|
||||||
|
run_once: True
|
||||||
|
with_items:
|
||||||
|
- {'interface': 'admin', 'url': '{{ solum_application_deployment_admin_endpoint }}'}
|
||||||
|
- {'interface': 'internal', 'url': '{{ solum_application_deployment_internal_endpoint }}'}
|
||||||
|
- {'interface': 'public', 'url': '{{ solum_application_deployment_public_endpoint }}'}
|
||||||
|
|
||||||
|
- name: Creating the Solum project, user, and role
|
||||||
|
command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
|
||||||
|
-m kolla_keystone_user
|
||||||
|
-a "project=service
|
||||||
|
user=solum
|
||||||
|
password={{ solum_keystone_password }}
|
||||||
|
role=admin
|
||||||
|
region_name={{ openstack_region_name }}
|
||||||
|
auth={{ '{{ openstack_solum_auth }}' }}"
|
||||||
|
-e "{'openstack_solum_auth':{{ openstack_solum_auth }}}"
|
||||||
|
register: solum_user
|
||||||
|
changed_when: "{{ solum_user.stdout.find('localhost | SUCCESS => ') != -1 and (solum_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
|
||||||
|
until: solum_user.stdout.split()[2] == 'SUCCESS'
|
||||||
|
retries: 10
|
||||||
|
delay: 5
|
||||||
|
run_once: True
|
48
ansible/roles/solum/tasks/start.yml
Normal file
48
ansible/roles/solum/tasks/start.yml
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
---
|
||||||
|
- name: Starting solum-worker container
|
||||||
|
kolla_docker:
|
||||||
|
action: "start_container"
|
||||||
|
common_options: "{{ docker_common_options }}"
|
||||||
|
image: "{{ solum_worker_image_full }}"
|
||||||
|
name: "solum_worker"
|
||||||
|
volumes:
|
||||||
|
- "{{ node_config_directory }}/solum-worker/:{{ container_config_directory }}/:ro"
|
||||||
|
- "/etc/localtime:/etc/localtime:ro"
|
||||||
|
- "kolla_logs:/var/log/kolla/"
|
||||||
|
when: inventory_hostname in groups['solum-worker']
|
||||||
|
|
||||||
|
- name: Starting solum-api container
|
||||||
|
kolla_docker:
|
||||||
|
action: "start_container"
|
||||||
|
common_options: "{{ docker_common_options }}"
|
||||||
|
image: "{{ solum_api_image_full }}"
|
||||||
|
name: "solum_api"
|
||||||
|
volumes:
|
||||||
|
- "{{ node_config_directory }}/solum-api/:{{ container_config_directory }}/:ro"
|
||||||
|
- "/etc/localtime:/etc/localtime:ro"
|
||||||
|
- "kolla_logs:/var/log/kolla/"
|
||||||
|
when: inventory_hostname in groups['solum-api']
|
||||||
|
|
||||||
|
- name: Starting solum-deployer container
|
||||||
|
kolla_docker:
|
||||||
|
action: "start_container"
|
||||||
|
common_options: "{{ docker_common_options }}"
|
||||||
|
image: "{{ solum_deployer_image_full }}"
|
||||||
|
name: "solum_deployer"
|
||||||
|
volumes:
|
||||||
|
- "{{ node_config_directory }}/solum-deployer/:{{ container_config_directory }}/:ro"
|
||||||
|
- "/etc/localtime:/etc/localtime:ro"
|
||||||
|
- "kolla_logs:/var/log/kolla/"
|
||||||
|
when: inventory_hostname in groups['solum-deployer']
|
||||||
|
|
||||||
|
- name: Starting solum-conductor container
|
||||||
|
kolla_docker:
|
||||||
|
action: "start_container"
|
||||||
|
common_options: "{{ docker_common_options }}"
|
||||||
|
image: "{{ solum_conductor_image_full }}"
|
||||||
|
name: "solum_conductor"
|
||||||
|
volumes:
|
||||||
|
- "{{ node_config_directory }}/solum-conductor/:{{ container_config_directory }}/:ro"
|
||||||
|
- "/etc/localtime:/etc/localtime:ro"
|
||||||
|
- "kolla_logs:/var/log/kolla/"
|
||||||
|
when: inventory_hostname in groups['solum-conductor']
|
6
ansible/roles/solum/tasks/upgrade.yml
Normal file
6
ansible/roles/solum/tasks/upgrade.yml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
---
|
||||||
|
- include: config.yml
|
||||||
|
|
||||||
|
- include: bootstrap_service.yml
|
||||||
|
|
||||||
|
- include: start.yml
|
18
ansible/roles/solum/templates/solum-api.json.j2
Normal file
18
ansible/roles/solum/templates/solum-api.json.j2
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"command": "solum-api --config-file /etc/solum/solum.conf",
|
||||||
|
"config_files": [
|
||||||
|
{
|
||||||
|
"source": "{{ container_config_directory }}/solum.conf",
|
||||||
|
"dest": "/etc/solum/solum.conf",
|
||||||
|
"owner": "solum",
|
||||||
|
"perm": "0644"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"permissions": [
|
||||||
|
{
|
||||||
|
"path": "/var/log/kolla/solum",
|
||||||
|
"owner": "solum:solum",
|
||||||
|
"recurse": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
18
ansible/roles/solum/templates/solum-conductor.json.j2
Normal file
18
ansible/roles/solum/templates/solum-conductor.json.j2
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"command": "solum-conductor --config-file /etc/solum/solum.conf",
|
||||||
|
"config_files": [
|
||||||
|
{
|
||||||
|
"source": "{{ container_config_directory }}/solum.conf",
|
||||||
|
"dest": "/etc/solum/solum.conf",
|
||||||
|
"owner": "solum",
|
||||||
|
"perm": "0644"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"permissions": [
|
||||||
|
{
|
||||||
|
"path": "/var/log/kolla/solum",
|
||||||
|
"owner": "solum:solum",
|
||||||
|
"recurse": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
18
ansible/roles/solum/templates/solum-deployer.json.j2
Normal file
18
ansible/roles/solum/templates/solum-deployer.json.j2
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"command": "solum-deployer --config-file /etc/solum/solum.conf",
|
||||||
|
"config_files": [
|
||||||
|
{
|
||||||
|
"source": "{{ container_config_directory }}/solum.conf",
|
||||||
|
"dest": "/etc/solum/solum.conf",
|
||||||
|
"owner": "solum",
|
||||||
|
"perm": "0644"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"permissions": [
|
||||||
|
{
|
||||||
|
"path": "/var/log/kolla/solum",
|
||||||
|
"owner": "solum:solum",
|
||||||
|
"recurse": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
18
ansible/roles/solum/templates/solum-worker.json.j2
Normal file
18
ansible/roles/solum/templates/solum-worker.json.j2
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
"command": "solum-worker --config-file /etc/solum/solum.conf",
|
||||||
|
"config_files": [
|
||||||
|
{
|
||||||
|
"source": "{{ container_config_directory }}/solum.conf",
|
||||||
|
"dest": "/etc/solum/solum.conf",
|
||||||
|
"owner": "solum",
|
||||||
|
"perm": "0644"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"permissions": [
|
||||||
|
{
|
||||||
|
"path": "/var/log/kolla/solum",
|
||||||
|
"owner": "solum:solum",
|
||||||
|
"recurse": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
64
ansible/roles/solum/templates/solum.conf.j2
Normal file
64
ansible/roles/solum/templates/solum.conf.j2
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
[DEFAULT]
|
||||||
|
debug = {{ solum_logging_debug }}
|
||||||
|
log_dir = /var/log/kolla/solum
|
||||||
|
|
||||||
|
{% if service_name == 'solum-api' %}
|
||||||
|
bind_host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
|
||||||
|
bind_port = {{ solum_application_deployment_port }}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
[api]
|
||||||
|
image_format = vm
|
||||||
|
port = {{ solum_application_deployment_port }}
|
||||||
|
workers = {{ openstack_service_workers }}
|
||||||
|
|
||||||
|
[conductor]
|
||||||
|
topic = solum-conductor
|
||||||
|
|
||||||
|
[deployer]
|
||||||
|
growth_factor = 1.1
|
||||||
|
wait_interval = 1
|
||||||
|
max_attempts = 2000
|
||||||
|
handler = heat
|
||||||
|
topic = solum-deployer
|
||||||
|
|
||||||
|
[worker]
|
||||||
|
proj_dir = /solum
|
||||||
|
handler = shell
|
||||||
|
topic = solum-worker
|
||||||
|
task_log_dir = /var/log/kolla/solum/worker
|
||||||
|
image_storage = glance
|
||||||
|
docker_build_timeout = 1800
|
||||||
|
lp_operator_tenant_name = service
|
||||||
|
lp_operator_password = {{ solum_keystone_password }}
|
||||||
|
lp_operator_user = {{ solum_keystone_user }}
|
||||||
|
|
||||||
|
[builder]
|
||||||
|
port = {{ solum_image_builder_public_endpoint }}
|
||||||
|
host = {{ ansible_hostname }}_{{ item }}
|
||||||
|
|
||||||
|
[database]
|
||||||
|
connection = mysql+pymysql://{{ solum_database_user }}:{{ solum_database_password }}@{{ solum_database_address }}/{{ solum_database_name }}
|
||||||
|
max_retries = -1
|
||||||
|
|
||||||
|
[keystone_authtoken]
|
||||||
|
auth_uri = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_public_port }}/v2.0
|
||||||
|
auth_url = {{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_admin_port }}
|
||||||
|
auth_type = password
|
||||||
|
auth_protocol = http
|
||||||
|
auth_prot = 35357
|
||||||
|
project_domain_id = default
|
||||||
|
user_domain_id = default
|
||||||
|
project_name = service
|
||||||
|
username = {{ solum_keystone_user }}
|
||||||
|
password = {{ solum_keystone_password }}
|
||||||
|
|
||||||
|
memcache_security_strategy = ENCRYPT
|
||||||
|
memcache_secret_key = {{ memcache_secret_key }}
|
||||||
|
memcached_servers = {% for host in groups['memcached'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ memcached_port }}{% if not loop.last %},{% endif %}{% endfor %}
|
||||||
|
|
||||||
|
[oslo_messaging_rabbit]
|
||||||
|
transport_url = rabbit://{% for host in groups['rabbitmq'] %}{{ rabbitmq_user }}:{{ rabbitmq_password }}@{% if orchestration_engine == 'KUBERNETES' %}rabbitmq{% else %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}{% endif %}:{{ rabbitmq_port }}{% if not loop.last %},{% endif %}{% endfor %}
|
||||||
|
|
||||||
|
[oslo_messaging_notifications]
|
||||||
|
driver = messagingv2
|
@ -251,6 +251,17 @@
|
|||||||
tags: murano,
|
tags: murano,
|
||||||
when: enable_murano | bool }
|
when: enable_murano | bool }
|
||||||
|
|
||||||
|
- hosts:
|
||||||
|
- solum-api
|
||||||
|
- solum-worker
|
||||||
|
- solum-deployer
|
||||||
|
- solum-conductor
|
||||||
|
serial: '{{ serial|default("0") }}'
|
||||||
|
roles:
|
||||||
|
- { role: solum,
|
||||||
|
tags: solum,
|
||||||
|
when: enable_solum | bool }
|
||||||
|
|
||||||
- hosts:
|
- hosts:
|
||||||
- magnum-api
|
- magnum-api
|
||||||
- magnum-conductor
|
- magnum-conductor
|
||||||
|
@ -152,6 +152,7 @@ kolla_internal_vip_address: "10.10.10.254"
|
|||||||
#enable_sahara: "no"
|
#enable_sahara: "no"
|
||||||
#enable_searchlight: "no"
|
#enable_searchlight: "no"
|
||||||
#enable_senlin: "no"
|
#enable_senlin: "no"
|
||||||
|
#enable_solum: "no"
|
||||||
#enable_swift: "no"
|
#enable_swift: "no"
|
||||||
#enable_telegraf: "no"
|
#enable_telegraf: "no"
|
||||||
#enable_tempest: "no"
|
#enable_tempest: "no"
|
||||||
|
@ -95,6 +95,9 @@ rally_database_password:
|
|||||||
senlin_database_password:
|
senlin_database_password:
|
||||||
senlin_keystone_password:
|
senlin_keystone_password:
|
||||||
|
|
||||||
|
solum_database_password:
|
||||||
|
solum_keystone_password:
|
||||||
|
|
||||||
horizon_secret_key:
|
horizon_secret_key:
|
||||||
horizon_database_password:
|
horizon_database_password:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user