Skip to content

Commit

Permalink
Merge branch 'stackhpc/2023.1' into upstream/2023.1-2024-10-07
Browse files Browse the repository at this point in the history
  • Loading branch information
priteau authored Oct 7, 2024
2 parents 990d94c + 3943897 commit 54c3963
Show file tree
Hide file tree
Showing 172 changed files with 2,292 additions and 241 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @stackhpc/kayobe
12 changes: 12 additions & 0 deletions .github/workflows/tag-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
name: Tag & Release
'on':
push:
branches:
- stackhpc/2023.1
permissions:
actions: read
contents: write
jobs:
tag-and-release:
uses: stackhpc/.github/.github/workflows/tag-and-release.yml@main
7 changes: 7 additions & 0 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
name: Tox Continuous Integration
'on':
pull_request:
jobs:
tox:
uses: stackhpc/.github/.github/workflows/tox.yml@main
2 changes: 2 additions & 0 deletions ansible/filter_plugins/address.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
# limitations under the License.

from kolla_ansible.kolla_address import kolla_address
from kolla_ansible.kolla_url import kolla_url
from kolla_ansible.put_address_in_context import put_address_in_context


Expand All @@ -24,5 +25,6 @@ class FilterModule(object):
def filters(self):
return {
'kolla_address': kolla_address,
'kolla_url': kolla_url,
'put_address_in_context': put_address_in_context,
}
202 changes: 165 additions & 37 deletions ansible/group_vars/all.yml

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions ansible/inventory/all-in-one
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ localhost ansible_connection=local
[deployment]
localhost ansible_connection=local

# Caso
[caso:children]
monitoring

# You can explicitly specify which hosts run each project by updating the
# groups in the sections below. Common services are grouped together.

Expand Down Expand Up @@ -210,6 +214,9 @@ control
[venus:children]
monitoring

[letsencrypt:children]
loadbalancer

# Additional control implemented here. These groups allow you to control which
# services run on which hosts at a per-service level.
#
Expand Down Expand Up @@ -741,3 +748,9 @@ venus

[venus-manager:children]
venus

[letsencrypt-webserver:children]
letsencrypt

[letsencrypt-lego:children]
letsencrypt
13 changes: 13 additions & 0 deletions ansible/inventory/multinode
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ monitoring
[tls-backend:children]
control

# Caso
[caso:children]
monitoring

# You can explicitly specify which hosts run each project by updating the
# groups in the sections below. Common services are grouped together.

Expand Down Expand Up @@ -228,6 +232,9 @@ control
[venus:children]
monitoring

[letsencrypt:children]
loadbalancer

# Additional control implemented here. These groups allow you to control which
# services run on which hosts at a per-service level.
#
Expand Down Expand Up @@ -760,3 +767,9 @@ venus

[venus-manager:children]
venus

[letsencrypt-webserver:children]
letsencrypt

[letsencrypt-lego:children]
letsencrypt
7 changes: 4 additions & 3 deletions ansible/roles/aodh/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ aodh_services:
enabled: "{{ enable_aodh }}"
mode: "http"
external: true
port: "{{ aodh_api_port }}"
external_fqdn: "{{ aodh_external_fqdn }}"
port: "{{ aodh_api_public_port }}"
listen_port: "{{ aodh_api_listen_port }}"
aodh-evaluator:
container_name: aodh_evaluator
Expand Down Expand Up @@ -207,8 +208,8 @@ aodh_notifier_extra_volumes: "{{ aodh_extra_volumes }}"
####################
# OpenStack
####################
aodh_internal_endpoint: "{{ internal_protocol }}://{{ aodh_internal_fqdn | put_address_in_context('url') }}:{{ aodh_api_port }}"
aodh_public_endpoint: "{{ public_protocol }}://{{ aodh_external_fqdn | put_address_in_context('url') }}:{{ aodh_api_port }}"
aodh_internal_endpoint: "{{ aodh_internal_fqdn | kolla_url(internal_protocol, aodh_api_port) }}"
aodh_public_endpoint: "{{ aodh_external_fqdn | kolla_url(public_protocol, aodh_api_public_port) }}"

aodh_logging_debug: "{{ openstack_logging_debug }}"

