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

Ovs/externalids/osdiff #418

Merged
merged 8 commits into from
May 2, 2024
Merged
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
7 changes: 5 additions & 2 deletions tests/playbooks/test_minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
- role: backend_services
tags:
- backend_services
- role: pull_openstack_configuration
- role: get_services_configuration
tags:
- pull_openstack_configuration
- get_services_configuration
- role: stop_openstack_services
tags:
- stop_openstack_services
Expand Down Expand Up @@ -64,6 +64,9 @@
- role: stop_remaining_services
tags:
- stop_remaining_services
- role: pull_openstack_configuration
tags:
- pull_openstack_configuration
- role: dataplane_adoption
tags:
- dataplane_adoption
8 changes: 5 additions & 3 deletions tests/playbooks/test_rollback_minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
- role: backend_services
tags:
- backend_services
- role: pull_openstack_configuration
- role: get_services_configuration
tags:
- pull_openstack_configuration
- get_services_configuration
- role: stop_openstack_services
tags:
- stop_openstack_services
Expand Down Expand Up @@ -60,7 +60,9 @@
- role: stop_remaining_services
tags:
- stop_remaining_services

- role: pull_openstack_configuration
tags:
- pull_openstack_configuration
- role: control_plane_rollback
tags:
- control_plane_rollback
8 changes: 5 additions & 3 deletions tests/playbooks/test_rollback_with_ceph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
- role: ceph_backend_configuration
tags:
- ceph_backend_configuration
- role: pull_openstack_configuration
- role: get_services_configuration
tags:
- pull_openstack_configuration
- get_services_configuration
- role: stop_openstack_services
tags:
- stop_openstack_services
Expand Down Expand Up @@ -68,7 +68,9 @@
- role: stop_remaining_services
tags:
- stop_remaining_services

- role: pull_openstack_configuration
tags:
- pull_openstack_configuration
- role: control_plane_rollback
tags:
- control_plane_rollback
7 changes: 5 additions & 2 deletions tests/playbooks/test_with_ceph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
- role: ceph_backend_configuration
tags:
- ceph_backend_configuration
- role: pull_openstack_configuration
- role: get_services_configuration
tags:
- pull_openstack_configuration
- get_services_configuration
- role: stop_openstack_services
tags:
- stop_openstack_services
Expand Down Expand Up @@ -72,6 +72,9 @@
- role: stop_remaining_services
tags:
- stop_remaining_services
- role: pull_openstack_configuration
tags:
- pull_openstack_configuration
- role: dataplane_adoption
tags:
- dataplane_adoption
4 changes: 3 additions & 1 deletion tests/roles/dataplane_adoption/defaults/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@
{% endraw %}
neutron_physical_bridge_name: br-ctlplane
neutron_public_interface_name: "{{ dataplane_public_iface | default('eth0') }}"
edpm_sshd_allowed_ranges: "{{ ['192.168.122.0/24'] if dataplane_os_net_config_set_route|default(true)|bool else ['0.0.0.0/0'] }}"

Check warning on line 123 in tests/roles/dataplane_adoption/defaults/main.yaml

View workflow job for this annotation

GitHub Actions / Ansible Lint

jinja[spacing]

Jinja2 spacing could be improved: {{ ['192.168.122.0/24'] if dataplane_os_net_config_set_route|default(true)|bool else ['0.0.0.0/0'] }} -> {{ ['192.168.122.0/24'] if dataplane_os_net_config_set_route | default(true) | bool else ['0.0.0.0/0'] }}
edpm_neutron_sriov_agent_enabled: true
edpm_neutron_dhcp_agent_enabled: true

nova_libvirt_backend: local
# OS Diff automation steps
os_diff_dir: tmp/os-diff
os_diff_data_dir: tmp/os-diff
16 changes: 14 additions & 2 deletions tests/roles/dataplane_adoption/tasks/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
oc get -n openstack-operators pod -l app.kubernetes.io/name=openstack-ansibleee-operator -o name
register: old_ansibleee_operator_pod

- name: use ansible-runner image built from source or latest if none is defined

Check warning on line 17 in tests/roles/dataplane_adoption/tasks/main.yaml

View workflow job for this annotation

GitHub Actions / Ansible Lint

jinja[spacing]

