浏览代码

binary install

Chris Mague 8 年之前
父节点
当前提交
8f6a57e670
共有 3 个文件被更改,包括 43 次插入0 次删除
  1. 39 0
      tasks/binary_install.yml
  2. 1 0
      tasks/main.yml
  3. 3 0
      vars/main.yml

+ 39 - 0
tasks/binary_install.yml

@@ -0,0 +1,39 @@
+---
+- name: Ensure Consul Download Dir exists
+  file:
+    path="{{cloud_consul_download_dir}}"
+    mode=0755
+    state=directory
+  tags: 
+    - install
+
+- name: Consul Download
+  local_action: >
+    get_url
+      url="https://releases.hashicorp.com/consul/{{cloud_consul_version}}/consul_{{cloud_consul_version}}_linux_amd64.zip"
+      dest="{{cloud_consul_download_dir}}"
+  tags: 
+    - install
+
+- name: Ensure Consul Install Dir exists
+  file:
+    path="{{cloud_consul_install_dir}}"
+    mode=0700
+    state=directory
+  tags: 
+    - install
+
+- name: Unzip Consul
+  unarchive:
+    src="{{cloud_consul_download_dir}}/consul_{{cloud_consul_version}}_linux_amd64.zip"
+    dest="{{cloud_consul_install_dir}}"
+  tags: 
+    - install
+
+- name: ensures consul command has the right permissions
+  file:
+    path="{{cloud_consul_install_dir}}/consul"
+    owner=root
+    user=root
+    mode=0700
+    state=file

+ 1 - 0
tasks/main.yml

@@ -1,2 +1,3 @@
 ---
 ---
 # tasks file for shokunin.ansible-cloud-consul
 # tasks file for shokunin.ansible-cloud-consul
+- include: binary_install.yml

+ 3 - 0
vars/main.yml

@@ -1,2 +1,5 @@
 ---
 ---
 # vars file for shokunin.ansible-cloud-consul
 # vars file for shokunin.ansible-cloud-consul
+cloud_consul_version: 0.7.2
+cloud_consul_download_dir: /var/tmp/consul_dl
+cloud_consul_install_dir: /opt/consul