Expand Down
3 changes: 2 additions & 1 deletion ansible/roles/barbican/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ barbican_services:
enabled: "{{ enable_barbican }}"
mode: "http"
external: true
port: "{{ barbican_api_port }}"
external_fqdn: "{{ barbican_external_fqdn }}"
port: "{{ barbican_api_public_port }}"
listen_port: "{{ barbican_api_listen_port }}"
tls_backend: "{{ barbican_enable_tls_backend }}"
barbican-keystone-listener:
Expand Down
9 changes: 6 additions & 3 deletions ansible/roles/blazar/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ blazar_services:
mode: "http"
external: false
port: "{{ blazar_api_port }}"
listen_port: "{{ blazar_api_listen_port }}"
blazar_api_external:
enabled: "{{ enable_blazar }}"
mode: "http"
external: true
port: "{{ blazar_api_port }}"
external_fqdn: "{{ blazar_external_fqdn }}"
port: "{{ blazar_api_public_port }}"
listen_port: "{{ blazar_api_listen_port }}"
blazar-manager:
container_name: blazar_manager
group: blazar-manager
Expand Down Expand Up @@ -126,8 +129,8 @@ blazar_manager_extra_volumes: "{{ blazar_extra_volumes }}"
####################
# OpenStack
####################
blazar_internal_endpoint: "{{ internal_protocol }}://{{ kolla_internal_fqdn | put_address_in_context('url') }}:{{ blazar_api_port }}/v1"
blazar_public_endpoint: "{{ public_protocol }}://{{ kolla_external_fqdn | put_address_in_context('url') }}:{{ blazar_api_port }}/v1"
blazar_internal_endpoint: "{{ blazar_internal_fqdn | kolla_url(internal_protocol, blazar_api_port, '/v1') }}"
blazar_public_endpoint: "{{ blazar_external_fqdn | kolla_url(public_protocol, blazar_api_public_port, '/v1') }}"

blazar_logging_debug: "{{ openstack_logging_debug }}"

Expand Down
47 changes: 47 additions & 0 deletions ansible/roles/caso/defaults/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
caso_services:
caso:
container_name: caso
group: caso
enabled: true
image: "{{ caso_image_full }}"
volumes:
- "{{ node_config_directory }}/caso/:{{ container_config_directory }}/"
- "/etc/localtime:/etc/localtime:ro"
- "caso_spool:/var/lib/caso"
- "caso_ssm_outgoing:/var/spool/apel/outgoing/openstack"
- "kolla_logs:/var/log/kolla/"
dimensions: "{{ caso_dimensions }}"

####################
# caso
####################
caso_site_name: "kolla_caso"
caso_logging_debug: "{{ openstack_logging_debug }}"
caso_log_dir: "/var/log/kolla/caso"
caso_cron_table: "10 * * * *"
caso_messengers:
- caso.messenger.logstash.LogstashMessenger

####################
# OpenStack
####################
caso_openstack_auth: "{{ openstack_auth }}"
caso_keystone_user: "caso"
caso_projects: []
caso_ks_users_tmpl: >
{%- for project in caso_projects -%}
- project: "{{ project }}"
user: "{{ caso_keystone_user }}"
password: "{{ caso_keystone_password }}"
role: "admin"
{% endfor %}
caso_ks_users: "{{ caso_ks_users_tmpl | from_yaml if caso_projects else [] }}"

####################
# Docker
####################
caso_image: "{{ docker_registry ~ '/' if docker_registry else '' }}{{ docker_namespace }}/caso"
caso_tag: "{{ openstack_tag }}"
caso_image_full: "{{ caso_image }}:{{ caso_tag }}"
caso_dimensions: "{{ default_container_dimensions }}"
24 changes: 24 additions & 0 deletions ansible/roles/caso/handlers/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
- name: Restart caso container
vars:
service_name: "caso"
service: "{{ caso_services[service_name] }}"
config_json: "{{ caso_config_jsons.results|selectattr('item.key', 'equalto', service_name)|first }}"
caso_container: "{{ check_caso_containers.results|selectattr('item.key', 'equalto', service_name)|first }}"
become: true
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:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
- service.enabled | bool
- config_json.changed | bool
or caso_conf.changed | bool
or caso_vom_conf.changed | bool
or caso_crontab.changed | bool
or caso_container.changed | bool
1 change: 1 addition & 0 deletions ansible/roles/caso/tasks/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
90 changes: 90 additions & 0 deletions ansible/roles/caso/tasks/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
---
- name: Ensuring config directories exist
file:
path: "{{ node_config_directory }}/{{ item.key }}"
state: "directory"
owner: "{{ config_owner_user }}"
group: "{{ config_owner_group }}"
mode: "0770"
become: true
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ caso_services }}"

