overcloud-deploy: add config-download + ansible run feature
There is some ongoing work to deploy the overcloud steps from Ansible. This patch aims to add the support for testing the feature. Parameters additions: - tripleo_config_download_log`: Sets the TripleO config-download log file path. - ansible_steps_log`: Sets the TripleO Ansible steps log file path. - config_download_args`: Sets the arguments to load config-download environment in THT. - step_tripleo_config_download`: false/true - whether to enable config-download. - deploy_steps_ansible`: false/true - whether to deploy the overcloud with config-download Ansible steps. Log collection (temporary, until we have a Mistral workflow): - /home/*/inventory - /home/*/tripleo-config-download/ Steps added to the overcloud-deploy: - Create config-downlad environment - Download TripleO configuration with tripleo-config-download - Add subnodes to known hosts - Deploy overcloud steps with Ansible Other: templates/config-download.yaml.j2 file is added to configure OS::TripleO::DeployedServer::ControlPlanePort resource_registry and also HostnameMap + DeployedServerPortMap. Some of the tasks implemented here are temporary and will be removed once we have a clean Mistral workflow. Co-Authored-By: James Slagle <jslagle@redhat.com> Co-Authored-By: Emilien Macchi <emilien@redhat.com> Implements: blueprint ansible-config-download Change-Id: I3a66e4a22d7bf15eddc5be1604af2b5737d49055
This commit is contained in:
parent
0fb6cdbcf1
commit
fc222b3963
@ -37,6 +37,10 @@ artcl_collect_list:
|
||||
- /home/*/browbeat/results/
|
||||
- /usr/share/openstack-tripleo-heat-templates/
|
||||
- /tmp/tripleoclient*
|
||||
# The next 2 items are temporary until config-download is executed
|
||||
# from a Mistral workflow (WIP in Queens)
|
||||
- /home/*/inventory
|
||||
- /home/*/tripleo-config-download/
|
||||
artcl_exclude_list:
|
||||
- /etc/udev/hwdb.bin
|
||||
- /etc/puppet/modules
|
||||
|
@ -32,6 +32,13 @@ A description of the settable variables for this role should go here, including
|
||||
* `overcloud_roles`: contents of custom `roles_data.yaml` (as a YAML
|
||||
structure, not a string). See `roles_data.yaml` in the
|
||||
tripleo-heat-templates repository for example contents.
|
||||
* `tripleo_config_download_log`: Sets the TripleO config-download log file path.
|
||||
* `ansible_steps_log`: Sets the TripleO Ansible steps log file path.
|
||||
* `config_download_args`: Sets the arguments to load config-download
|
||||
environment in THT.
|
||||
* `step_tripleo_config_download`: false/true - whether to enable config-download.
|
||||
* `deploy_steps_ansible`: false/true - whether to deploy the overcloud with
|
||||
config-download Ansible steps.
|
||||
|
||||
|
||||
Dependencies
|
||||
|
@ -7,6 +7,8 @@ post_deploy_script: overcloud-deploy-post.sh.j2
|
||||
post_deploy_log: "{{ working_dir }}/overcloud_deploy_post.log"
|
||||
failed_deployments_log: "{{ working_dir }}/failed_deployments.log"
|
||||
failed_deployment_list: "{{ working_dir }}/failed_deployment_list.log"
|
||||
tripleo_config_download_log: "{{ working_dir }}/tripleo_config_download.log"
|
||||
ansible_steps_log: "{{ working_dir }}/ansible_steps.log"
|
||||
validate_script: overcloud-validate.sh.j2
|
||||
|
||||
# Deploy a specific scenario THT to the Overcloud
|
||||
@ -96,6 +98,7 @@ container_args: ""
|
||||
scenario_args: ""
|
||||
multinode_args: ""
|
||||
telemetry_args: ""
|
||||
config_download_args: ""
|
||||
|
||||
deploy_args: >-
|
||||
{{ libvirt_args }}
|
||||
@ -118,6 +121,7 @@ deploy_args: >-
|
||||
{{ swap_args }}
|
||||
{{ composable_args }}
|
||||
{{ topology }}
|
||||
{{ config_download_args }}
|
||||
{{ extra_args }}
|
||||
|
||||
composable_roles: false
|
||||
@ -125,6 +129,10 @@ composable_services: false
|
||||
deploy_multinode: false
|
||||
|
||||
step_deploy_overcloud: true
|
||||
|
||||
step_tripleo_config_download: false
|
||||
deploy_steps_ansible: false
|
||||
|
||||
step_validate_overcloud: true
|
||||
prepare_tempest: false
|
||||
|
||||
|
@ -19,6 +19,12 @@
|
||||
src: "neutronl3ha.yaml.j2"
|
||||
dest: "{{ working_dir }}/neutronl3ha.yaml"
|
||||
|
||||
- name: Create config-downlad environment
|
||||
when: step_tripleo_config_download|bool
|
||||
template:
|
||||
src: "config-download.yaml.j2"
|
||||
dest: "{{ working_dir }}/config-download.yaml"
|
||||
|
||||
- name: Write composable roles file
|
||||
when: composable_roles|bool
|
||||
template:
|
||||
|
@ -10,3 +10,31 @@
|
||||
set_fact:
|
||||
# deploy_args end with a newline, remove to make deploy_args_used easier to use
|
||||
deploy_args_used: "{{ deploy_args | replace('\n', ' ') }}"
|
||||
|
||||
- when: step_tripleo_config_download|bool
|
||||
block:
|
||||
# The config-download workflow is temporary until we have a Mistral workflow,
|
||||
# then we won't need these steps.
|
||||
- name: Cleanup TripleO configuration
|
||||
file:
|
||||
path: "{{ working_dir }}/tripleo-config-download"
|
||||
state: absent
|
||||
- name: Download TripleO configuration
|
||||
shell: >
|
||||
set -o pipefail &&
|
||||
source {{ working_dir }}/stackrc &&
|
||||
tripleo-config-download 2>&1 {{ timestamper_cmd }} > {{ tripleo_config_download_log }}
|
||||
|
||||
- when: deploy_steps_ansible|bool
|
||||
block:
|
||||
- name: Add subnodes to known hosts
|
||||
shell: |
|
||||
ssh-keyscan 192.168.24.3 >> ~/.ssh/known_hosts
|
||||
- name: Deploy steps with Ansible
|
||||
shell: >
|
||||
set -o pipefail &&
|
||||
source {{ working_dir }}/stackrc &&
|
||||
tripleo-ansible-inventory --ansible_ssh_user $(whoami) --static-inventory {{ working_dir }}/inventory &&
|
||||
ansible-playbook -i {{ working_dir }}/inventory {{ working_dir }}/tripleo-config-download/tripleo-*-config/deploy_steps_playbook.yaml 2>&1 {{ timestamper_cmd }} > {{ ansible_steps_log }}
|
||||
environment:
|
||||
ANSIBLE_SSH_ARGS: ""
|
||||
|
14
roles/overcloud-deploy/templates/config-download.yaml.j2
Normal file
14
roles/overcloud-deploy/templates/config-download.yaml.j2
Normal file
@ -0,0 +1,14 @@
|
||||
resource_registry:
|
||||
OS::TripleO::DeployedServer::ControlPlanePort: /usr/share/openstack-tripleo-heat-templates/deployed-server/deployed-neutron-port.yaml
|
||||
|
||||
parameter_defaults:
|
||||
HostnameMap:
|
||||
{% for subnode in groups['overcloud'] %}
|
||||
overcloud-controller-0: {{ hostvars[subnode]['ansible_hostname'] }}
|
||||
DeployedServerPortMap:
|
||||
{{ hostvars[subnode]['ansible_hostname'] }}-ctlplane:
|
||||
fixed_ips:
|
||||
- ip_address: 192.168.24.3
|
||||
subnet:
|
||||
- cidr: 24
|
||||
{% endfor %}
|
Loading…
Reference in New Issue
Block a user