Skip to content
This repository has been archived by the owner on Jun 24, 2021. It is now read-only.

Commit

Permalink
change task comment (#1273) (#1275)
Browse files Browse the repository at this point in the history
  • Loading branch information
liubo0127 authored Apr 20, 2020
1 parent 9a8e668 commit b6b6ca3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions roles/local/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,28 +28,28 @@
- include_vars: file={{ playbook_dir }}/conf/{{ deployment_method }}_packages.yml

# preflight checks
- name: detect outbound network
- name: detect outbound network[1]
shell: >
warn=no
curl -s --connect-timeout 10 www.baidu.com 2>/dev/null >/dev/null; echo $?
changed_when: false
register: outbound_network_st

- name: set outbound network fact
- name: set outbound network fact[1]
set_fact: has_outbound_network={{ outbound_network_st.stdout.strip() == '0' }}

- fail:
msg: "The Control Machine must have access to the Internet in order to download TiDB and related packages."
when: not has_outbound_network

- name: detect GFW
- name: detect outbound network[2]
shell: >
warn=no
curl -s --connect-timeout 10 google.com 2>/dev/null >/dev/null; echo $?
changed_when: false
register: gfw_st

- name: set GFW fact
- name: set outbound network fact[2]
set_fact: under_gfw={{ gfw_st.stdout.strip() != '0' }}

# do actual downloading
Expand Down
10 changes: 5 additions & 5 deletions roles/pre-ansible/tasks/coreos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@
shell: "{{ bootstrap_script_dir }}/pypy/bin/python --version"
register: pypy_st

- name: CoreOS - detect outbound network
- name: CoreOS - detect outbound network[1]
shell: curl -s --connect-timeout 4 baidu.com 2>/dev/null >/dev/null; echo $?
changed_when: false
register: outbound_network_st

- name: CoreOS - set outbound network fact
- name: CoreOS - set outbound network fact[1]
set_fact: has_outbound_network={{ outbound_network_st.stdout.strip() == '0' }}

- name: CoreOS - detect GFW
- name: CoreOS - detect outbound network[2]
shell: curl -s --connect-timeout 2 google.com 2>/dev/null >/dev/null; echo $?
changed_when: false
register: gfw_st

- name: CoreOS - set GFW fact
- name: CoreOS - set outbound network fact[2]
set_fact: under_gfw={{ gfw_st.stdout.strip() != '0' }}

- name: CoreOS - use mirror if under GFW
- name: CoreOS - use mirror if detect outbound network
set_fact:
pypy_download_url: "{{ pypy_download_url_under_gfw }}"

Expand Down

0 comments on commit b6b6ca3

Please sign in to comment.