deckhand/tools/gate/roles/deploy-deckhand/tasks/deploy-deckhand.yaml
Sergiy Markin ac4edb0c64 [focal] Deckhand project updates
- adjusted .gitignore to keep fresh egg-info and omit build artifacts
- fresh egg-info data is needed for promenade that depends on Deckhand
- restored deckhand-functional-uwsgi-py38 gate
- restored deckhand-integration-uwsgi-py38 gate
- made deckhand-airskiff-deployment gate voting ( treasuremap project
  has been updated)
- removed bionic gates
- updated focal dockerfile
- added more binary deps into bindep.txt
- updated deckhand chart values to latest images - focal and wallaby
- fixed python code to compy with CVE's found by fresh version of bandit
- implemented pip freeze approach
- added tox -e freeze profile to manage it
- requirements-frozen.txt is now main file with requirements
- requirements-direct.txt is the file to control deps
- updated setup.cfg to adjust to newer version of setuptools
- fixed airskiff-deploy gate
- fixed docker-image-build playbook to restore Quay repo image publish
- updated other playbooks to include roles from zuul/base-jobs in order
  to setup build hosts properly
- removed workaround with hardcoded dns resolver ip 10.96.0.10 as it
  became obsolette due to recent fix in openstack-helm-infra
- adjusted tools/whitespace-linter.sh script
- tox.ini has been brought to compliance with tox4 requirements
- replaced str() calls with six.text_type() according to D325 Deckhand specific
  commandment from Hacking.rst
- locked python-barbicanclient version with 5.2.0 because of breaking
  changes in the upper versions

Change-Id: I1cd3c97e83569c4db7e958b3400bdd4b7ea5e668
2023-04-20 19:39:43 +00:00

81 lines
2.4 KiB
YAML

# Copyright 2018 AT&T Intellectual Property. All other rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
- name: Perform Database Migrations
shell: |-
set -ex;
# Do database migrations.
docker run \
--rm \
--net=host \
-v "{{ deckhand_conf_dir | default('') }}":/etc/deckhand "{{ airship_deckhand_image_id.stdout }}" alembic upgrade head
# Allow migrations to complete.
sleep 10
become: yes
- name: Deploy Deckhand Container
shell: |-
set -ex;
docker run \
--rm \
--net=host \
-p 9000:9000 \
-v "{{ deckhand_conf_dir | default('') }}":/etc/deckhand "{{ airship_deckhand_image_id.stdout }}" server &
# Give the server a chance to come up. Better to poll a health check.
sleep 10
args:
chdir: "{{ airship_deckhand_path.stdout }}"
become: yes
- name: Register Deckhand Service and Endpoints
when: disable_keystone == false
block:
- name: Register Keystone Deckhand Service
shell: |-
set -ex;
if [ -z "$( openstack service list --format value | grep deckhand )" ]; then
openstack service create --enable --name deckhand deckhand
fi
environment:
OS_CLOUD: openstack_helm
register: result
failed_when: "'permission denied' in result.stdout"
- name: Register Keystone Deckhand Endpoints
shell: |-
set -ex;
echo "Registering Deckhand endpoint: {{ item }}"
deckhand_endpoint="http://127.0.0.1:9000"
if [ -z "$( openstack endpoint list --format value | grep deckhand | grep {{ item }} )" ]; then
openstack endpoint create --enable \
--region RegionOne \
deckhand "{{ item }}" $deckhand_endpoint/api/v1.0
fi
with_items:
- "admin"
- "public"
- "internal"
environment:
OS_CLOUD: openstack_helm
register: result
failed_when: "'permission denied' in result.stdout"