diff --git a/ansible/group_vars/all.yml b/ansible/group_vars/all.yml index e0660b8027..494790e6bc 100644 --- a/ansible/group_vars/all.yml +++ b/ansible/group_vars/all.yml @@ -178,6 +178,10 @@ ironic_api_port: "6385" magnum_api_port: "9511" +solum_application_deployment_port: "9777" + +solum_image_builder_port: "9778" + rgw_port: "6780" mistral_api_port: "8989" @@ -285,6 +289,7 @@ enable_rally: "no" enable_sahara: "no" enable_searchlight: "no" enable_senlin: "no" +enable_solum: "no" enable_swift: "no" enable_telegraf: "no" enable_tempest: "no" diff --git a/ansible/inventory/all-in-one b/ansible/inventory/all-in-one index 70258ad100..ca693c0ff4 100644 --- a/ansible/inventory/all-in-one +++ b/ansible/inventory/all-in-one @@ -105,6 +105,9 @@ control [sahara:children] control +[solum:children] +control + [mistral:children] control @@ -322,6 +325,19 @@ magnum [magnum-conductor:children] magnum +# Solum +[solum-api:children] +solum + +[solum-worker:children] +solum + +[solum-deployer:children] +solum + +[solum-conductor:children] +solum + # Mistral [mistral-api:children] mistral diff --git a/ansible/inventory/multinode b/ansible/inventory/multinode index e24e03440b..728be081ea 100644 --- a/ansible/inventory/multinode +++ b/ansible/inventory/multinode @@ -108,6 +108,9 @@ control [murano:children] control +[solum:children] +control + [ironic:children] control @@ -334,6 +337,19 @@ sahara [sahara-engine:children] sahara +# Solum +[solum-api:children] +solum + +[solum-worker:children] +solum + +[solum-deployer:children] +solum + +[solum-conductor:children] +solum + # Mistral [mistral-api:children] mistral diff --git a/ansible/roles/common/tasks/config.yml b/ansible/roles/common/tasks/config.yml index e12f7cdaed..00a83a7b86 100644 --- a/ansible/roles/common/tasks/config.yml +++ b/ansible/roles/common/tasks/config.yml @@ -98,5 +98,6 @@ - { name: "sahara", enabled: "{{ enable_sahara }}" } - { name: "searchlight", enabled: "{{ enable_searchlight }}" } - { name: "senlin", enabled: "{{ enable_senlin }}" } + - { name: "solum", enabled: "{{ enable_solum }}" } - { name: "swift", enabled: "{{ enable_swift }}" } - { name: "watcher", enabled: "{{ enable_watcher }}" } diff --git a/ansible/roles/common/templates/cron-logrotate-solum.conf.j2 b/ansible/roles/common/templates/cron-logrotate-solum.conf.j2 new file mode 100644 index 0000000000..c90bb37530 --- /dev/null +++ b/ansible/roles/common/templates/cron-logrotate-solum.conf.j2 @@ -0,0 +1,3 @@ +"/var/log/kolla/solum/*.log" +{ +} diff --git a/ansible/roles/common/templates/cron.json.j2 b/ansible/roles/common/templates/cron.json.j2 index 8a338195e0..610145f25b 100644 --- a/ansible/roles/common/templates/cron.json.j2 +++ b/ansible/roles/common/templates/cron.json.j2 @@ -26,6 +26,7 @@ ( 'sahara', enable_sahara ), ( 'searchlight', enable_searchlight ), ( 'senlin', enable_senlin ), + ( 'solum', enable_solum ), ( 'swift', enable_swift ) ] %} { diff --git a/ansible/roles/haproxy/templates/haproxy.cfg.j2 b/ansible/roles/haproxy/templates/haproxy.cfg.j2 index f5b3ba20db..abedfbf024 100644 --- a/ansible/roles/haproxy/templates/haproxy.cfg.j2 +++ b/ansible/roles/haproxy/templates/haproxy.cfg.j2 @@ -341,6 +341,34 @@ listen senlin_api_external {% 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 %} listen swift_api bind {{ kolla_internal_vip_address }}:{{ swift_proxy_server_port }} diff --git a/ansible/roles/prechecks/tasks/port_checks.yml b/ansible/roles/prechecks/tasks/port_checks.yml index 1968b6153c..eef306fc2f 100644 --- a/ansible/roles/prechecks/tasks/port_checks.yml +++ b/ansible/roles/prechecks/tasks/port_checks.yml @@ -720,6 +720,46 @@ - inventory_hostname in groups['swift-object-server'] - 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 wait_for: host: "{{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}" diff --git a/ansible/roles/solum/defaults/main.yml b/ansible/roles/solum/defaults/main.yml new file mode 100644 index 0000000000..dd78cdc593 --- /dev/null +++ b/ansible/roles/solum/defaults/main.yml @@ -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 }}'}" diff --git a/ansible/roles/solum/meta/main.yml b/ansible/roles/solum/meta/main.yml new file mode 100644 index 0000000000..6b4fff8fef --- /dev/null +++ b/ansible/roles/solum/meta/main.yml @@ -0,0 +1,3 @@ +--- +dependencies: + - { role: common } diff --git a/ansible/roles/solum/tasks/bootstrap.yml b/ansible/roles/solum/tasks/bootstrap.yml new file mode 100644 index 0000000000..3d1ff9e15e --- /dev/null +++ b/ansible/roles/solum/tasks/bootstrap.yml @@ -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 diff --git a/ansible/roles/solum/tasks/bootstrap_service.yml b/ansible/roles/solum/tasks/bootstrap_service.yml new file mode 100644 index 0000000000..6b797e1372 --- /dev/null +++ b/ansible/roles/solum/tasks/bootstrap_service.yml @@ -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] }}" diff --git a/ansible/roles/solum/tasks/config.yml b/ansible/roles/solum/tasks/config.yml new file mode 100644 index 0000000000..8b283398cf --- /dev/null +++ b/ansible/roles/solum/tasks/config.yml @@ -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" diff --git a/ansible/roles/solum/tasks/deploy.yml b/ansible/roles/solum/tasks/deploy.yml new file mode 100644 index 0000000000..c619ea5f49 --- /dev/null +++ b/ansible/roles/solum/tasks/deploy.yml @@ -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'] diff --git a/ansible/roles/solum/tasks/main.yml b/ansible/roles/solum/tasks/main.yml new file mode 100644 index 0000000000..b017e8b4ad --- /dev/null +++ b/ansible/roles/solum/tasks/main.yml @@ -0,0 +1,2 @@ +--- +- include: "{{ action }}.yml" diff --git a/ansible/roles/solum/tasks/precheck.yml b/ansible/roles/solum/tasks/precheck.yml new file mode 100644 index 0000000000..ed97d539c0 --- /dev/null +++ b/ansible/roles/solum/tasks/precheck.yml @@ -0,0 +1 @@ +--- diff --git a/ansible/roles/solum/tasks/pull.yml b/ansible/roles/solum/tasks/pull.yml new file mode 100644 index 0000000000..2d500ce5dc --- /dev/null +++ b/ansible/roles/solum/tasks/pull.yml @@ -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'] diff --git a/ansible/roles/solum/tasks/reconfigure.yml b/ansible/roles/solum/tasks/reconfigure.yml new file mode 100644 index 0000000000..2a4e40f4c7 --- /dev/null +++ b/ansible/roles/solum/tasks/reconfigure.yml @@ -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 }}" diff --git a/ansible/roles/solum/tasks/register.yml b/ansible/roles/solum/tasks/register.yml new file mode 100644 index 0000000000..118d85f17b --- /dev/null +++ b/ansible/roles/solum/tasks/register.yml @@ -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 diff --git a/ansible/roles/solum/tasks/start.yml b/ansible/roles/solum/tasks/start.yml new file mode 100644 index 0000000000..06f6303d93 --- /dev/null +++ b/ansible/roles/solum/tasks/start.yml @@ -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'] diff --git a/ansible/roles/solum/tasks/upgrade.yml b/ansible/roles/solum/tasks/upgrade.yml new file mode 100644 index 0000000000..308053080c --- /dev/null +++ b/ansible/roles/solum/tasks/upgrade.yml @@ -0,0 +1,6 @@ +--- +- include: config.yml + +- include: bootstrap_service.yml + +- include: start.yml diff --git a/ansible/roles/solum/templates/solum-api.json.j2 b/ansible/roles/solum/templates/solum-api.json.j2 new file mode 100644 index 0000000000..68afad6686 --- /dev/null +++ b/ansible/roles/solum/templates/solum-api.json.j2 @@ -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 + } + ] +} diff --git a/ansible/roles/solum/templates/solum-conductor.json.j2 b/ansible/roles/solum/templates/solum-conductor.json.j2 new file mode 100644 index 0000000000..2fef4bc3cf --- /dev/null +++ b/ansible/roles/solum/templates/solum-conductor.json.j2 @@ -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 + } + ] +} diff --git a/ansible/roles/solum/templates/solum-deployer.json.j2 b/ansible/roles/solum/templates/solum-deployer.json.j2 new file mode 100644 index 0000000000..53d8fc5aee --- /dev/null +++ b/ansible/roles/solum/templates/solum-deployer.json.j2 @@ -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 + } + ] +} diff --git a/ansible/roles/solum/templates/solum-worker.json.j2 b/ansible/roles/solum/templates/solum-worker.json.j2 new file mode 100644 index 0000000000..35afc47d77 --- /dev/null +++ b/ansible/roles/solum/templates/solum-worker.json.j2 @@ -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 + } + ] +} diff --git a/ansible/roles/solum/templates/solum.conf.j2 b/ansible/roles/solum/templates/solum.conf.j2 new file mode 100644 index 0000000000..ec8e40538b --- /dev/null +++ b/ansible/roles/solum/templates/solum.conf.j2 @@ -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 diff --git a/ansible/site.yml b/ansible/site.yml index cc6361284c..62c53f5a4d 100644 --- a/ansible/site.yml +++ b/ansible/site.yml @@ -251,6 +251,17 @@ tags: murano, 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: - magnum-api - magnum-conductor diff --git a/etc/kolla/globals.yml b/etc/kolla/globals.yml index f5c9f2adae..2e13289802 100644 --- a/etc/kolla/globals.yml +++ b/etc/kolla/globals.yml @@ -152,6 +152,7 @@ kolla_internal_vip_address: "10.10.10.254" #enable_sahara: "no" #enable_searchlight: "no" #enable_senlin: "no" +#enable_solum: "no" #enable_swift: "no" #enable_telegraf: "no" #enable_tempest: "no" diff --git a/etc/kolla/passwords.yml b/etc/kolla/passwords.yml index a6e98b3b28..da095040a0 100644 --- a/etc/kolla/passwords.yml +++ b/etc/kolla/passwords.yml @@ -95,6 +95,9 @@ rally_database_password: senlin_database_password: senlin_keystone_password: +solum_database_password: +solum_keystone_password: + horizon_secret_key: horizon_database_password: