-
Notifications
You must be signed in to change notification settings - Fork 104
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
Prepare crc job for architecture repo #1794
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this could be done via the ci_setup/directories tasks file (you have to provide
directory_state: directory
)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a good idea, but I'd still need an extra task to create
parameters
dir, since it's not created by theci_setup
ci-framework/roles/ci_setup/tasks/directories.yml
Line 21 in c4ee373
interfaces-info.yml
file