Jinja2 spacing could be improved: {{ shell_header }}
no_log: "{{ use_no_log }}"
ansible.builtin.shell: |
{{ shell_header }}
Expand Down Expand Up @@ -228,11 +228,11 @@
playbook: osp.edpm.nova
EOF

- name: Create OpenStackDataPlaneNodeSet

Check warning on line 231 in tests/roles/dataplane_adoption/tasks/main.yaml

View workflow job for this annotation

GitHub Actions / Ansible Lint

jinja[spacing]

Jinja2 spacing could be improved: {{ shell_header }}
no_log: "{{ use_no_log }}"
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
oc apply -f - <<EOF
cat <<EOF > edpm-crd.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

This edpm-crd.yaml file is then not used anywhere below to actually create the NodeSet? I think we need an oc apply call that would use this file?

apiVersion: dataplane.openstack.org/v1beta1
kind: OpenStackDataPlaneNodeSet
metadata:
Expand Down Expand Up @@ -341,6 +341,18 @@
edpm_ovn_ofctrl_wait_before_clear: 8000
EOF

- name: check ovs external-ids with os-diff before deployment
no_log: "{{ use_no_log }}"
ansible.builtin.shell: |
{{ shell_header }}
{{ os_diff_dir }}/os-diff diff {{ os_diff_data_dir }}/tripleo/ovs_external_ids/standalone/ovs_external_ids.json edpm-crd.yaml --crd --service ovs_external_ids -f ${PWD}/{{ os_diff_dir }}/config.yaml
Copy link
Contributor

Choose a reason for hiding this comment

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

This fails as

TASK [dataplane_adoption : check ovs external-ids with os-diff before deployment] ***
fatal: [localhost]: FAILED! => {"changed": true, "cmd": "set -euxo pipefail\n\ntmp/os-diff/os-diff diff tmp/os-diff/tripleo/ovs_external_ids/standalone/ovs_external_ids.json edpm-crd.yaml --crd --service ovs_external_ids -f ${PWD}/tmp/os-diff/config.yaml\n", "delta": "0:00:00.005404", "end": "2024-05-14 12:53:42.611228", "msg": "non-zero return code", "rc": 1, "start": "2024-05-14 12:53:42.605824", "stderr": "+ tmp/os-diff/os-diff diff tmp/os-diff/tripleo/ovs_external_ids/standalone/ovs_external_ids.json edpm-crd.yaml --crd --service ovs_external_ids -f /home/ospng/data-plane-adoption/tests/playbooks/tmp/os-diff/config.yaml\nError: unknown flag: --crd\nUsage:\n os-diff diff [path1] [path2] [flags]\n\nFlags:\n --debug Enable debug.\n --file1-cmd string Remote command for the file1 configuration file.\n --file2-cmd string Remote command for the file2 configuration file.\n -h, --help help for diff\n --quiet Do not print difference on the console and use logs report, only for files comparison\n --remote Run the diff remotely.\n\nGlobal Flags:\n -c, --config string Config file (default is $PWD/config.ini) (default "os-diff.cfg")", "stderr_lines": ["+ tmp/os-diff/os-diff diff tmp/os-diff/tripleo/ovs_external_ids/standalone/ovs_external_ids.json edpm-crd.yaml --crd --service ovs_external_ids -f /home/ospng/data-plane-adoption/tests/playbooks/tmp/os-diff/config.yaml", "Error: unknown flag: --crd", "Usage:", " os-diff diff [path1] [path2] [flags]", "", "Flags:", " --debug Enable debug.", " --file1-cmd string Remote command for the file1 configuration file.", " --file2-cmd string Remote command for the file2 configuration file.", " -h, --help help for diff", " --quiet Do not print difference on the console and use logs report, only for files comparison", " --remote Run the diff remotely.", "", "Global Flags:", " -c, --config string Config file (default is $PWD/config.ini) (default "os-diff.cfg")"], "stdout": "", "stdout_lines": []}

I guess it needs to be reverted

Copy link
Contributor

Choose a reason for hiding this comment

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

