Skip to content
Snippets Groups Projects
Commit 0c6d815e authored by Corné Lukken's avatar Corné Lukken
Browse files

L2SS-983: Basic Ansible Deployment

parent 29868f87
No related branches found
No related tags found
1 merge request!469L2SS-983: Deployment through environments and ansible
......@@ -683,7 +683,7 @@ stages:
- cd deploy || exit 1
- echo "[all]" > hosts
- echo "stat ansible_host=$DEPLOY_HOST ansible_user=$DEPLOY_USER" >> hosts
- ansible-playbook deploy.yml --extra-vars station_version=$CI_COMMIT_TAG
- ansible-playbook deploy.yml --extra-vars station_version=$CI_COMMIT_TAG --extra-vars station_config=CS001_ConfigDb.json
.deploy_l2ts_base:
extends: .base_deploy
variables:
......
......@@ -2,6 +2,11 @@
- name: StationControl Early Deployment
hosts: all
tasks:
- name: Register make installation status
command: which make
changed_when: false
failed_when: make_installed.rc not in [0,1]
register: make_installed
- name: Register git installation status
command: which git
changed_when: false
......@@ -28,6 +33,10 @@
args:
chdir: ~/tango
register: pending_changes
- name: Check make installation status
fail:
msg: "Make does not appear to be installed!"
when: make_installed.rc not in [0]
- name: Check git installation status
fail:
msg: "Git does not appear to be installed!"
......@@ -39,9 +48,48 @@
- name: Check pending changes
fail:
msg: "Deployment repository seems to have pending changes!"
when: pending_changes not in [0]
- name: Update sources
when: pending_changes.rc not in [0]
- name: Stop Current Station
changed_when: false
shell: "make stop"
args:
chdir: ~/tango/docker-compose
- name: Update Sources
changed_when: false
shell: "git checkout v{{ station_version }}"
shell: "git checkout {{ station_version }}"
args:
chdir: ~/tango
- name: Pull Images
changed_when: false
shell: "make pull"
args:
chdir: ~/tango/docker-compose
- name: Build Images
changed_when: false
shell: "make build"
args:
chdir: ~/tango/docker-compose
- name: Start Database
changed_when: false
shell: "make minimal"
args:
chdir: ~/tango/docker-compose
- name: Wait for databaseds
ansible.builtin.wait_for:
port: 10000
delay: 10
- name: Update Base Database Config
changed_when: false
shell: "./sbin/load_ConfigDb.sh CDB/LOFAR_ConfigDb.json"
args:
chdir: ~/tango/
- name: Update Station Database Config
changed_when: false
shell: "./sbin/load_ConfigDb.sh CDB/stations/{{ station_config }}"
args:
chdir: ~/tango/
- name: Start Station
changed_when: false
shell: "make start"
args:
chdir: ~/tango/docker-compose
......@@ -149,6 +149,7 @@ DOCKER_COMPOSE_ARGS := DISPLAY=$(DISPLAY) \
XAUTHORITY_MOUNT=$(XAUTHORITY_MOUNT) \
CONTAINER_NAME_PREFIX=$(CONTAINER_NAME_PREFIX) \
COMPOSE_IGNORE_ORPHANS=true \
COMPOSE_HTTP_TIMEOUT=180 \
CONTAINER_EXECUTION_UID=$(shell id -u) \
DOCKER_GID=$(DOCKER_GID) \
TEST_MODULE=$(INTEGRATION_MODULE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment