Commit 02f25f61 by Arbab Nazar Committed by GitHub

Merge pull request #3219 from edx/arbab/go-server-rewrite

using proper YAML syntax
parents 7940b562 32eaf470
......@@ -33,7 +33,7 @@
- name: install system packages needed for downloading backup
apt:
pkg: "{{ item }}"
name: "{{ item }}"
state: present
update_cache: true
cache_valid_time: 3600
......@@ -52,19 +52,19 @@
mode: 0755
- name: get s3 one time url
s3: >
bucket="{{ GO_SERVER_BACKUP_S3_BUCKET }}"
object="{{ GO_SERVER_BACKUP_S3_OBJECT }}"
mode="geturl"
expiration=30
s3:
bucket: "{{ GO_SERVER_BACKUP_S3_BUCKET }}"
object: "{{ GO_SERVER_BACKUP_S3_OBJECT }}"
mode: "geturl"
expiration: 30
when: GO_SERVER_BACKUP_S3_BUCKET and GO_SERVER_BACKUP_S3_OBJECT
register: s3_one_time_url
- name: download from one time url
get_url:
url="{{ s3_one_time_url.url }}"
dest="{{ GO_SERVER_TEMP_RESTORE_DIRECTORY }}/{{ GO_SERVER_BACKUP_FILENAME }}"
mode=0600
url: "{{ s3_one_time_url.url }}"
dest: "{{ GO_SERVER_TEMP_RESTORE_DIRECTORY }}/{{ GO_SERVER_BACKUP_FILENAME }}"
mode: "0600"
when: GO_SERVER_BACKUP_S3_BUCKET and GO_SERVER_BACKUP_S3_OBJECT
register: download_backup_s3
......
......@@ -33,19 +33,22 @@
- name: install go-server aptitude repository
apt_repository:
repo: "{{ GO_SERVER_APT_SOURCE }}"
state: present
- name: install aptitude key for go-server/go-server
apt_key:
url: "{{ GO_SERVER_APT_KEY_URL }}"
state: present
- name: install go-server using apt-get
apt:
name: "{{ GO_SERVER_APT_NAME }}={{ GO_SERVER_VERSION }}"
update_cache: yes
state: present
- name: install other needed system packages
apt:
pkg: "{{ item }}"
name: "{{ item }}"
state: present
update_cache: true
cache_valid_time: 3600
......
......@@ -27,7 +27,8 @@
#
- name: check if H2 db exists
stat: "path={{ GO_SERVER_H2DB_LOCATION }}"
stat:
path: "{{ GO_SERVER_H2DB_LOCATION }}"
register: h2db_stat
- name: create the db backup directory
......
......@@ -29,17 +29,17 @@
- name: install required pkgs
apt:
pkg: "{{ item }}"
name: "{{ item }}"
state: present
update_cache: true
cache_valid_time: 3600
with_items: GO_SERVER_BACKUP_APT_PKGS
with_items: "{{ GO_SERVER_BACKUP_APT_PKGS }}"
- name: install required Python modules
pip:
name: "{{ item }}"
state: present
with_items: GO_SERVER_BACKUP_PIP_PKGS
with_items: "{{ GO_SERVER_BACKUP_PIP_PKGS }}"
- name: create backup shell script
template:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment