Browse Source

node provision, generate ansible inventory

Generate an ansible inventory from neutron resource
information when network port management is enabled
in the overcloud node provision cli workflow.

Partial-Implements: blueprint network-data-v2-ports
Depends-On: https://review.opendev.org/771291
Depends-On: https://review.opendev.org/771292
Change-Id: I7737f9fc5104b769ef78b76e20a019cc1dafba8f
changes/94/771294/10
Harald Jensås 3 months ago
parent
commit
db36cf0b8f
2 changed files with 22 additions and 1 deletions
  1. +2
    -1
      tripleo_ansible/ansible_plugins/modules/tripleo_generate_ansible_inventory.py
  2. +20
    -0
      tripleo_ansible/playbooks/cli-overcloud-node-provision.yaml

+ 2
- 1
tripleo_ansible/ansible_plugins/modules/tripleo_generate_ansible_inventory.py View File

@ -141,7 +141,8 @@ def run_module():
python_interpretor,
ssh_user,
ssh_private_key_file,
ssh_network)
ssh_network,
conn.session)
result['inventory_path'] = inventory_path
result['success'] = True
result['changed'] = True


+ 20
- 0
tripleo_ansible/playbooks/cli-overcloud-node-provision.yaml View File

@ -23,6 +23,9 @@
vars:
node_timeout: 3600
concurrency: 20
ssh_network: ctlplane
python_interpreter: null
ssh_private_key_file: /home/stack/.ssh/id_rsa
pre_tasks:
- fail:
@ -172,3 +175,20 @@
dest: "{{ baremetal_deployed_path }}"
content: "{{ network_ports_environment.environment | default({}) | to_nice_yaml(indent=2) }}"
when: manage_network_ports|default(false)
- name: Ensure inventory working directory exists
file:
path: "{{ output_dir }}/{{ stack_name }}"
state: directory
when:
- manage_network_ports|default(false)
- name: Generate ansible inventory
tripleo_generate_ansible_inventory:
plan: "{{ stack_name }}"
work_dir: "{{ output_dir }}/{{ stack_name }}"
ssh_network: "{{ ssh_network }}"
ansible_ssh_user: "{{ ssh_user_name }}"
ansible_python_interpreter: "{{ python_interpreter }}"
ansible_ssh_private_key_file: "{{ ssh_private_key_file }}"
when: manage_network_ports|default(false)

Loading…
Cancel
Save