forked from openstack/kolla-ansible
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
38 changed files
with
678 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
"/var/log/kolla/cyborg/*.log" | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
--- | ||
project_name: "cyborg" | ||
|
||
cyborg_services: | ||
cyborg-api: | ||
container_name: cyborg_api | ||
group: cyborg-api | ||
enabled: true | ||
image: "{{ cyborg_api_image_full }}" | ||
volumes: | ||
- "{{ node_config_directory }}/cyborg-api/:{{ container_config_directory }}/:ro" | ||
- "/etc/localtime:/etc/localtime:ro" | ||
- "cyborg:/var/lib/cyborg/" | ||
- "kolla_logs:/var/log/kolla/" | ||
dimensions: "{{ cyborg_api_dimensions }}" | ||
cyborg-agent: | ||
container_name: cyborg_agent | ||
group: cyborg-agent | ||
enabled: true | ||
image: "{{ cyborg_agent_image_full }}" | ||
volumes: | ||
- "{{ node_config_directory }}/cyborg-agent/:{{ container_config_directory }}/:ro" | ||
- "/etc/localtime:/etc/localtime:ro" | ||
- "kolla_logs:/var/log/kolla/" | ||
dimensions: "{{ cyborg_agent_dimensions }}" | ||
cyborg-conductor: | ||
container_name: cyborg_conductor | ||
group: cyborg-conductor | ||
enabled: true | ||
image: "{{ cyborg_conductor_image_full }}" | ||
volumes: | ||
- "{{ node_config_directory }}/cyborg-conductor/:{{ container_config_directory }}/:ro" | ||
- "/etc/localtime:/etc/localtime:ro" | ||
- "kolla_logs:/var/log/kolla/" | ||
dimensions: "{{ cyborg_conductor_dimensions }}" | ||
|
||
#################### | ||
# Database | ||
#################### | ||
cyborg_database_name: "cyborg" | ||
cyborg_database_user: "{% if use_preconfigured_databases | bool and use_common_mariadb_user | bool %}{{ database_user }}{% else %}cyborg{% endif %}" | ||
cyborg_database_address: "{{ database_address }}:{{ database_port }}" | ||
|
||
#################### | ||
# Docker | ||
#################### | ||
cyborg_install_type: "{{ kolla_install_type }}" | ||
cyborg_tag: "{{ openstack_release }}" | ||
|
||
cyborg_api_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ cyborg_install_type }}-cyborg-api" | ||
cyborg_api_tag: "{{ cyborg_tag }}" | ||
cyborg_api_image_full: "{{ cyborg_api_image }}:{{ cyborg_api_tag }}" | ||
|
||
cyborg_agent_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ cyborg_install_type }}-cyborg-agent" | ||
cyborg_agent_tag: "{{ cyborg_tag }}" | ||
cyborg_agent_image_full: "{{ cyborg_agent_image }}:{{ cyborg_agent_tag }}" | ||
|
||
cyborg_conductor_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/{{ kolla_base_distro }}-{{ cyborg_install_type }}-cyborg-conductor" | ||
cyborg_conductor_tag: "{{ cyborg_tag }}" | ||
cyborg_conductor_image_full: "{{ cyborg_conductor_image }}:{{ cyborg_conductor_tag }}" | ||
|
||
cyborg_api_dimensions: "{{ default_container_dimensions }}" | ||
cyborg_agent_dimensions: "{{ default_container_dimensions }}" | ||
cyborg_conductor_dimensions: "{{ default_container_dimensions }}" | ||
|
||
#################### | ||
# OpenStack | ||
#################### | ||
cyborg_admin_endpoint: "{{ admin_protocol }}://{{ kolla_internal_fqdn }}:{{ cyborg_api_port }}" | ||
cyborg_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn }}:{{ cyborg_api_port }}" | ||
cyborg_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn }}:{{ cyborg_api_port }}" | ||
|
||
cyborg_logging_debug: "{{ openstack_logging_debug }}" | ||
|
||
cyborg_keystone_user: "cyborg" | ||
|
||
openstack_cyborg_auth: "{{ openstack_auth }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
--- | ||
- name: Restart cyborg-api container | ||
vars: | ||
service_name: "cyborg-api" | ||
service: "{{ cyborg_services[service_name] }}" | ||
config_json: "{{ cyborg_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" | ||
cyborg_conf: "{{ cyborg_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" | ||
policy_overwriting: "{{ cyborg_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" | ||
cyborg_api_container: "{{ check_cyborg_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" | ||
kolla_docker: | ||
action: "recreate_or_restart_container" | ||
common_options: "{{ docker_common_options }}" | ||
name: "{{ service.container_name }}" | ||
image: "{{ service.image }}" | ||
volumes: "{{ service.volumes }}" | ||
dimensions: "{{ service.dimensions }}" | ||
when: | ||
- action != "config" | ||
- inventory_hostname in groups[service.group] | ||
- service.enabled | bool | ||
- config_json.changed | bool | ||
or cyborg_conf.changed | bool | ||
or policy_overwriting.changed | bool | ||
or cyborg_api_container.changed | bool | ||
|
||
- name: Restart cyborg-conductor container | ||
vars: | ||
service_name: "cyborg-conductor" | ||
service: "{{ cyborg_services[service_name] }}" | ||
config_json: "{{ cyborg_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" | ||
cyborg_conf: "{{ cyborg_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" | ||
policy_overwriting: "{{ cyborg_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" | ||
cyborg_conductor_container: "{{ check_cyborg_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" | ||
kolla_docker: | ||
action: "recreate_or_restart_container" | ||
common_options: "{{ docker_common_options }}" | ||
name: "{{ service.container_name }}" | ||
image: "{{ service.image }}" | ||
volumes: "{{ service.volumes }}" | ||
dimensions: "{{ service.dimensions }}" | ||
when: | ||
- action != "config" | ||
- inventory_hostname in groups[service.group] | ||
- service.enabled | bool | ||
- config_json.changed | bool | ||
or cyborg_conf.changed | bool | ||
or policy_overwriting.changed | bool | ||
or cyborg_conductor_container.changed | bool | ||
|
||
- name: Restart cyborg-agent container | ||
vars: | ||
service_name: "cyborg-agent" | ||
service: "{{ cyborg_services[service_name] }}" | ||
config_json: "{{ cyborg_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}" | ||
cyborg_conf: "{{ cyborg_confs.results|selectattr('item.key', 'equalto', service_name)|first }}" | ||
policy_overwriting: "{{ cyborg_policy_overwriting.results|selectattr('item.key', 'equalto', service_name)|first }}" | ||
cyborg_agent_container: "{{ check_cyborg_containers.results|selectattr('item.key', 'equalto', service_name)|first }}" | ||
kolla_docker: | ||
action: "recreate_or_restart_container" | ||
common_options: "{{ docker_common_options }}" | ||
name: "{{ service.container_name }}" | ||
image: "{{ service.image }}" | ||
volumes: "{{ service.volumes }}" | ||
dimensions: "{{ service.dimensions }}" | ||
when: | ||
- action != "config" | ||
- inventory_hostname in groups[service.group] | ||
- service.enabled | bool | ||
- config_json.changed | bool | ||
or cyborg_conf.changed | bool | ||
or policy_overwriting.changed | bool | ||
or cyborg_agent_container.changed | bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
dependencies: | ||
- { role: common } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
- name: Creating cyborg database | ||
kolla_toolbox: | ||
module_name: mysql_db | ||
module_args: | ||
login_host: "{{ database_address }}" | ||
login_port: "{{ database_port }}" | ||
login_user: "{{ database_user }}" | ||
login_password: "{{ database_password }}" | ||
name: "{{ cyborg_database_name }}" | ||
register: database | ||
run_once: True | ||
delegate_to: "{{ groups['cyborg-api'][0] }}" | ||
when: | ||
- not use_preconfigured_databases | bool | ||
|
||
- name: Creating cyborg database user and setting permissions | ||
kolla_toolbox: | ||
module_name: mysql_user | ||
module_args: | ||
login_host: "{{ database_address }}" | ||
login_port: "{{ database_port }}" | ||
login_user: "{{ database_user }}" | ||
login_password: "{{ database_password }}" | ||
name: "{{ cyborg_database_user }}" | ||
password: "{{ cyborg_database_password }}" | ||
host: "%" | ||
priv: "{{ cyborg_database_name }}.*:ALL" | ||
append_privs: "yes" | ||
run_once: True | ||
delegate_to: "{{ groups['cyborg-api'][0] }}" | ||
when: | ||
- not use_preconfigured_databases | bool | ||
|
||
- include_tasks: bootstrap_service.yml | ||
when: database.changed or use_preconfigured_databases | bool |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
- name: Running cyborg bootstrap container | ||
vars: | ||
cyborg_api: "{{ cyborg_services['cyborg-api'] }}" | ||
kolla_docker: | ||
action: "start_container" | ||
common_options: "{{ docker_common_options }}" | ||
detach: False | ||
environment: | ||
KOLLA_BOOTSTRAP: | ||
KOLLA_CONFIG_STRATEGY: "{{ config_strategy }}" | ||
image: "{{ cyborg_api.image }}" | ||
labels: | ||
BOOTSTRAP: | ||
name: "bootstrap_cyborg" | ||
restart_policy: "never" | ||
volumes: "{{ cyborg_api.volumes }}" | ||
run_once: True | ||
delegate_to: "{{ groups[cyborg_api.group][0] }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
- name: Cloning cyborg source repository for development | ||
git: | ||
repo: "{{ cyborg_git_repository }}" | ||
dest: "{{ kolla_dev_repos_directory }}/{{ project_name }}" | ||
update: "{{ cyborg_dev_repos_pull }}" | ||
version: "{{ cyborg_source_version }}" |
Oops, something went wrong.