Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add TripleO requirements playbook #637

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ test-with-ceph: ## Launch test suite with ceph
mkdir -p tests/logs
ANSIBLE_CONFIG=$(TEST_CONFIG) ansible-playbook -v -i $(TEST_INVENTORY) -e @$(TEST_VARS) -e @$(TEST_SECRETS) $(TEST_ARGS) tests/playbooks/test_with_ceph.yaml 2>&1 | tee $(TEST_OUTFILE)

test-tripleo-requirements: TEST_OUTFILE := tests/logs/test_tripleo_requirements_out_$(shell date +%FT%T%Z).log
test-tripleo-requirements: ## Launch test suite related to the ceph migration
mkdir -p tests/logs
ANSIBLE_CONFIG=$(TEST_CONFIG) ansible-playbook -v -i $(TEST_INVENTORY) -e @$(TEST_VARS) -e @$(TEST_CEPH_OVERRIDES) -e @$(TEST_SECRETS) $(TEST_ARGS) tests/playbooks/test_tripleo_adoption_requirements.yaml 2>&1 | tee $(TEST_OUTFILE)

test-ceph-migration: TEST_OUTFILE := tests/logs/test_ceph_migration_out_$(shell date +%FT%T%Z).log
test-ceph-migration: ## Launch test suite related to the ceph migration
mkdir -p tests/logs
Expand Down
43 changes: 43 additions & 0 deletions tests/playbooks/test_tripleo_adoption_requirements.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
- name: TripleO adoption requirements
hosts: "{{ groups['overcloud'][0] | default([]) }}"
gather_facts: true
tasks:
# Propagate StorageNFS network
- name: Propagate Storage NFS network
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe I can put a condition to skip this in case we want to execute against a standalone environment.

when:
- manila_adoption | default(false)
- (manila_backend | default("cephfs")) == "cephnfs"
block:
- name: Load Ceph data
when:
- manila_adoption | default(false)
- (manila_backend | default("cephfs")) == "cephnfs"
ansible.builtin.import_role:
name: ceph_migrate
tasks_from: ceph_load
tags:
- ceph_load
- manila_adoption

- name: Propagate Storage NFS network
when:
- target_nodes | default([]) | length > 0
ansible.builtin.include_role:
name: ceph_migrate
tasks_from: propagate_storage_nfs
loop: "{{ target_nodes }}"
tags:
- manila_adoption

# Create the Ceph-NFS cluster
- name: Create a ceph nfs cluster
when:
- manila_adoption | default(false)
- (manila_backend | default("cephfs")) == "cephnfs"
- ceph_nfs_vip is defined
- ceph_nfs_vip | ansible.util.ipaddr
ansible.builtin.include_role:
name: ceph_migrate
tasks_from: nfs
tags:
- manila_adoption
2 changes: 2 additions & 0 deletions tests/roles/ceph_migrate/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ ceph_alertmanager_container_image: "quay.io/prometheus/alertmanager:v0.25.0"
ceph_grafana_container_image: "quay.io/ceph/ceph-grafana:9.4.7"
ceph_node_exporter_container_image: "quay.io/prometheus/node-exporter:v1.5.0"
ceph_prometheus_container_image: "quay.io/prometheus/prometheus:v2.43.0"
ceph_storagenfs_nic: "nic2"
ceph_storagenfs_vlan_id: "70"
23 changes: 23 additions & 0 deletions tests/roles/ceph_migrate/tasks/propagate_storage_nfs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
- name: Patch net-config config and add the IP address (target node)
when:
- ceph_storagenfs_ipaddr is defined
- ceph_storagenfs_ipaddr | ansible.builtin.ipaddr
delegate_to: "{{ target_node }}"
become: true
ansible.builtin.blockinfile:
marker_begin: "BEGIN storageNFS network"
marker_end: "END storageNFS network"
path: "{{ os_net_conf_path }}"
block: |
- type: vlan
device: {{ ceph_storagenfs_nic }}
vlan_id: {{ ceph_storagenfs_vlan_id }}
addresses:
- ip_netmask: {{ ceph_storagenfs_ipaddr }}/24
routes: []

- name: Refresh os-net-config (target_node)
become: true
delegate_to: "{{ target_node }}"
ansible.builtin.command:
"os-net-config -c {{ os_net_conf_path }}"
3 changes: 3 additions & 0 deletions tests/roles/manila_adoption/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# manila_backend can be 'cephfs' or 'cephnfs'
manila_backend: cephfs
os_net_conf_path: "/etc/os-net-config/config.yaml"
manila_storagenfs_nic: "nic2"
manila_storagenfs_vlan_id: "70"
Loading