What's strange though is that this PR passed CI at merge time. So perhaps we could disable the failing test if we need to, but i wouldn't revert 418 as some of the refactorings (e.g. the order in which things happen) are quite fundamental and i don't think reverting them would be necessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think we should revert this PR, the issue pointed here is because the version of os-diff used is very old: 9bfd05cafd41d46df3a0c94b5ac781b54646eea6 from Mar 1.
According to:
https://review.rdoproject.org/zuul/builds?job_name=data-plane-adoption-osp-17-to-extracted-crc&skip=0
The jobs are green, and the only red job I'm seing is not related.


- name: deploy dataplane
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
cat edpm-crd.yaml | oc apply -f -

# TODO: Apply the ceph backend config for Cinder in the original openstack CR, via kustomize
- name: prepare adopted EDPM workloads to use Ceph backend for Cinder, if configured so
no_log: "{{ use_no_log }}"
Expand Down
2 changes: 2 additions & 0 deletions tests/roles/get_services_configuration/meta/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dependencies:
- role: common_defaults
100 changes: 100 additions & 0 deletions tests/roles/get_services_configuration/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# Pull nova configuration steps
- name: set shell vars pull openstack configuration ssh commands
no_log: "{{ use_no_log }}"
ansible.builtin.set_fact:
pull_openstack_configuration_ssh_shell_vars: |
CONTROLLER_SSH="{{ controller1_ssh }}"

- name: get src database service environment variables
ansible.builtin.include_role:
name: mariadb_copy
tasks_from: env_vars_src.yaml

# NOTE(bogdando): env variables must be used to keep this consistent with documentation,
# where the stored values need to be compared with post-adoption ones w/o using ansible specifics
- name: test connection to the original DB
no_log: "{{ use_no_log }}"
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
{{ mariadb_copy_shell_vars_src }}
export PULL_OPENSTACK_CONFIGURATION_DATABASES=$(oc run mariadb-client -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \
mysql -rsh "$SOURCE_MARIADB_IP" -uroot -p"$SOURCE_DB_ROOT_PASSWORD" -e 'SHOW databases;')
echo "$PULL_OPENSTACK_CONFIGURATION_DATABASES"
register: _databases_check

- name: run mysqlcheck on the original DB to look for things that are not OK
no_log: "{{ use_no_log }}"
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
{{ mariadb_copy_shell_vars_src }}
export PULL_OPENSTACK_CONFIGURATION_MYSQLCHECK_NOK=$(oc run mariadb-client -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \
mysqlcheck --all-databases -h "${SOURCE_MARIADB_IP}" -uroot -p"${SOURCE_DB_ROOT_PASSWORD}" | grep -v OK)
echo "$PULL_OPENSTACK_CONFIGURATION_MYSQLCHECK_NOK"
failed_when: _mysqlnok_check.stdout != ''
register: _mysqlnok_check

- name: get source Nova services topology specific configuration
no_log: "{{ use_no_log }}"
block:
- name: get Nova cells mappings from database
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
{{ mariadb_copy_shell_vars_src }}
export PULL_OPENSTACK_CONFIGURATION_NOVADB_MAPPED_CELLS=$(oc run mariadb-client -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \
mysql -rsh "${SOURCE_MARIADB_IP}" -uroot -p"${SOURCE_DB_ROOT_PASSWORD}" nova_api -e \
'select uuid,name,transport_url,database_connection,disabled from cell_mappings;')
echo "$PULL_OPENSTACK_CONFIGURATION_NOVADB_MAPPED_CELLS"
register: _novadb_mapped_cells_check

- name: get the host names of the registered Nova compute services
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
{{ mariadb_copy_shell_vars_src }}
export PULL_OPENSTACK_CONFIGURATION_NOVA_COMPUTE_HOSTNAMES=$(oc run mariadb-client -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \
mysql -rsh "$SOURCE_MARIADB_IP" -uroot -p"$SOURCE_DB_ROOT_PASSWORD" nova_api -e \
"select host from nova.services where services.binary='nova-compute';")
echo "$PULL_OPENSTACK_CONFIGURATION_NOVA_COMPUTE_HOSTNAMES"
register: _nova_compute_hostnames_check

- name: get the list of mapped Nova cells
ansible.builtin.shell: |
{{ shell_header }}
{{ pull_openstack_configuration_ssh_shell_vars }}
export PULL_OPENSTACK_CONFIGURATION_NOVAMANAGE_CELL_MAPPINGS=$($CONTROLLER_SSH sudo podman exec -it nova_api nova-manage cell_v2 list_cells)
echo "$PULL_OPENSTACK_CONFIGURATION_NOVAMANAGE_CELL_MAPPINGS"
register: _nova_cell_mappings_check

