Skip to content

Commit b34df40

Browse files
authored
Deploy in a nutshell (#2014)
Signed-off-by: Christian Berendt <[email protected]>
1 parent 36fc007 commit b34df40

File tree

4 files changed

+62
-2
lines changed

4 files changed

+62
-2
lines changed

.zuul.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@
9595
vars:
9696
refstack: true
9797

98+
- job:
99+
name: testbed-deploy-in-a-nutshell
100+
parent: abstract-testbed-deploy
101+
vars:
102+
nutshell: true
103+
98104
- job:
99105
name: testbed-upgrade
100106
parent: abstract-testbed-deploy
@@ -175,6 +181,7 @@
175181
- testbed-deploy-managerless
176182
periodic-daily:
177183
jobs:
184+
- testbed-deploy-in-a-nutshell
178185
- testbed-deploy-managerless
179186
- testbed-deploy-stable
180187
- testbed-upgrade-stable

playbooks/deploy.yml

+15-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
ansible_playbook: ~/venv/bin/ansible-playbook
1313
basepath: "{{ ansible_user_dir }}/src/{{ repositories['testbed']['path'] }}"
1414
manager_address_file: "{{ terraform_path }}/.MANAGER_ADDRESS.{{ cloud_env }}"
15+
repo_path: "{{ ansible_user_dir }}/src/{{ repository_server }}"
16+
1517
manual_create: false
1618
manual_deploy: false
17-
repo_path: "{{ ansible_user_dir }}/src/{{ repository_server }}"
1819

1920
terraform_binary: "{{ ansible_user_dir }}/terragrunt"
2021
terraform_path: "{{ basepath }}/terraform"
@@ -25,6 +26,8 @@
2526

2627
run_bootstrap: true
2728
run_checks: true
29+
30+
in_a_nutshell: "{{ nutshell | default(false) | bool }}"
2831
run_refstack: "{{ refstack | default(false) | bool }}"
2932

3033
tasks:
@@ -159,7 +162,17 @@
159162
- name: Deploy services
160163
ansible.builtin.command:
161164
cmd: "ssh -i {{ terraform_path }}/.id_rsa.{{ cloud_env }} dragon@{{ manager_host }} /opt/configuration/scripts/deploy-services.sh"
162-
when: not manual_deploy | bool
165+
when:
166+
- not manual_deploy | bool
167+
- not in_a_nutshell | bool
168+
changed_when: true
169+
170+
- name: Deploy in a nutshell
171+
ansible.builtin.command:
172+
cmd: "ssh -i {{ terraform_path }}/.id_rsa.{{ cloud_env }} dragon@{{ manager_host }} /opt/configuration/scripts/deploy-in-a-nutshell.sh"
173+
when:
174+
- not manual_deploy | bool
175+
- in_a_nutshell | bool
163176
changed_when: true
164177

165178
- name: Bootstrap services

scripts/deploy-in-a-nutshell.sh

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
source /opt/configuration/scripts/include.sh
5+
6+
# pull images
7+
sh -c '/opt/configuration/scripts/pull-images.sh'
8+
9+
# prepare the ceph deployment
10+
11+
osism apply --environment custom wipe-partitions
12+
osism apply facts
13+
14+
sed -i "/^devices:/d" /opt/configuration/inventory/group_vars/testbed-nodes.yml
15+
osism apply ceph-configure-lvm-volumes
16+
for node in $(find /opt/configuration/inventory/host_vars -mindepth 1 -type d); do
17+
if [[ -e /tmp/$(basename $node)-ceph-lvm-configuration.yml ]]; then
18+
cp /tmp/$(basename $node)-ceph-lvm-configuration.yml /opt/configuration/inventory/host_vars/$(basename $node)/ceph-lvm-configuration.yml
19+
fi
20+
done
21+
osism reconciler sync
22+
osism apply ceph-create-lvm-devices
23+
osism apply facts
24+
25+
# deploy everything
26+
27+
echo
28+
echo "--> DEPLOY IN A NUTSHELL -- START -- $(date)"
29+
echo
30+
31+
osism apply nutshell
32+
33+
# wait for all deployments
34+
35+
osism wait --output --refresh 20
36+
37+
echo
38+
echo "--> DEPLOY IN A NUTSHELL -- END -- $(date)"
39+
echo

scripts/deploy/100-ceph-services-basic.sh

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ if [[ $MANAGER_VERSION =~ ^7\.[0-9]\.[0-9]$ || $MANAGER_VERSION == "latest" ]];
2929
done
3030
osism reconciler sync
3131
osism apply ceph-create-lvm-devices
32+
osism apply facts
3233
fi
3334

3435
if [[ $MANAGER_VERSION =~ ^4\.[0-9]\.[0-9]$ ]]; then

0 commit comments

Comments
 (0)