- name: Copying over config.json files for services
template:
src: "{{ item.key }}.json.j2"
dest: "{{ node_config_directory }}/{{ item.key }}/config.json"
mode: "0660"
become: true
register: caso_config_jsons
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ caso_services }}"
notify:
- Restart caso container

- name: Copying over caso config
merge_configs:
sources:
- "{{ role_path }}/templates/caso.conf.j2"
- "{{ node_custom_config }}//caso/caso.conf"
- "{{ node_custom_config }}/{{ item.key }}/{{ inventory_hostname }}/caso.conf"
dest: "{{ node_config_directory }}/{{ item.key }}/caso.conf"
mode: "0660"
become: true
register: caso_conf
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ caso_services }}"
notify:
- Restart caso container

- name: Copying over caso crontab
template:
src: "{{ role_path }}/templates/caso.crontab.j2"
dest: "{{ node_config_directory }}/{{ item.key }}/caso.crontab"
mode: "0660"
become: true
register: caso_crontab
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ caso_services }}"
notify:
- Restart caso container

- name: Copying over caso voms file
template:
src: "{{ role_path }}/templates/voms.json.j2"
dest: "{{ node_config_directory }}/{{ item.key }}/voms.json"
mode: "0660"
become: true
register: caso_vom_conf
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ caso_services }}"
notify:
- Restart caso container

- name: Check caso containers
become: true
kolla_docker:
action: "compare_container"
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
dimensions: "{{ item.value.dimensions }}"
register: check_caso_containers
when:
- kolla_action != "config"
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ caso_services }}"
notify:
- Restart caso container
12 changes: 12 additions & 0 deletions ansible/roles/caso/tasks/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
- include_tasks: register.yml
when: inventory_hostname in groups['caso']

- include_tasks: config.yml
when: inventory_hostname in groups['caso']

- name: Flush handlers
meta: flush_handlers

- include_tasks: check.yml
when: inventory_hostname in groups['caso']
2 changes: 2 additions & 0 deletions ansible/roles/caso/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
- include_tasks: "{{ kolla_action }}.yml"
1 change: 1 addition & 0 deletions ansible/roles/caso/tasks/precheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---
11 changes: 11 additions & 0 deletions ansible/roles/caso/tasks/pull.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
- name: Pulling caso images
become: true
kolla_docker:
action: "pull_image"
common_options: "{{ docker_common_options }}"
image: "{{ item.value.image }}"
when:
- inventory_hostname in groups[item.value.group]
- item.value.enabled | bool
with_dict: "{{ caso_services }}"
2 changes: 2 additions & 0 deletions ansible/roles/caso/tasks/reconfigure.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
---
- include_tasks: deploy.yml
7 changes: 7 additions & 0 deletions ansible/roles/caso/tasks/register.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- import_role:
name: service-ks-register
vars:
service_ks_register_auth: "{{ caso_openstack_auth }}"
service_ks_register_users: "{{ caso_ks_users }}"
tags: always
5 changes: 5 additions & 0 deletions ansible/roles/caso/tasks/upgrade.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
- include_tasks: config.yml

- name: Flush handlers
meta: flush_handlers
23 changes: 23 additions & 0 deletions ansible/roles/caso/templates/caso.conf.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[DEFAULT]
messengers = {{ caso_messengers|join(', ') }}
site_name = {{ caso_site_name }}
projects = {{ caso_projects|join(', ') }}
debug = {{ caso_logging_debug }}
log_file = caso.log
log_dir = {{ caso_log_dir }}
log_rotation_type = none
spooldir = /var/lib/caso

[keystone_auth]
auth_type = password
auth_url = {{ keystone_internal_url }}
project_domain_id = {{ default_project_domain_id }}
username = {{ caso_keystone_user }}
user_domain_id = {{ default_user_domain_id }}
password = {{ caso_keystone_password }}

[logstash]
port = {{ caso_tcp_output_port }}

[ssm]
output_path = /var/spool/apel/outgoing/openstack
1 change: 1 addition & 0 deletions ansible/roles/caso/templates/caso.crontab.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{ caso_cron_table }} caso-extract --config-file /etc/caso/caso.conf
Loading

0 comments on commit 54c3963

Please sign in to comment.