- name: set cached fact for pulled openstack services configuration shell headers
no_log: "{{ use_no_log }}"
ansible.builtin.set_fact:
pulled_openstack_configuration_shell_headers: |
PULL_OPENSTACK_CONFIGURATION_DATABASES="{{ _databases_check.stdout_lines | join(' ') }}"
PULL_OPENSTACK_CONFIGURATION_MYSQLCHECK_NOK="{{ _mysqlnok_check.stdout_lines | join(' ') }}"
PULL_OPENSTACK_CONFIGURATION_NOVADB_MAPPED_CELLS="{{ _novadb_mapped_cells_check.stdout_lines | join(' ') }}"
PULL_OPENSTACK_CONFIGURATION_NOVA_COMPUTE_HOSTNAMES="{{ _nova_compute_hostnames_check.stdout_lines | join(' ') }}"
PULL_OPENSTACK_CONFIGURATION_NOVAMANAGE_CELL_MAPPINGS="{{ _nova_cell_mappings_check.stdout_lines | join(' ') }}"

- name: store exported variables for future use
no_log: "{{ use_no_log }}"
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
{{ mariadb_copy_shell_vars_src }}
cat > ~/.source_cloud_exported_variables << EOF
PULL_OPENSTACK_CONFIGURATION_DATABASES="$(oc run mariadb-client -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \
mysql -rsh $SOURCE_MARIADB_IP -uroot -p$SOURCE_DB_ROOT_PASSWORD -e 'SHOW databases;')"
PULL_OPENSTACK_CONFIGURATION_MYSQLCHECK_NOK="$(oc run mariadb-client -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \
mysqlcheck --all-databases -h $SOURCE_MARIADB_IP -u root -p$SOURCE_DB_ROOT_PASSWORD | grep -v OK)"
PULL_OPENSTACK_CONFIGURATION_NOVADB_MAPPED_CELLS="$(oc run mariadb-client -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \
mysql -rsh $SOURCE_MARIADB_IP -uroot -p$SOURCE_DB_ROOT_PASSWORD nova_api -e \
'select uuid,name,transport_url,database_connection,disabled from cell_mappings;')"
PULL_OPENSTACK_CONFIGURATION_NOVA_COMPUTE_HOSTNAMES="$(oc run mariadb-client -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \
mysql -rsh $SOURCE_MARIADB_IP -uroot -p$SOURCE_DB_ROOT_PASSWORD nova_api -e \
"select host from nova.services where services.binary='nova-compute';")"
PULL_OPENSTACK_CONFIGURATION_NOVAMANAGE_CELL_MAPPINGS="$($CONTROLLER_SSH sudo podman exec -it nova_api nova-manage cell_v2 list_cells)"
EOF
chmod 0600 ~/.source_cloud_exported_variables
3 changes: 2 additions & 1 deletion tests/roles/pull_openstack_configuration/defaults/main.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
os_diff_etc_dir: /etc/os-diff
os_diff_dir: tmp/os-diff
os_diff_data_dir: tmp/os-diff/data
os_diff_data_dir: tmp/os-diff
source_os_diff_config_ip: 192.168.122.100
101 changes: 0 additions & 101 deletions tests/roles/pull_openstack_configuration/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,103 +1,2 @@
- name: Run os_diff pull config tasks
ansible.builtin.include_tasks: os_diff_pull_config.yaml

# Pull nova configuration steps
- name: set shell vars pull openstack configuration ssh commands
no_log: "{{ use_no_log }}"
ansible.builtin.set_fact:
pull_openstack_configuration_ssh_shell_vars: |
CONTROLLER_SSH="{{ controller1_ssh }}"

- name: get src database service environment variables
ansible.builtin.include_role:
name: mariadb_copy
tasks_from: env_vars_src.yaml

