diff --git a/roles/collect-logs/defaults/main.yml b/roles/collect-logs/defaults/main.yml index dc6d7ba1e..429366337 100644 --- a/roles/collect-logs/defaults/main.yml +++ b/roles/collect-logs/defaults/main.yml @@ -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 diff --git a/roles/overcloud-deploy/README.md b/roles/overcloud-deploy/README.md index 01f605efd..e0221deb4 100644 --- a/roles/overcloud-deploy/README.md +++ b/roles/overcloud-deploy/README.md @@ -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 diff --git a/roles/overcloud-deploy/defaults/main.yml b/roles/overcloud-deploy/defaults/main.yml index 00e0a2602..0f1f6fe41 100644 --- a/roles/overcloud-deploy/defaults/main.yml +++ b/roles/overcloud-deploy/defaults/main.yml @@ -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 diff --git a/roles/overcloud-deploy/tasks/create-scripts.yml b/roles/overcloud-deploy/tasks/create-scripts.yml index a9a8640e3..e698977be 100644 --- a/roles/overcloud-deploy/tasks/create-scripts.yml +++ b/roles/overcloud-deploy/tasks/create-scripts.yml @@ -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: diff --git a/roles/overcloud-deploy/tasks/deploy-overcloud.yml b/roles/overcloud-deploy/tasks/deploy-overcloud.yml index acd4afb61..8364a8532 100644 --- a/roles/overcloud-deploy/tasks/deploy-overcloud.yml +++ b/roles/overcloud-deploy/tasks/deploy-overcloud.yml @@ -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: "" diff --git a/roles/overcloud-deploy/templates/config-download.yaml.j2 b/roles/overcloud-deploy/templates/config-download.yaml.j2 new file mode 100644 index 000000000..195d77881 --- /dev/null +++ b/roles/overcloud-deploy/templates/config-download.yaml.j2 @@ -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 %}