ソースを参照

ensure dhparams exist before restarting nginx

tags/v0.12.9
Jonathan Cobb 4年前
コミット
80b2c600e0
4個のファイルの変更31行の追加1行の削除
  1. +4
    -0
      bubble-server/src/main/resources/ansible/roles/finalizer/tasks/main.yml
  2. +3
    -1
      bubble-server/src/main/resources/packer/roles/algo/files/prep_algo.sh
  3. +16
    -0
      bubble-server/src/main/resources/packer/roles/common/files/ensure_file_exists.sh
  4. +8
    -0
      bubble-server/src/main/resources/packer/roles/common/tasks/main.yml

+ 4
- 0
bubble-server/src/main/resources/ansible/roles/finalizer/tasks/main.yml ファイルの表示

@@ -29,6 +29,10 @@
- name: reload supervisord
shell: supervisorctl reload

# dhparams file is created async. it takes a while and might not have finished. nginx will fail to start without it.
- name: Ensure dhparams.pem exists
shell: /usr/local/bin/ensure_file_exists.sh /etc/nginx/dhparams.pem 180

- name: Ensure nginx is restarted
service:
name: nginx


+ 3
- 1
bubble-server/src/main/resources/packer/roles/algo/files/prep_algo.sh ファイルの表示

@@ -1,5 +1,7 @@
#!/bin/bash

#
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/
#
ALGO_BASE="$(cd "$(dirname "$0")" && pwd)"
cd "${ALGO_BASE}" || exit 1



+ 16
- 0
bubble-server/src/main/resources/packer/roles/common/files/ensure_file_exists.sh ファイルの表示

@@ -0,0 +1,16 @@
#!/bin/bash
#
# Copyright (c) 2020 Bubble, Inc. All rights reserved. For personal (non-commercial) use, see license: https://getbubblenow.com/bubble-license/
#
TARGET_FILE=${1:?no target file provided}
TIMEOUT=${2:?no timeout provided}

start=$(date +%s)
while [[ ! -f ${TARGET_FILE} && $(expr $(date +%s) - ${start}) -le ${TIMEOUT} ]] ; do
sleep 1s
done

if [[ ! -f ${TARGET_FILE} ]] ; then
echo "target file did not get created: ${TARGET_FILE} (timeout after ${TIMEOUT} seconds)"
exit 1
fi

+ 8
- 0
bubble-server/src/main/resources/packer/roles/common/tasks/main.yml ファイルの表示

@@ -43,6 +43,14 @@
group: root
mode: 0644

- name: Install ensure_file_exists.sh
copy:
src: ensure_file_exists.sh
dest: /usr/local/bin/ensure_file_exists.sh
owner: root
group: root
mode: 0500

- name: Start common services
service:
name: '{{ item }}'


読み込み中…
キャンセル
保存