# NOTE(bogdando): env variables must be used to keep this consistent with documentation,
# where the stored values need to be compared with post-adoption ones w/o using ansible specifics
- name: test connection to the original DB
no_log: "{{ use_no_log }}"
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
{{ mariadb_copy_shell_vars_src }}
export PULL_OPENSTACK_CONFIGURATION_DATABASES=$(oc run mariadb-client -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \
mysql -rsh "$SOURCE_MARIADB_IP" -uroot -p"$SOURCE_DB_ROOT_PASSWORD" -e 'SHOW databases;')
echo "$PULL_OPENSTACK_CONFIGURATION_DATABASES"
register: _databases_check

- name: run mysqlcheck on the original DB to look for things that are not OK
no_log: "{{ use_no_log }}"
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
{{ mariadb_copy_shell_vars_src }}
export PULL_OPENSTACK_CONFIGURATION_MYSQLCHECK_NOK=$(oc run mariadb-client -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \
mysqlcheck --all-databases -h "${SOURCE_MARIADB_IP}" -uroot -p"${SOURCE_DB_ROOT_PASSWORD}" | grep -v OK)
echo "$PULL_OPENSTACK_CONFIGURATION_MYSQLCHECK_NOK"
failed_when: _mysqlnok_check.stdout != ''
register: _mysqlnok_check

- name: get source Nova services topology specific configuration
no_log: "{{ use_no_log }}"
block:
- name: get Nova cells mappings from database
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
{{ mariadb_copy_shell_vars_src }}
export PULL_OPENSTACK_CONFIGURATION_NOVADB_MAPPED_CELLS=$(oc run mariadb-client -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \
mysql -rsh "${SOURCE_MARIADB_IP}" -uroot -p"${SOURCE_DB_ROOT_PASSWORD}" nova_api -e \
'select uuid,name,transport_url,database_connection,disabled from cell_mappings;')
echo "$PULL_OPENSTACK_CONFIGURATION_NOVADB_MAPPED_CELLS"
register: _novadb_mapped_cells_check

- name: get the host names of the registered Nova compute services
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
{{ mariadb_copy_shell_vars_src }}
export PULL_OPENSTACK_CONFIGURATION_NOVA_COMPUTE_HOSTNAMES=$(oc run mariadb-client -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \
mysql -rsh "$SOURCE_MARIADB_IP" -uroot -p"$SOURCE_DB_ROOT_PASSWORD" nova_api -e \
"select host from nova.services where services.binary='nova-compute';")
echo "$PULL_OPENSTACK_CONFIGURATION_NOVA_COMPUTE_HOSTNAMES"
register: _nova_compute_hostnames_check

- name: get the list of mapped Nova cells
ansible.builtin.shell: |
{{ shell_header }}
{{ pull_openstack_configuration_ssh_shell_vars }}
export PULL_OPENSTACK_CONFIGURATION_NOVAMANAGE_CELL_MAPPINGS=$($CONTROLLER_SSH sudo podman exec -it nova_api nova-manage cell_v2 list_cells)
echo "$PULL_OPENSTACK_CONFIGURATION_NOVAMANAGE_CELL_MAPPINGS"
register: _nova_cell_mappings_check

- name: set cached fact for pulled openstack services configuration shell headers
no_log: "{{ use_no_log }}"
ansible.builtin.set_fact:
pulled_openstack_configuration_shell_headers: |
PULL_OPENSTACK_CONFIGURATION_DATABASES="{{ _databases_check.stdout_lines | join(' ') }}"
PULL_OPENSTACK_CONFIGURATION_MYSQLCHECK_NOK="{{ _mysqlnok_check.stdout_lines | join(' ') }}"
PULL_OPENSTACK_CONFIGURATION_NOVADB_MAPPED_CELLS="{{ _novadb_mapped_cells_check.stdout_lines | join(' ') }}"
PULL_OPENSTACK_CONFIGURATION_NOVA_COMPUTE_HOSTNAMES="{{ _nova_compute_hostnames_check.stdout_lines | join(' ') }}"
PULL_OPENSTACK_CONFIGURATION_NOVAMANAGE_CELL_MAPPINGS="{{ _nova_cell_mappings_check.stdout_lines | join(' ') }}"

