aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ansible/inventory/all-in-one4
-rw-r--r--ansible/inventory/multinode10
-rw-r--r--ansible/roles/common/tasks/bootstrap.yml15
-rw-r--r--ansible/roles/logs/tasks/main.yml17
-rw-r--r--ansible/site.yml15
-rw-r--r--releasenotes/notes/kolla-logs-rename-13892296d83a41f5.yaml5
-rw-r--r--tests/templates/inventory.j210
7 files changed, 55 insertions, 21 deletions
diff --git a/ansible/inventory/all-in-one b/ansible/inventory/all-in-one
index ce3b26f16..40b2081ef 100644
--- a/ansible/inventory/all-in-one
+++ b/ansible/inventory/all-in-one
@@ -175,10 +175,10 @@ common
[fluentd:children]
common
-[kolla-logs:children]
+[kolla-toolbox:children]
common
-[kolla-toolbox:children]
+[kolla_logs:children]
common
[opensearch:children]
diff --git a/ansible/inventory/multinode b/ansible/inventory/multinode
index 40db78c1e..8cfceb890 100644
--- a/ansible/inventory/multinode
+++ b/ansible/inventory/multinode
@@ -193,12 +193,16 @@ common
[fluentd:children]
common
-[kolla-logs:children]
-common
-
[kolla-toolbox:children]
common
+[kolla_logs:children]
+control
+network
+compute
+storage
+monitoring
+
[opensearch:children]
control
diff --git a/ansible/roles/common/tasks/bootstrap.yml b/ansible/roles/common/tasks/bootstrap.yml
index 8224ced75..ed97d539c 100644
--- a/ansible/roles/common/tasks/bootstrap.yml
+++ b/ansible/roles/common/tasks/bootstrap.yml
@@ -1,16 +1 @@
---
-- name: Creating log volume
- become: true
- kolla_container:
- action: "create_volume"
- common_options: "{{ docker_common_options }}"
- name: "kolla_logs"
- when: inventory_hostname in groups['kolla-logs']
-
-- name: Link kolla_logs volume to /var/log/kolla
- become: true
- ansible.builtin.file:
- src: "{{ container_engine_volumes_path }}/kolla_logs/_data"
- path: /var/log/kolla
- state: link
- when: inventory_hostname in groups['kolla-logs']
diff --git a/ansible/roles/logs/tasks/main.yml b/ansible/roles/logs/tasks/main.yml
new file mode 100644
index 000000000..3ebc0fc44
--- /dev/null
+++ b/ansible/roles/logs/tasks/main.yml
@@ -0,0 +1,17 @@
+---
+- name: Ensure /var/log/kolla exists
+ when: kolla_action in ['deploy', 'reconfigure']
+ block:
+ - name: Ensure log volume exists
+ become: true
+ kolla_container:
+ action: "create_volume"
+ common_options: "{{ docker_common_options }}"
+ name: "kolla_logs"
+
+ - name: Ensure kolla_logs volume link to /var/log/kolla exists
+ become: true
+ ansible.builtin.file:
+ src: "{{ container_engine_volumes_path }}/kolla_logs/_data"
+ path: /var/log/kolla
+ state: link
diff --git a/ansible/site.yml b/ansible/site.yml
index f37939f37..d9318ac1c 100644
--- a/ansible/site.yml
+++ b/ansible/site.yml
@@ -83,10 +83,23 @@
roles:
- role: prechecks
+- name: Apply role logs
+ gather_facts: false
+ hosts: kolla_logs
+ serial: '{{ kolla_serial|default("0") }}'
+ max_fail_percentage: >-
+ {{ logs_max_fail_percentage |
+ default(kolla_max_fail_percentage) |
+ default(100) }}
+ tags:
+ - common
+ - logs
+ roles:
+ - logs
+
- name: Apply role common
gather_facts: false
hosts:
- - kolla-logs
- kolla-toolbox
serial: '{{ kolla_serial|default("0") }}'
max_fail_percentage: >-
diff --git a/releasenotes/notes/kolla-logs-rename-13892296d83a41f5.yaml b/releasenotes/notes/kolla-logs-rename-13892296d83a41f5.yaml
new file mode 100644
index 000000000..52b70fcbc
--- /dev/null
+++ b/releasenotes/notes/kolla-logs-rename-13892296d83a41f5.yaml
@@ -0,0 +1,5 @@
+---
+upgrade:
+ - |
+ ``kolla_logs`` role has been split from ``common`` role, please update
+ your inventory accordingly to include ``kolla_logs`` group.
diff --git a/tests/templates/inventory.j2 b/tests/templates/inventory.j2
index 0751557a3..a714860c3 100644
--- a/tests/templates/inventory.j2
+++ b/tests/templates/inventory.j2
@@ -251,12 +251,22 @@ common
[fluentd:children]
common
+{# TODO(mnasiadka) Remove in 2027.2 (after next SLURP) #}
+{% if is_upgrade | bool %}
[kolla-logs:children]
common
+{% endif %}
[kolla-toolbox:children]
common
+[kolla_logs:children]
+control
+network
+compute
+storage
+monitoring
+
[opensearch:children]
control