Skip to content

Commit

Permalink
feat: add jq and etcdctl requirements to support other OS
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Lefevre <[email protected]>
  • Loading branch information
ArchiFleKs committed Jul 17, 2019
1 parent 83e816a commit d744124
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 0 deletions.
7 changes: 7 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,10 @@ bin_dir: /opt/bin

sysctl_file_path: "/etc/sysctl.d/99-kubernetes.conf"
module_load_path: "/etc/modules-load.d/99-kubernetes.conf"

etcd_version: 3.3.13
etcd_release_url: https://github.com/etcd-io/etcd/releases/download/v{{ etcd_version }}/etcd-v{{ etcd_version }}-linux-amd64.tar.gz
etcd_release_dir: /opt/etcd

jq_version: 1.6
jq_release_url: https://github.com/stedolan/jq/releases/download/jq-{{ jq_version }}/jq-linux64
26 changes: 26 additions & 0 deletions tasks/etcdctl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
- name: Bootstrap | Download etcd binaries
unarchive:
src: "{{ etcd_release_url }}"
dest: "{{ etcd_release_dir }}"
remote_src: yes
extra_opts: [--strip-components=1]
exclude:
- "*.md"
- "*.json"
- "*.yml"
- "*.rules"
- "*.png"
- "Documentation/*"

- name: Bootstrap | List etcd binaries
find:
paths: "{{ etcd_release_dir }}"
register: etcd_binaries

- name: Bootstrap | Symlink etcd binaries
file:
src: "{{ item.path }}"
dest: "{{ bin_dir }}/{{ item.path | basename }}"
state: link
with_items: "{{ etcd_binaries.files }}"
7 changes: 7 additions & 0 deletions tasks/jq.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
- name: Bootstrap | Get jq binary
get_url:
url: "{{ jq_release_url }}"
mode: 0755
dest: "{{ bin_dir }}/jq"
force: yes
2 changes: 2 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,5 @@
- include_tasks: kernel.yml

- include_tasks: docker.yml

- include_tasks: requirements.yml
12 changes: 12 additions & 0 deletions tasks/requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
- name: Bootstrap | Ensure requirements required directories exist
file:
path: "{{ item }}"
state: directory
with_items:
- "{{ etcd_release_dir }}"
- "{{ bin_dir }}"

- include_tasks: etcdctl.yml

- include_tasks: jq.yml

0 comments on commit d744124

Please sign in to comment.