aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/sahara
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles/sahara')
-rw-r--r--ansible/roles/sahara/defaults/main.yml36
-rw-r--r--ansible/roles/sahara/meta/main.yml3
-rw-r--r--ansible/roles/sahara/tasks/bootstrap.yml41
-rw-r--r--ansible/roles/sahara/tasks/bootstrap_service.yml21
-rw-r--r--ansible/roles/sahara/tasks/config.yml48
-rw-r--r--ansible/roles/sahara/tasks/deploy.yml14
-rw-r--r--ansible/roles/sahara/tasks/main.yml2
-rw-r--r--ansible/roles/sahara/tasks/precheck.yml1
-rw-r--r--ansible/roles/sahara/tasks/pull.yml14
-rw-r--r--ansible/roles/sahara/tasks/reconfigure.yml69
-rw-r--r--ansible/roles/sahara/tasks/register.yml40
-rw-r--r--ansible/roles/sahara/tasks/start.yml26
-rw-r--r--ansible/roles/sahara/tasks/upgrade.yml6
-rw-r--r--ansible/roles/sahara/templates/sahara-api.json.j223
-rw-r--r--ansible/roles/sahara/templates/sahara-engine.json.j223
-rw-r--r--ansible/roles/sahara/templates/sahara.conf.j247
16 files changed, 0 insertions, 414 deletions
diff --git a/ansible/roles/sahara/defaults/main.yml b/ansible/roles/sahara/defaults/main.yml
deleted file mode 100644
index d545f6834..000000000
--- a/ansible/roles/sahara/defaults/main.yml
+++ /dev/null
@@ -1,36 +0,0 @@
----
-project_name: "sahara"
-
-
-####################
-# Database
-####################
-sahara_database_name: "sahara"
-sahara_database_user: "sahara"
-sahara_database_address: "{{ kolla_internal_fqdn }}:{{ database_port }}"
-
-
-####################
-# Docker
-####################
-sahara_engine_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-sahara-engine"
-sahara_engine_tag: "{{ openstack_release }}"
-sahara_engine_image_full: "{{ sahara_engine_image }}:{{ sahara_engine_tag }}"
-
-sahara_api_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-sahara-api"
-sahara_api_tag: "{{ openstack_release }}"
-sahara_api_image_full: "{{ sahara_api_image }}:{{ sahara_api_tag }}"
-
-
-####################
-# OpenStack
-####################
-sahara_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ sahara_api_port }}/v1.1/%(tenant_id)s"
-sahara_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ sahara_api_port }}/v1.1/%(tenant_id)s"
-sahara_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ sahara_api_port }}/v1.1/%(tenant_id)s"
-
-sahara_logging_debug: "{{ openstack_logging_debug }}"
-
-sahara_keystone_user: "sahara"
-
-openstack_sahara_auth: "{'auth_url':'{{ openstack_auth.auth_url }}','username':'{{ openstack_auth.username }}','password':'{{ openstack_auth.password }}','project_name':'{{ openstack_auth.project_name }}','domain_name':'default'}"
diff --git a/ansible/roles/sahara/meta/main.yml b/ansible/roles/sahara/meta/main.yml
deleted file mode 100644
index 6b4fff8fe..000000000
--- a/ansible/roles/sahara/meta/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-dependencies:
- - { role: common }
diff --git a/ansible/roles/sahara/tasks/bootstrap.yml b/ansible/roles/sahara/tasks/bootstrap.yml
deleted file mode 100644
index 6e98f125b..000000000
--- a/ansible/roles/sahara/tasks/bootstrap.yml
+++ /dev/null
@@ -1,41 +0,0 @@
----
-- name: Creating sahara 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='{{ sahara_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['sahara-api'][0] }}"
-
-- name: Reading json from variable
- set_fact:
- database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
-
-- name: Creating sahara 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='{{ sahara_database_name }}'
- password='{{ sahara_database_password }}'
- host='%'
- priv='{{ sahara_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['sahara-api'][0] }}"
-
-- include: bootstrap_service.yml
- when: database_created
diff --git a/ansible/roles/sahara/tasks/bootstrap_service.yml b/ansible/roles/sahara/tasks/bootstrap_service.yml
deleted file mode 100644
index e4b88fa4c..000000000
--- a/ansible/roles/sahara/tasks/bootstrap_service.yml
+++ /dev/null
@@ -1,21 +0,0 @@
----
-- name: Running Sahara bootstrap container
- kolla_docker:
- action: "start_container"
- common_options: "{{ docker_common_options }}"
- detach: False
- environment:
- KOLLA_BOOTSTRAP:
- KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
- image: "{{ sahara_api_image_full }}"
- labels:
- BOOTSTRAP:
- name: "bootstrap_sahara"
- restart_policy: "never"
- volumes:
- - "{{ node_config_directory }}/sahara-api/:{{ container_config_directory }}/:ro"
- - "/etc/localtime:/etc/localtime:ro"
- - "kolla_logs:/var/log/kolla/"
- - "sahara:/var/lib/sahara/"
- run_once: True
- delegate_to: "{{ groups['sahara-api'][0] }}"
diff --git a/ansible/roles/sahara/tasks/config.yml b/ansible/roles/sahara/tasks/config.yml
deleted file mode 100644
index 59cda5314..000000000
--- a/ansible/roles/sahara/tasks/config.yml
+++ /dev/null
@@ -1,48 +0,0 @@
----
-- name: Ensuring config directories exist
- file:
- path: "{{ node_config_directory }}/{{ item }}"
- state: "directory"
- recurse: yes
- with_items:
- - "sahara-api"
- - "sahara-engine"
-
-- name: Copying over config.json files for services
- template:
- src: "{{ item }}.json.j2"
- dest: "{{ node_config_directory }}/{{ item }}/config.json"
- with_items:
- - "sahara-api"
- - "sahara-engine"
-
-- name: Copying over sahara.conf
- merge_configs:
- vars:
- service_name: "{{ item }}"
- sources:
- - "{{ role_path }}/templates/sahara.conf.j2"
- - "{{ node_custom_config }}/global.conf"
- - "{{ node_custom_config }}/database.conf"
- - "{{ node_custom_config }}/messaging.conf"
- - "{{ node_custom_config }}/sahara.conf"
- - "{{ node_custom_config }}/sahara/{{ item }}.conf"
- - "{{ node_custom_config }}/sahara/{{ inventory_hostname }}/sahara.conf"
- dest: "{{ node_config_directory }}/{{ item }}/sahara.conf"
- with_items:
- - "sahara-api"
- - "sahara-engine"
-
-- name: Check if policies shall be overwritten
- local_action: stat path="{{ node_custom_config }}/sahara/policy.json"
- register: sahara_policy
-
-- name: Copying over existing policy.json
- template:
- src: "{{ node_custom_config }}/sahara/policy.json"
- dest: "{{ node_config_directory }}/{{ item }}/policy.json"
- with_items:
- - "sahara-api"
- - "sahara-engine"
- when:
- sahara_policy.stat.exists
diff --git a/ansible/roles/sahara/tasks/deploy.yml b/ansible/roles/sahara/tasks/deploy.yml
deleted file mode 100644
index f109cf736..000000000
--- a/ansible/roles/sahara/tasks/deploy.yml
+++ /dev/null
@@ -1,14 +0,0 @@
----
-- include: register.yml
- when: inventory_hostname in groups['sahara-api']
-
-- include: config.yml
- when: inventory_hostname in groups['sahara-api'] or
- inventory_hostname in groups['sahara-engine']
-
-- include: bootstrap.yml
- when: inventory_hostname in groups['sahara-api']
-
-- include: start.yml
- when: inventory_hostname in groups['sahara-api'] or
- inventory_hostname in groups['sahara-engine']
diff --git a/ansible/roles/sahara/tasks/main.yml b/ansible/roles/sahara/tasks/main.yml
deleted file mode 100644
index b017e8b4a..000000000
--- a/ansible/roles/sahara/tasks/main.yml
+++ /dev/null
@@ -1,2 +0,0 @@
----
-- include: "{{ action }}.yml"
diff --git a/ansible/roles/sahara/tasks/precheck.yml b/ansible/roles/sahara/tasks/precheck.yml
deleted file mode 100644
index ed97d539c..000000000
--- a/ansible/roles/sahara/tasks/precheck.yml
+++ /dev/null
@@ -1 +0,0 @@
----
diff --git a/ansible/roles/sahara/tasks/pull.yml b/ansible/roles/sahara/tasks/pull.yml
deleted file mode 100644
index 8d0037f48..000000000
--- a/ansible/roles/sahara/tasks/pull.yml
+++ /dev/null
@@ -1,14 +0,0 @@
----
-- name: Pulling sahara-engine image
- kolla_docker:
- action: "pull_image"
- common_options: "{{ docker_common_options }}"
- image: "{{ sahara_engine_image_full }}"
- when: inventory_hostname in groups['sahara-engine']
-
-- name: Pulling sahara-api image
- kolla_docker:
- action: "pull_image"
- common_options: "{{ docker_common_options }}"
- image: "{{ sahara_api_image_full }}"
- when: inventory_hostname in groups['sahara-api']
diff --git a/ansible/roles/sahara/tasks/reconfigure.yml b/ansible/roles/sahara/tasks/reconfigure.yml
deleted file mode 100644
index 890f10645..000000000
--- a/ansible/roles/sahara/tasks/reconfigure.yml
+++ /dev/null
@@ -1,69 +0,0 @@
----
-- 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: sahara_api, group: sahara-api }
- - { name: sahara_engine, group: sahara-engine }
-
-- 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: sahara_api, group: sahara-api }
- - { name: sahara_engine, group: sahara-engine }
-
-# NOTE(jeffrey4l): when config_strategy == 'COPY_ALWAYS'
-# and container env['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE',
-# just remove the container and start again
-- 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: sahara_api, group: sahara-api }
- - { name: sahara_engine, group: sahara-engine }
-
-- 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: sahara_api, group: sahara-api },
- { name: sahara_engine, group: sahara-engine },]
- - "{{ 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: sahara_api, group: sahara-api },
- { name: sahara_engine, group: sahara-engine },]
- - "{{ container_envs.results }}"
- - "{{ check_results.results }}"
diff --git a/ansible/roles/sahara/tasks/register.yml b/ansible/roles/sahara/tasks/register.yml
deleted file mode 100644
index 7c031e093..000000000
--- a/ansible/roles/sahara/tasks/register.yml
+++ /dev/null
@@ -1,40 +0,0 @@
----
-- name: Creating the Sahara service and endpoint
- command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
- -m kolla_keystone_service
- -a "service_name=sahara
- service_type=data_processing
- description='Sahara Data Processing'
- endpoint_region={{ openstack_region_name }}
- url='{{ item.url }}'
- interface='{{ item.interface }}'
- region_name={{ openstack_region_name }}
- auth={{ '{{ openstack_sahara_auth }}' }}"
- -e "{'openstack_sahara_auth':{{ openstack_sahara_auth }}}"
- register: sahara_endpoint
- changed_when: "{{ sahara_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (sahara_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
- until: sahara_endpoint.stdout.split()[2] == 'SUCCESS'
- retries: 10
- delay: 5
- run_once: True
- with_items:
- - {'interface': 'admin', 'url': '{{ sahara_admin_endpoint }}'}
- - {'interface': 'internal', 'url': '{{ sahara_internal_endpoint }}'}
- - {'interface': 'public', 'url': '{{ sahara_public_endpoint }}'}
-
-- name: Creating the Sahara project, user, and role
- command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
- -m kolla_keystone_user
- -a "project=service
- user=sahara
- password={{ sahara_keystone_password }}
- role=admin
- region_name={{ openstack_region_name }}
- auth={{ '{{ openstack_sahara_auth }}' }}"
- -e "{'openstack_sahara_auth':{{ openstack_sahara_auth }}}"
- register: sahara_user
- changed_when: "{{ sahara_user.stdout.find('localhost | SUCCESS => ') != -1 and (sahara_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
- until: sahara_user.stdout.split()[2] == 'SUCCESS'
- retries: 10
- delay: 5
- run_once: True
diff --git a/ansible/roles/sahara/tasks/start.yml b/ansible/roles/sahara/tasks/start.yml
deleted file mode 100644
index bb7b22d6b..000000000
--- a/ansible/roles/sahara/tasks/start.yml
+++ /dev/null
@@ -1,26 +0,0 @@
----
-- name: Starting sahara-api container
- kolla_docker:
- action: "start_container"
- common_options: "{{ docker_common_options }}"
- image: "{{ sahara_api_image_full }}"
- name: "sahara_api"
- volumes:
- - "{{ node_config_directory }}/sahara-api/:{{ container_config_directory }}/:ro"
- - "/etc/localtime:/etc/localtime:ro"
- - "sahara:/var/lib/sahara/"
- - "kolla_logs:/var/log/kolla/"
- when: inventory_hostname in groups['sahara-api']
-
-- name: Starting sahara-engine container
- kolla_docker:
- action: "start_container"
- common_options: "{{ docker_common_options }}"
- image: "{{ sahara_engine_image_full }}"
- name: "sahara_engine"
- volumes:
- - "{{ node_config_directory }}/sahara-engine/:{{ container_config_directory }}/:ro"
- - "/etc/localtime:/etc/localtime:ro"
- - "sahara:/var/lib/sahara/"
- - "kolla_logs:/var/log/kolla/"
- when: inventory_hostname in groups['sahara-engine']
diff --git a/ansible/roles/sahara/tasks/upgrade.yml b/ansible/roles/sahara/tasks/upgrade.yml
deleted file mode 100644
index 308053080..000000000
--- a/ansible/roles/sahara/tasks/upgrade.yml
+++ /dev/null
@@ -1,6 +0,0 @@
----
-- include: config.yml
-
-- include: bootstrap_service.yml
-
-- include: start.yml
diff --git a/ansible/roles/sahara/templates/sahara-api.json.j2 b/ansible/roles/sahara/templates/sahara-api.json.j2
deleted file mode 100644
index 33e45f49e..000000000
--- a/ansible/roles/sahara/templates/sahara-api.json.j2
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "command": "sahara-api --config-file /etc/sahara/sahara.conf",
- "config_files": [
- {
- "source": "{{ container_config_directory }}/sahara.conf",
- "dest": "/etc/sahara/sahara.conf",
- "owner": "sahara",
- "perm": "0600"
- }
- ],
- "permissions": [
- {
- "path": "/var/lib/sahara",
- "owner": "sahara:sahara",
- "recurse": true
- },
- {
- "path": "/var/log/kolla/sahara",
- "owner": "sahara:sahara",
- "recurse": true
- }
- ]
-}
diff --git a/ansible/roles/sahara/templates/sahara-engine.json.j2 b/ansible/roles/sahara/templates/sahara-engine.json.j2
deleted file mode 100644
index f677b503d..000000000
--- a/ansible/roles/sahara/templates/sahara-engine.json.j2
+++ /dev/null
@@ -1,23 +0,0 @@
-{
- "command": "sahara-engine --config-file /etc/sahara/sahara.conf",
- "config_files": [
- {
- "source": "{{ container_config_directory }}/sahara.conf",
- "dest": "/etc/sahara/sahara.conf",
- "owner": "sahara",
- "perm": "0600"
- }
- ],
- "permissions": [
- {
- "path": "/var/lib/sahara",
- "owner": "sahara:sahara",
- "recurse": true
- },
- {
- "path": "/var/log/kolla/sahara",
- "owner": "sahara:sahara",
- "recurse": true
- }
- ]
-}
diff --git a/ansible/roles/sahara/templates/sahara.conf.j2 b/ansible/roles/sahara/templates/sahara.conf.j2
deleted file mode 100644
index 8b116b63a..000000000
--- a/ansible/roles/sahara/templates/sahara.conf.j2
+++ /dev/null
@@ -1,47 +0,0 @@
-[DEFAULT]
-debug = {{ sahara_logging_debug }}
-log_dir = /var/log/kolla/sahara
-port = {{ sahara_api_port }}
-host = {{ hostvars[inventory_hostname]['ansible_' + api_interface]['ipv4']['address'] }}
-transport_url = rabbit://{% for host in groups['rabbitmq'] %}{{ rabbitmq_user }}:{{ rabbitmq_password }}@{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ rabbitmq_port }}{% if not loop.last %},{% endif %}{% endfor %}
-
-use_neutron = True
-api_workers = {{ openstack_service_workers }}
-use_floating_ips = False
-use_namespaces = True
-use_rootwrap = True
-
-[database]
-connection = mysql+pymysql://{{ sahara_database_user }}:{{ sahara_database_password }}@{{ sahara_database_address }}/{{ sahara_database_name }}
-
-[keystone_authtoken]
-auth_uri = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_public_port }}
-project_domain_name = default
-project_name = service
-user_domain_name = default
-username = {{ sahara_keystone_user }}
-password = {{ sahara_keystone_password }}
-auth_url = {{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_admin_port }}
-auth_type = password
-
-memcache_security_strategy = ENCRYPT
-memcache_secret_key = {{ memcache_secret_key }}
-{% if orchestration_engine == 'KUBERNETES' %}
-memcache_servers = {{ memcached_servers }}
-{% else %}
-memcached_servers = {% for host in groups['memcached'] %}{{ hostvars[host]['ansible_' + hostvars[host]['api_interface']]['ipv4']['address'] }}:{{ memcached_port }}{% if not loop.last %},{% endif %}{% endfor %}
-{% endif %}
-
-[service_credentials]
-auth_url = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_public_port }}
-region_name = {{ openstack_region_name }}
-password = {{ sahara_keystone_password }}
-username = {{ sahara_keystone_user }}
-project_name = service
-project_domain_id = default
-user_domain_id = default
-auth_type = password
-
-
-[profiler]
-enabled = False