Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
Update the install server script to look for a release_info.json file (
Browse files Browse the repository at this point in the history
…#26)

This removes the issue with github rate limiting the api for unauthenticated requests
  • Loading branch information
kholdaway authored Jun 14, 2019
1 parent 42c7455 commit c1eac51
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
4 changes: 4 additions & 0 deletions install/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
export PATH=$PATH:$ANSIBLE_HOME/bin
PLAYBOOKFILE="qpc_playbook.yml"
POSTGRES_VERSION='-e POSTGRES_VERSION=9.6.10'
INSTALLER_VERSION='0.1.1'

declare -a args
args=("$*")
Expand All @@ -22,6 +23,9 @@ set -- ${args[@]}

usage() {
cat <<EOM
Quipucords Installer
Version: ${INSTALLER_VERSION}
Install Quipucords server and command-line components.
Usage:
Expand Down
24 changes: 14 additions & 10 deletions install/roles/qpc_server/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,28 +50,32 @@

- name: Query GitHub for the latest release information
uri:
url: https://api.github.com/repos/quipucords/quipucords/releases/latest
url: https://github.com/quipucords/quipucords/releases/latest/download/release_info.json
validate_certs: no
return_content: yes
headers:
Content-Type: "application/json"
body_format: json
retries: 5
delay: 5
register: github_release_info
until: github_release_info.status == 200 or github_release_info.status == 401
register: github_release_response
until: github_release_response.status == 200 or github_release_response.status == 401
changed_when: false
when:
- install_flag_server_version is not defined

- name: Parse release tag from github JSON
- name: Load JSON release info
set_fact:
github_release: "{{ github_release_info.json.tag_name }}"
github_release_info: "{{ github_release_response.content | from_json }}"
when:
- install_flag_server_version is not defined
- github_release_response is defined
- github_release_response.content is defined

- name: Parse release version from github_release_info JSON
set_fact:
github_release: "{{ github_release_info.version }}"
when:
- install_flag_server_version is not defined
- github_release_info is defined
- github_release_info.json is defined
- github_release_info.json.tag_name is defined
- github_release_info.version is defined

- name: Override default server_image_tag value with release value
set_fact:
Expand Down
2 changes: 1 addition & 1 deletion launch_vms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ EOF

for i in "${arr[@]}"
do
iterm $@ $SCRIPT_HOME/install "vagrant destroy -f v$i" "vagrant up v$i" "vagrant ssh v$i" &
iterm $@ $SCRIPT_HOME/install "vagrant up v$i" "vagrant ssh v$i" &
done

0 comments on commit c1eac51

Please sign in to comment.