- name: store exported variables for future use
no_log: "{{ use_no_log }}"
ansible.builtin.shell: |
{{ shell_header }}
{{ oc_header }}
{{ mariadb_copy_shell_vars_src }}
cat > ~/.source_cloud_exported_variables << EOF
PULL_OPENSTACK_CONFIGURATION_DATABASES="$(oc run mariadb-client -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \
mysql -rsh $SOURCE_MARIADB_IP -uroot -p$SOURCE_DB_ROOT_PASSWORD -e 'SHOW databases;')"
PULL_OPENSTACK_CONFIGURATION_MYSQLCHECK_NOK="$(oc run mariadb-client -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \
mysqlcheck --all-databases -h $SOURCE_MARIADB_IP -u root -p$SOURCE_DB_ROOT_PASSWORD | grep -v OK)"
PULL_OPENSTACK_CONFIGURATION_NOVADB_MAPPED_CELLS="$(oc run mariadb-client -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \
mysql -rsh $SOURCE_MARIADB_IP -uroot -p$SOURCE_DB_ROOT_PASSWORD nova_api -e \
'select uuid,name,transport_url,database_connection,disabled from cell_mappings;')"
PULL_OPENSTACK_CONFIGURATION_NOVA_COMPUTE_HOSTNAMES="$(oc run mariadb-client -q --image ${MARIADB_IMAGE} -i --rm --restart=Never -- \
mysql -rsh $SOURCE_MARIADB_IP -uroot -p$SOURCE_DB_ROOT_PASSWORD nova_api -e \
"select host from nova.services where services.binary='nova-compute';")"
PULL_OPENSTACK_CONFIGURATION_NOVAMANAGE_CELL_MAPPINGS="$($CONTROLLER_SSH sudo podman exec -it nova_api nova-manage cell_v2 list_cells)"
EOF
chmod 0600 ~/.source_cloud_exported_variables
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,43 @@
- name: Set ssh command for Tripleo standalone in os-diff.cfg
ansible.builtin.lineinfile:
path: "{{ os_diff_dir }}/os-diff.cfg"
regex: "ssh -F ssh.config standalone"
value: "ssh_cmd=ssh -i {{ standalone_private_key | default('~/install_yamls/out/edpm/ansibleee-ssh-key-id_rsa') }} root@{{ source_os_diff_config_ip }}"
regex: "ssh -F ssh.config"
value: "ssh_cmd=ssh -F {{ playbook_dir }}/{{ os_diff_dir }}/ssh.config"

- name: Update ssh key in ssh.config
ansible.builtin.lineinfile:
path: "{{ playbook_dir }}/{{ os_diff_dir }}/ssh.config"
regex: "IdentityFile ~/install_yamls/out/edpm/ansibleee-ssh-key-id_rsa"
value: " IdentityFile {{ controller1_ssh.split(' ')[2] }}"

- name: Set standalone IP in ssh.config file
ansible.builtin.lineinfile:
path: "{{ playbook_dir }}/{{ os_diff_dir }}/ssh.config"
regex: "Hostname standalone"
value: " Hostname {{ source_os_diff_config_ip }}"

- name: Set Tripleo config path in os-diff.cfg
ansible.builtin.lineinfile:
firstmatch: true
path: "{{ os_diff_dir }}/os-diff.cfg"
regex: "local_config_path=/tmp/"
value: "local_config_path={{ os_diff_data_dir }}/tripleo"
value: "local_config_path={{ os_diff_data_dir }}"

- name: Set OCP config path in os-diff.cfg
ansible.builtin.lineinfile:
path: "{{ os_diff_dir }}/os-diff.cfg"
regex: "ocp_local_config_path=/tmp/ocp"
value: "ocp_local_config_path={{ os_diff_data_dir }}/ocp"
value: "ocp_local_config_path={{ os_diff_data_dir }}"

- name: Set config path in os-diff.cfg
ansible.builtin.lineinfile:
path: "{{ os_diff_dir }}/os-diff.cfg"
regex: "local_config_dir=/tmp/"
value: "local_config_dir={{ os_diff_data_dir }}"

- name: Cp os-diff.cfg to the current location
ansible.builtin.shell: cp {{ os_diff_dir }}/os-diff.cfg .

- name: Pull config from Tripleo os-diff
ansible.builtin.shell: |
cd {{ os_diff_dir }}
./os-diff pull
{{ os_diff_dir }}/os-diff pull --update -s {{ os_diff_dir }}/config.yaml
Loading