Skip to content

Commit

Permalink
20210313.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
hswong3i committed Mar 12, 2021
1 parent fd9edc3 commit 62daad1
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 15 deletions.
4 changes: 2 additions & 2 deletions inventory/default/group_vars/all/00-defaults.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ mariadb_release: "10.5"

kubernetes_peer_finder_download:
url: "https://storage.googleapis.com/kubernetes-release/pets/peer-finder"
dest: "{{ ansible_user_dir }}/.ansible/tmp/peer-finder-latest"
checksum: "sha1:5abfeabdd8c011ddf6b0abf33011c5866ff7eb39"
dest: "/var/cache/ansible/230e96b4e6ae962c465b86553e2b4ccbc989efc6da7b2a93520f4f97a87e8e1c/peer-finder"
checksum: "sha256:230e96b4e6ae962c465b86553e2b4ccbc989efc6da7b2a93520f4f97a87e8e1c"
33 changes: 20 additions & 13 deletions playbooks/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,23 +134,16 @@
- { dest: "/var/lib/mysql", owner: "mysql", group: "mysql" }
- { dest: "/var/run/mysqld", owner: "mysql", group: "mysql", mode: "0777" }
- { dest: "{{ kubernetes_peer_finder_download.dest | dirname }}" }
notify:
- download archive

- name: download archive
vars:
ansible_python_interpreter: "python3"
get_url:
url: "{{ item.url }}"
dest: "{{ item.dest }}"
checksum: "{{ item.checksum }}"
timeout: 300
loop:
- "{{ kubernetes_peer_finder_download }}"
register: get_url_result
until: get_url_result is succeeded
- name: flush handlers
meta: flush_handlers

- name: unarchive package
shell: |
set -euo pipefail
exec &> >(tee -a {{ kubernetes_peer_finder_download.dest }}.log)
cd /usr/local/bin
TMP_DIR="$(mktemp -d)" \
&& cp {{ kubernetes_peer_finder_download.dest }} $TMP_DIR/peer-finder \
Expand All @@ -160,7 +153,7 @@
&& rm -rf $TMP_DIR
args:
executable: "/bin/bash"
when: get_url_result is changed
creates: "{{ kubernetes_peer_finder_download.dest }}.log"

- name: copy templates
template:
Expand All @@ -184,3 +177,17 @@
- { dest: "/etc/mysql/my.cnf" }
- { dest: "/usr/local/bin/on-start.sh", mode: "0755" }
- { dest: "/usr/local/bin/peer-finder", mode: "0755" }

handlers:
- name: download archive
vars:
ansible_python_interpreter: "python3"
get_url:
url: "{{ item.url }}"
dest: "{{ item.dest }}"
checksum: "{{ item.checksum }}"
timeout: 300
loop:
- "{{ kubernetes_peer_finder_download }}"
register: result
until: result is succeeded

0 comments on commit 62daad1

Please sign in to comment.