-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use veths for simple dev-in-a-box setup
add playbook that installs and configures tenks
- Loading branch information
1 parent
4bbed41
commit f52623c
Showing
7 changed files
with
404 additions
and
41 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- hosts: fake-baremetal | ||
roles: | ||
- role: fake-baremetal | ||
when: enable_ironic |
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,36 @@ | ||
tenks_install_dir: ~/tenks | ||
ansible_roles_dir: "{{tenks_install_dir}}/ansible/roles" | ||
|
||
libvirt_pool_path: "{{ tenks_libvirt_pool_path | default('/var/lib/libvirt/tenks_pool/')}}" | ||
|
||
tenks_git_repo: https://github.com/ChameleonCloud/tenks | ||
|
||
tenks_ansible_galaxy_roles: | ||
- role_name: stackhpc.libvirt-host | ||
role_path: "{{tenks_install_dir}}/ansible/roles/stackhpc.libvirt-host" | ||
- role_name: stackhpc.libvirt-vm | ||
role_path: "{{tenks_install_dir}}/ansible/roles/stackhpc.libvirt-vm" | ||
|
||
shared_networks: "{{ neutron_networks | selectattr('sharednet', 'defined') | list }}" | ||
shared_network_physnet: "{{ shared_networks[0] if shared_networks }}" | ||
shared_network: "{{ shared_network_physnet.sharednet }}" | ||
|
||
provisioning_networks: "{{ neutron_networks | selectattr('provisioning', 'defined') | list }}" | ||
provisioning_network_physnet: "{{ provisioning_networks[0] if provisioning_networks }}" | ||
provisioning_network: "{{ provisioning_network_physnet.provisioning }}" | ||
|
||
tenks_provisoning_physnet: | ||
name: "{{provisioning_network_physnet.name}}" | ||
iface: "{{provisioning_network_physnet.external_interface}}b" | ||
tenks_sharednet_physnet: | ||
name: "{{shared_network_physnet.name}}" | ||
iface: "{{shared_network_physnet.external_interface}}b" | ||
|
||
ironic_deploy_image_names: | ||
- pxe_deploy_kernel | ||
- pxe_deploy_ramdisk | ||
|
||
fake_baremetal_node_ram_mb: 4096 | ||
fake_baremetal_node_disk_gb: 10 | ||
fake_baremetal_node_vcpu: 2 | ||
fake_baremetal_node_count: 3 |
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,79 @@ | ||
--- | ||
- name: clone tenks git repo | ||
ansible.builtin.git: | ||
repo: "{{ tenks_git_repo }}" | ||
dest: "{{ tenks_install_dir }}" | ||
|
||
- name: create venv and install build deps | ||
ansible.builtin.pip: | ||
virtualenv: "{{ tenks_install_dir }}/.venv/" | ||
state: latest | ||
name: | ||
- pip | ||
- wheel | ||
|
||
- name: pip install tenks from the git checkout | ||
ansible.builtin.pip: | ||
name: "{{ tenks_install_dir }}/" | ||
virtualenv: "{{ tenks_install_dir }}/.venv/" | ||
|
||
- name: Install tenks dependency roles from Ansible Galaxy | ||
command: "ansible-galaxy install {{ item.role_name }} --roles-path={{ ansible_roles_dir }}" | ||
args: | ||
creates: "{{ item.role_path }}" | ||
loop: "{{ tenks_ansible_galaxy_roles }}" | ||
|
||
- name: get facts for ironic images | ||
kolla_toolbox: | ||
module_name: openstack.cloud.image_info | ||
module_args: | ||
auth: "{{ openstack_auth }}" | ||
image: "{{ item }}" | ||
run_once: True | ||
register: "image_info" | ||
become: True | ||
loop: "{{ ironic_deploy_image_names }}" | ||
|
||
- name: set facts for ironic images | ||
vars: | ||
deploy_kernel_img: "{{ image_info.results | selectattr('item', 'eq', 'pxe_deploy_kernel') | first }}" | ||
deploy_ramdisk_img: "{{ image_info.results | selectattr('item', 'eq', 'pxe_deploy_ramdisk') | first }}" | ||
ansible.builtin.set_fact: | ||
deploy_kernel_id: "{{ deploy_kernel_img.image.id }}" | ||
deploy_ramdisk_id: "{{ deploy_ramdisk_img.image.id }}" | ||
|
||
- name: template tenks overide file from site-config | ||
ansible.builtin.template: | ||
src: tenks-override.yml.j2 | ||
dest: "{{ tenks_install_dir }}/override.yml" | ||
|
||
|
||
- name: get facts for ironic-provisioning subnet | ||
kolla_toolbox: | ||
module_name: openstack.cloud.subnets_info | ||
module_args: | ||
auth: "{{ openstack_auth }}" | ||
filters: | ||
name: "ironic_provisioning_subnet" | ||
run_once: True | ||
become: True | ||
register: "provisioning_subnet" | ||
|
||
# we're passing this to `ip addr add`, so we need it with the CIDR | ||
- name: set fact for ironic provisioning subnet | ||
vars: | ||
provisioning_subnet_return: "{{ provisioning_subnet.openstack_subnets | first }}" | ||
ansible.builtin.set_fact: | ||
provisioning_subnet_cidr: "{{ provisioning_subnet_return.cidr }}" | ||
provisioning_subnet_prefix: "{{ provisioning_subnet_return.cidr | ipaddr('prefix')}}" | ||
provisioning_subnet_gw: "{{ provisioning_subnet_return.gateway_ip }}" | ||
|
||
|
||
- name: Tell operator to execute tenks | ||
debug: | ||
msg: | ||
- source {{site_config_dir}}/admin-openrc.sh | ||
- cd {{tenks_install_dir}} | ||
- source .venv/bin/activate | ||
- ansible-playbook --inventory ansible/inventory/ ansible/deploy.yml --extra-vars="@override.yml" | ||
- ip addr add {{ provisioning_subnet_gw }}/{{ provisioning_subnet_prefix }} brtenks0 |
Oops, something went wrong.