diff --git a/defaults/main.yml b/defaults/main.yml index 5e24a41..cfe361d 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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 diff --git a/tasks/etcdctl.yml b/tasks/etcdctl.yml new file mode 100644 index 0000000..ad6566b --- /dev/null +++ b/tasks/etcdctl.yml @@ -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 }}" diff --git a/tasks/jq.yml b/tasks/jq.yml new file mode 100644 index 0000000..0ecb216 --- /dev/null +++ b/tasks/jq.yml @@ -0,0 +1,7 @@ +--- +- name: Bootstrap | Get jq binary + get_url: + url: "{{ jq_release_url }}" + mode: 0755 + dest: "{{ bin_dir }}/jq" + force: yes diff --git a/tasks/main.yml b/tasks/main.yml index e26ccb5..21f88ab 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -7,3 +7,5 @@ - include_tasks: kernel.yml - include_tasks: docker.yml + +- include_tasks: requirements.yml diff --git a/tasks/requirements.yml b/tasks/requirements.yml new file mode 100644 index 0000000..4c1a6d0 --- /dev/null +++ b/tasks/requirements.yml @@ -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