-
Notifications
You must be signed in to change notification settings - Fork 110
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare crc job for architecture repo
Create a job that can deploy the HCI VA with an extracted crc layout. This change introduces the jobs definition and playbooks for such a job. It creates and extracted crc layout using ci-bootstrap role and then calls networking mapper to get the required networking config to deploy a VA. It needs to generate an interfaces-info file. Additionally, it changes the 06-deploy-architecture playbook to allow ssh access from any network to the compute nodes. It also modifies the multinode-customizations playbook to work with a 'ctlplane' network in the crc, instead of a 'default' one. It makes use of scenario inhertance proposed in [1] to reuse most of the existing HCI VA scenario. [1] #1491 Depends-On: #1491
- Loading branch information
Showing
9 changed files
with
358 additions
and
15 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
ci/playbooks/architecture_crc/prepare-architecture-crc.yml
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,61 @@ | ||
--- | ||
- hosts: "{{ cifmw_target_host | default('localhost') }}" | ||
tasks: | ||
# jgilaber: we need to make sure nncp does not touch the vlans, otherwise | ||
# it'll create them with the same MAC address as the ospbr bridge and that | ||
# causes problems when trying to reach the dnsmasq service from the compute | ||
# node. Changing the interface and connnection name to what is used in the | ||
# nncp CR avoids the issue | ||
- name: Change vlan interface and connection names | ||
delegate_to: "crc" | ||
become: true | ||
vars: | ||
old_connn_name: "ci-{{ item.name }}-{{ item.vlan }}" | ||
ansible.builtin.shell: | | ||
nmcli con down {{ old_connn_name }} | ||
nmcli con modify {{ old_connn_name }} connection.interface-name {{ item.name }} | ||
nmcli con modify {{ old_connn_name }} connection.id {{ item.name }} | ||
nmcli con up {{ item.name }} | ||
loop: | ||
- name: internalapi | ||
vlan: 20 | ||
- name: storage | ||
vlan: 21 | ||
- name: tenant | ||
vlan: 22 | ||
|
||
- name: Read os-net-info file | ||
ansible.builtin.slurp: | ||
src: "/etc/ci/env/os-net-info.yml" | ||
register: _ci_bootstrap_os_net_info | ||
|
||
- name: Translate os_net_info into interfaces-info | ||
vars: | ||
_ci_bootstrap_os_parsed: "{{ _ci_bootstrap_os_net_info['content'] | b64decode | from_yaml }}" | ||
_ci_bootstrap_macs: "{{ _ci_bootstrap_os_parsed.ci_bootstrap_os_mac_addr_map }}" | ||
ansible.builtin.copy: | ||
dest: "{{ cifmw_basedir }}/parameters/interfaces-info.yml" | ||
content: | | ||
{% for node, net_list in _ci_bootstrap_macs.items() %} | ||
{{ node }}: | ||
{% for net, mac in net_list.items() %} | ||
- network: {{ net }} | ||
mac: {{ mac }} | ||
{% endfor %} | ||
{% endfor %} | ||
- name: Call networking_mapper again to make sure interfaces names are set in the networking enviornment file | ||
ansible.builtin.import_role: | ||
name: networking_mapper | ||
|
||
- hosts: computes | ||
tasks: | ||
- name: Setup repos | ||
ansible.builtin.include_role: | ||
name: repo_setup | ||
|
||
- name: Set hostname to inventory hostname for ceph deployment | ||
become: true | ||
ansible.builtin.hostname: | ||
name: "{{ inventory_hostname }}" | ||
use: "systemd" |
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 @@ | ||
--- | ||
# Usage and expected parameters | ||
# $ ansible-playbook run-architecture-crc.yml \ | ||
# -e cifmw_architecture_repo=$HOME/architecture \ | ||
# -e cifmw_architecture_scenario=hci \ | ||
# -e cifmw_networking_mapper_networking_env_def_path=$HOME/net-env.yml | ||
# [any other parameter/files your VA/DT might need] | ||
# | ||
# cifmw_architecture_repo: location of the architecture repository. | ||
# cifmw_architecture_scenario: the scenario you want to test. | ||
# cifmw_networking_mapper_networking_env_def_path: path to the | ||
# networking-mapper environment definition file. | ||
# | ||
# Special parameters set in the playbook (you can override them) | ||
# cifmw_basedir: defaults to ~/ci-framework-data | ||
# cifmw_zuul_target_host: target host. Defaults to localhost | ||
|
||
- name: Test architecture automations | ||
hosts: "{{ cifmw_zuul_target_host | default('controller') }}" | ||
gather_facts: true | ||
vars: | ||
_homedir: "{{ ansible_user_dir | default(lookup('env', 'HOME')) }}" | ||
cifmw_basedir: >- | ||
{{ | ||
(_homedir, | ||
'ci-framework-data') | | ||
path_join | ||
}} | ||
cifmw_path: >- | ||
{{ | ||
['~/bin', | ||
ansible_env.PATH] | join(':') | ||
}} | ||
ci_framework_src_dir: "{{ ansible_user_dir }}/src/github.com/openstack-k8s-operators/ci-framework" | ||
pre_tasks: | ||
- name: Create needed directories | ||
ansible.builtin.file: | ||
path: "{{ item }}" | ||
state: directory | ||
mode: "0755" | ||
loop: | ||
- "{{ cifmw_basedir }}/logs" | ||
- "{{ cifmw_basedir }}/artifacts" | ||
- "{{ cifmw_basedir }}/parameters" | ||
|
||
tasks: | ||
- name: Run preparation steps for VA deployment in crc | ||
ansible.builtin.command: > | ||
ansible-playbook -i {{ cifmw_basedir }}/artifacts/zuul_inventory.yml | ||
ci/playbooks/architecture_crc/prepare-architecture-crc.yml | ||
-e cifmw_basedir="{{ cifmw_basedir }}" | ||
{%- if cifmw_extras is defined %} | ||
{%- for extra_vars in cifmw_extras %} | ||
-e "{{ extra_vars }}" | ||
{%- endfor %} | ||
{%- endif %} | ||
args: | ||
chdir: "{{ ci_framework_src_dir }}" | ||
|
||
- name: Deploy VA with crc | ||
ansible.builtin.command: > | ||
ansible-playbook -i {{ cifmw_basedir }}/artifacts/zuul_inventory.yml | ||
deploy-edpm.yml | ||
-e cifmw_basedir="{{ cifmw_basedir }}" | ||
-e "@{{ ansible_user_dir }}/ci-framework-data/artifacts/nodepool_params.yml" | ||
{%- if cifmw_extras is defined %} | ||
{%- for extra_vars in cifmw_extras %} | ||
-e "{{ extra_vars }}" | ||
{%- endfor %} | ||
{%- endif %} | ||
args: | ||
chdir: "{{ ci_framework_src_dir }}" |
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 |
---|---|---|
|
@@ -507,6 +507,7 @@ unclaim | |
undefine | ||
unittest | ||
unmanaged | ||
untagged | ||
uoyt | ||
uri | ||
usermod | ||
|
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
Oops, something went wrong.