Skip to content
Snippets Groups Projects
Commit c635b33f authored by Krish Moodbidri's avatar Krish Moodbidri
Browse files

Update 2 files

- /ansible/accountservices.yml
- /.gitlab-ci.yml
parent a43040d4
No related branches found
No related tags found
1 merge request!4wip: add account services node deployment with a accountservices playbook
Pipeline #14193 failed with stage
...@@ -426,3 +426,56 @@ deploy_ood_node: ...@@ -426,3 +426,56 @@ deploy_ood_node:
rules: rules:
- if: $PIPELINE_TARGET == "deploy" && $OOD_IMAGE_ID - if: $PIPELINE_TARGET == "deploy" && $OOD_IMAGE_ID
when: always when: always
deploy_account_services_:
stage: deploy
environment:
name: $ENV
tags:
- build
script:
- openstack image set --accept f10c29db-362e-440a-97b2-0230c316369f || true
- FAILED=false
- |
cat > user_data.txt <<EOF
#!/bin/bash
cat >> /etc/NetworkManager/conf.d/90-dns-none.conf<<EEOF
[main]
dns=none
EEOF
systemctl reload NetworkManager
echo "$DEV_KEY" >> /root/.ssh/authorized_keys
ip route replace default via ${DEFAULT_GATEWAY_IP} dev eth0
git clone ${CI_REPOSITORY_URL} /tmp/${CI_PROJECT_NAME}
cd /tmp/${CI_PROJECT_NAME}
git checkout ${CI_COMMIT_REF_NAME}
cat >> ansible/hosts<<EEOF
[$ENV]
127.0.0.1
EEOF
ansible-playbook -c local -i ansible/hosts --extra-vars="$EXTRA_VARS" ansible/accountservices.yml | tee -a /tmp/ansible.log
rm -rf /tmp/${CI_PROJECT_NAME}
EOF
- |
export cmd="openstack server create"
cmd+=" -c id -f value --image f10c29db-362e-440a-97b2-0230c316369f"
cmd+=" --flavor $INSTANCE_FLAVOR"
for security_group in ${SECURITY_GROUP_LIST[@]};
do
cmd+=" --security-group $security_group"
done
cmd+=" --user-data user_data.txt"
if [ -n "$PROXY_NETWORK" ];then cmd+=" --network $PROXY_NETWORK"; fi
if [ -n "$ACCOUNT_SERVICES_APP_PORT" ];then cmd+=" --port $ACCOUNT_SERVICES_APP_PORT"; fi
cmd+=" --wait account-services-app"
- export ACCOUNT_SERVICES_APP_INSTANCE_ID=$(bash -c "$cmd")
- |
# Associate the floating IP(s) with the Account Services App instance
for ACCOUNT_SERVICES_APP_FLOATING_IP in ${ACCOUNT_SERVICES_APP_FLOATING_IP_LIST[@]};
do
echo "Associating FLOATING_IP $ACCOUNT_SERVICES_APP_FLOATING_IP with ACCOUNT_SERVICES_APP_INSTANCE_ID $ACCOUNT_SERVICES_APP_INSTANCE_ID"
openstack server add floating ip $ACCOUNT_SERVICES_APP_INSTANCE_ID $ACCOUNT_SERVICES_APP_FLOATING_IP
done
rules:
- if: $PIPELINE_TARGET == "deploy" && $DEPLOY_ACCOUNT_SERVICES_APP == "true"
when: always
---
- name: Setup node to run account services app
hosts: default
become: true
roles:
- { name: 'install_rabbitmq', tags: 'install_rabbitmq' }
- { name: 'install_accountapp', tags: 'install_accountapp' }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment