aboutsummaryrefslogtreecommitdiff
path: root/ansible/roles/senlin
diff options
context:
space:
mode:
Diffstat (limited to 'ansible/roles/senlin')
-rw-r--r--ansible/roles/senlin/defaults/main.yml35
-rw-r--r--ansible/roles/senlin/meta/main.yml3
-rw-r--r--ansible/roles/senlin/tasks/bootstrap.yml41
-rw-r--r--ansible/roles/senlin/tasks/bootstrap_service.yml20
-rw-r--r--ansible/roles/senlin/tasks/config.yml48
-rw-r--r--ansible/roles/senlin/tasks/deploy.yml14
-rw-r--r--ansible/roles/senlin/tasks/main.yml2
-rw-r--r--ansible/roles/senlin/tasks/precheck.yml1
-rw-r--r--ansible/roles/senlin/tasks/pull.yml14
-rw-r--r--ansible/roles/senlin/tasks/reconfigure.yml66
-rw-r--r--ansible/roles/senlin/tasks/register.yml40
-rw-r--r--ansible/roles/senlin/tasks/start.yml24
-rw-r--r--ansible/roles/senlin/tasks/upgrade.yml6
-rw-r--r--ansible/roles/senlin/templates/senlin-api.json.j218
-rw-r--r--ansible/roles/senlin/templates/senlin-engine.json.j218
-rw-r--r--ansible/roles/senlin/templates/senlin.conf.j241
16 files changed, 0 insertions, 391 deletions
diff --git a/ansible/roles/senlin/defaults/main.yml b/ansible/roles/senlin/defaults/main.yml
deleted file mode 100644
index 811ad25c7..000000000
--- a/ansible/roles/senlin/defaults/main.yml
+++ /dev/null
@@ -1,35 +0,0 @@
----
-project_name: "senlin"
-
-####################
-# Database
-####################
-senlin_database_name: "senlin"
-senlin_database_user: "senlin"
-senlin_database_address: "{{ kolla_internal_fqdn }}:{{ database_port }}"
-
-
-####################
-# Docker
-####################
-senlin_engine_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-senlin-engine"
-senlin_engine_tag: "{{ openstack_release }}"
-senlin_engine_image_full: "{{ senlin_engine_image }}:{{ senlin_engine_tag }}"
-
-senlin_api_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ kolla_install_type }}-senlin-api"
-senlin_api_tag: "{{ openstack_release }}"
-senlin_api_image_full: "{{ senlin_api_image }}:{{ senlin_api_tag }}"
-
-
-####################
-# OpenStack
-####################
-senlin_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ senlin_api_port }}"
-senlin_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ senlin_api_port }}"
-senlin_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ senlin_api_port }}"
-
-senlin_logging_debug: "{{ openstack_logging_debug }}"
-
-senlin_keystone_user: "senlin"
-
-openstack_senlin_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/senlin/meta/main.yml b/ansible/roles/senlin/meta/main.yml
deleted file mode 100644
index 6b4fff8fe..000000000
--- a/ansible/roles/senlin/meta/main.yml
+++ /dev/null
@@ -1,3 +0,0 @@
----
-dependencies:
- - { role: common }
diff --git a/ansible/roles/senlin/tasks/bootstrap.yml b/ansible/roles/senlin/tasks/bootstrap.yml
deleted file mode 100644
index 95a599b17..000000000
--- a/ansible/roles/senlin/tasks/bootstrap.yml
+++ /dev/null
@@ -1,41 +0,0 @@
----
-- name: Creating Senlin 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='{{ senlin_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['senlin-api'][0] }}"
-
-- name: Reading json from variable
- set_fact:
- database_created: "{{ (database.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
-
-- name: Creating Senlin 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='{{ senlin_database_name }}'
- password='{{ senlin_database_password }}'
- host='%'
- priv='{{ senlin_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['senlin-api'][0] }}"
-
-- include: bootstrap_service.yml
- when: database_created
diff --git a/ansible/roles/senlin/tasks/bootstrap_service.yml b/ansible/roles/senlin/tasks/bootstrap_service.yml
deleted file mode 100644
index ff3504d95..000000000
--- a/ansible/roles/senlin/tasks/bootstrap_service.yml
+++ /dev/null
@@ -1,20 +0,0 @@
----
-- name: Running Senlin bootstrap container
- kolla_docker:
- action: "start_container"
- common_options: "{{ docker_common_options }}"
- detach: False
- environment:
- KOLLA_BOOTSTRAP:
- KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}"
- image: "{{ senlin_api_image_full }}"
- labels:
- BOOTSTRAP:
- name: "bootstrap_senlin"
- restart_policy: "never"
- volumes:
- - "{{ node_config_directory }}/senlin-api/:{{ container_config_directory }}/:ro"
- - "/etc/localtime:/etc/localtime:ro"
- - "kolla_logs:/var/log/kolla/"
- run_once: True
- delegate_to: "{{ groups['senlin-api'][0] }}"
diff --git a/ansible/roles/senlin/tasks/config.yml b/ansible/roles/senlin/tasks/config.yml
deleted file mode 100644
index 54773529b..000000000
--- a/ansible/roles/senlin/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:
- - "senlin-api"
- - "senlin-engine"
-
-- name: Copying over config.json files for services
- template:
- src: "{{ item }}.json.j2"
- dest: "{{ node_config_directory }}/{{ item }}/config.json"
- with_items:
- - "senlin-api"
- - "senlin-engine"
-
-- name: Copying over senlin.conf
- merge_configs:
- vars:
- service_name: "{{ item }}"
- sources:
- - "{{ role_path }}/templates/senlin.conf.j2"
- - "{{ node_custom_config }}/global.conf"
- - "{{ node_custom_config }}/database.conf"
- - "{{ node_custom_config }}/messaging.conf"
- - "{{ node_custom_config }}/senlin.conf"
- - "{{ node_custom_config }}/senlin/{{ item }}.conf"
- - "{{ node_custom_config }}/senlin/{{ inventory_hostname }}/senlin.conf"
- dest: "{{ node_config_directory }}/{{ item }}/senlin.conf"
- with_items:
- - "senlin-api"
- - "senlin-engine"
-
-- name: Check if policies shall be overwritten
- local_action: stat path="{{ node_custom_config }}/senlin/policy.json"
- register: senlin_policy
-
-- name: Copying over existing policy.json
- template:
- src: "{{ node_custom_config }}/senlin/policy.json"
- dest: "{{ node_config_directory }}/{{ item }}/policy.json"
- with_items:
- - "senlin-api"
- - "senlin-engine"
- when:
- senlin_policy.stat.exists
diff --git a/ansible/roles/senlin/tasks/deploy.yml b/ansible/roles/senlin/tasks/deploy.yml
deleted file mode 100644
index 46aedd6e1..000000000
--- a/ansible/roles/senlin/tasks/deploy.yml
+++ /dev/null
@@ -1,14 +0,0 @@
----
-- include: register.yml
- when: inventory_hostname in groups['senlin-api']
-
-- include: config.yml
- when: inventory_hostname in groups['senlin-api'] or
- inventory_hostname in groups['senlin-engine']
-
-- include: bootstrap.yml
- when: inventory_hostname in groups['senlin-api']
-
-- include: start.yml
- when: inventory_hostname in groups['senlin-api'] or
- inventory_hostname in groups['senlin-engine']
diff --git a/ansible/roles/senlin/tasks/main.yml b/ansible/roles/senlin/tasks/main.yml
deleted file mode 100644
index b017e8b4a..000000000
--- a/ansible/roles/senlin/tasks/main.yml
+++ /dev/null
@@ -1,2 +0,0 @@
----
-- include: "{{ action }}.yml"
diff --git a/ansible/roles/senlin/tasks/precheck.yml b/ansible/roles/senlin/tasks/precheck.yml
deleted file mode 100644
index ed97d539c..000000000
--- a/ansible/roles/senlin/tasks/precheck.yml
+++ /dev/null
@@ -1 +0,0 @@
----
diff --git a/ansible/roles/senlin/tasks/pull.yml b/ansible/roles/senlin/tasks/pull.yml
deleted file mode 100644
index 3a21aee05..000000000
--- a/ansible/roles/senlin/tasks/pull.yml
+++ /dev/null
@@ -1,14 +0,0 @@
----
-- name: Pulling senlin-api image
- kolla_docker:
- action: "pull_image"
- common_options: "{{ docker_common_options }}"
- image: "{{ senlin_api_image_full }}"
- when: inventory_hostname in groups['senlin-api']
-
-- name: Pulling senlin-engine image
- kolla_docker:
- action: "pull_image"
- common_options: "{{ docker_common_options }}"
- image: "{{ senlin_engine_image_full }}"
- when: inventory_hostname in groups['senlin-engine']
diff --git a/ansible/roles/senlin/tasks/reconfigure.yml b/ansible/roles/senlin/tasks/reconfigure.yml
deleted file mode 100644
index ffd25dc39..000000000
--- a/ansible/roles/senlin/tasks/reconfigure.yml
+++ /dev/null
@@ -1,66 +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: senlin_api, group: senlin-api }
- - { name: senlin_engine, group: senlin-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: senlin_api, group: senlin-api }
- - { name: senlin_engine, group: senlin-engine }
-
-- 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: senlin_api, group: senlin-api }
- - { name: senlin_engine, group: senlin-engine }
-
-- name: Remove the containers
- kolla_docker:
- name: "{{ item[0]['name'] }}"
- action: "remove_container"
- register: remove_containers
- when:
- - config_strategy == "COPY_ONCE" or item[1]['KOLLA_CONFIG_STRATEGY'] == 'COPY_ONCE'
- - item[2]['rc'] == 1
- - inventory_hostname in groups[item[0]['group']]
- with_together:
- - [{ name: senlin_api, group: senlin-api },
- { name: senlin_engine, group: senlin-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:
- - config_strategy == 'COPY_ALWAYS'
- - item[1]['KOLLA_CONFIG_STRATEGY'] != 'COPY_ONCE'
- - item[2]['rc'] == 1
- - inventory_hostname in groups[item[0]['group']]
- with_together:
- - [{ name: senlin_api, group: senlin-api },
- { name: senlin_engine, group: senlin-engine }]
- - "{{ container_envs.results }}"
- - "{{ check_results.results }}"
diff --git a/ansible/roles/senlin/tasks/register.yml b/ansible/roles/senlin/tasks/register.yml
deleted file mode 100644
index c9d0185f4..000000000
--- a/ansible/roles/senlin/tasks/register.yml
+++ /dev/null
@@ -1,40 +0,0 @@
----
-- name: Creating the Senlin service and endpoint
- command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
- -m kolla_keystone_service
- -a "service_name=senlin
- service_type=clustering
- description='Senlin Clustering Service'
- endpoint_region={{ openstack_region_name }}
- url='{{ item.url }}'
- interface='{{ item.interface }}'
- region_name={{ openstack_region_name }}
- auth={{ '{{ openstack_senlin_auth }}' }}"
- -e "{'openstack_senlin_auth':{{ openstack_senlin_auth }}}"
- register: senlin_endpoint
- changed_when: "{{ senlin_endpoint.stdout.find('localhost | SUCCESS => ') != -1 and (senlin_endpoint.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
- until: senlin_endpoint.stdout.split()[2] == 'SUCCESS'
- retries: 10
- delay: 5
- run_once: True
- with_items:
- - {'interface': 'admin', 'url': '{{ senlin_admin_endpoint }}'}
- - {'interface': 'internal', 'url': '{{ senlin_internal_endpoint }}'}
- - {'interface': 'public', 'url': '{{ senlin_public_endpoint }}'}
-
-- name: Creating the Senlin project, user, and role
- command: docker exec -t kolla_toolbox /usr/bin/ansible localhost
- -m kolla_keystone_user
- -a "project=service
- user=senlin
- password={{ senlin_keystone_password }}
- role=admin
- region_name={{ openstack_region_name }}
- auth={{ '{{ openstack_senlin_auth }}' }}"
- -e "{'openstack_senlin_auth':{{ openstack_senlin_auth }}}"
- register: senlin_user
- changed_when: "{{ senlin_user.stdout.find('localhost | SUCCESS => ') != -1 and (senlin_user.stdout.split('localhost | SUCCESS => ')[1]|from_json).changed }}"
- until: senlin_user.stdout.split()[2] == 'SUCCESS'
- retries: 10
- delay: 5
- run_once: True
diff --git a/ansible/roles/senlin/tasks/start.yml b/ansible/roles/senlin/tasks/start.yml
deleted file mode 100644
index f539bb3cd..000000000
--- a/ansible/roles/senlin/tasks/start.yml
+++ /dev/null
@@ -1,24 +0,0 @@
----
-- name: Starting senlin-engine container
- kolla_docker:
- action: "start_container"
- common_options: "{{ docker_common_options }}"
- image: "{{ senlin_engine_image_full }}"
- name: "senlin_engine"
- volumes:
- - "{{ node_config_directory }}/senlin-engine/:{{ container_config_directory }}/:ro"
- - "/etc/localtime:/etc/localtime:ro"
- - "kolla_logs:/var/log/kolla/"
- when: inventory_hostname in groups['senlin-engine']
-
-- name: Starting senlin-api container
- kolla_docker:
- action: "start_container"
- common_options: "{{ docker_common_options }}"
- image: "{{ senlin_api_image_full }}"
- name: "senlin_api"
- volumes:
- - "{{ node_config_directory }}/senlin-api/:{{ container_config_directory }}/:ro"
- - "/etc/localtime:/etc/localtime:ro"
- - "kolla_logs:/var/log/kolla/"
- when: inventory_hostname in groups['senlin-api']
diff --git a/ansible/roles/senlin/tasks/upgrade.yml b/ansible/roles/senlin/tasks/upgrade.yml
deleted file mode 100644
index 308053080..000000000
--- a/ansible/roles/senlin/tasks/upgrade.yml
+++ /dev/null
@@ -1,6 +0,0 @@
----
-- include: config.yml
-
-- include: bootstrap_service.yml
-
-- include: start.yml
diff --git a/ansible/roles/senlin/templates/senlin-api.json.j2 b/ansible/roles/senlin/templates/senlin-api.json.j2
deleted file mode 100644
index 0e287719b..000000000
--- a/ansible/roles/senlin/templates/senlin-api.json.j2
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "command": "senlin-api --config-file /etc/senlin/senlin.conf",
- "config_files": [
- {
- "source": "{{ container_config_directory }}/senlin.conf",
- "dest": "/etc/senlin/senlin.conf",
- "owner": "senlin",
- "perm": "0600"
- }
- ],
- "permissions": [
- {
- "path": "/var/log/kolla/senlin",
- "owner": "senlin:senlin",
- "recurse": true
- }
- ]
-}
diff --git a/ansible/roles/senlin/templates/senlin-engine.json.j2 b/ansible/roles/senlin/templates/senlin-engine.json.j2
deleted file mode 100644
index bc643475e..000000000
--- a/ansible/roles/senlin/templates/senlin-engine.json.j2
+++ /dev/null
@@ -1,18 +0,0 @@
-{
- "command": "senlin-engine --config-file /etc/senlin/senlin.conf",
- "config_files": [
- {
- "source": "{{ container_config_directory }}/senlin.conf",
- "dest": "/etc/senlin/senlin.conf",
- "owner": "senlin",
- "perm": "0600"
- }
- ],
- "permissions": [
- {
- "path": "/var/log/kolla/senlin",
- "owner": "senlin:senlin",
- "recurse": true
- }
- ]
-}
diff --git a/ansible/roles/senlin/templates/senlin.conf.j2 b/ansible/roles/senlin/templates/senlin.conf.j2
deleted file mode 100644
index 6018444d2..000000000
--- a/ansible/roles/senlin/templates/senlin.conf.j2
+++ /dev/null
@@ -1,41 +0,0 @@
-[DEFAULT]
-debug = {{ senlin_logging_debug }}
-
-log_dir = /var/log/kolla/senlin
-
-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 %}
-
-{% if service_name == 'senlin-api' %}
-[senlin_api]
-bind_host = {{ api_interface_address }}
-bind_port = {{ senlin_api_port }}
-{% endif %}
-
-[authentication]
-auth_url = {{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_admin_port }}
-service_username = {{ senlin_keystone_user }}
-service_password = {{ senlin_keystone_password }}
-service_project_name = service
-service_user_domain = default
-service_project_domain = default
-
-[database]
-connection = mysql+pymysql://{{ senlin_database_user }}:{{ senlin_database_password }}@{{ senlin_database_address }}/{{ senlin_database_name }}
-max_retries = -1
-
-[keystone_authtoken]
-auth_uri = {{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_public_port }}
-auth_url = {{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ keystone_admin_port }}
-auth_type = password
-project_domain_id = default
-user_domain_id = default
-project_name = service
-username = {{ senlin_keystone_user }}
-password = {{ senlin_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_notifications]
-driver = noop