---
- name: install vault
  sudo: yes
  yum:
    name: "https://bintray.com/artifact/download/stevendborrelli/rpm/vault-0.1.0-1.el7.centos.x86_64.rpm"
    state: present
  tags:
    - vault
    - bootstrap

- name: configure vault service
  sudo: yes
  copy:
    src: vault.service
    dest: /usr/lib/systemd/system/vault.service
  notify:
    - restart vault
  tags:
    - vault

- name: create vault directories
  sudo: yes
  file:
    path: /etc/vault
    state: directory
  tags:
    - vault

- name: create consul acl for vault
  sudo: yes
  run_once: yes
  command: consul-cli acl-update --token={{ consul_acl_master_token }} --name="Vault ACL token" --rule='key:vault:write' --rule='key:core:write' {{ consul_acl_vault_token }}
  tags:
    - vault

- name: configure vault
  sudo: yes
  template:
    src: vault.config.j2
    dest: /etc/vault/vault.config
  tags:
    - vault

- name: enable vault
  sudo: yes
  service:
    name: vault
    enabled: yes
    state: started
  tags:
    - vault

- name: wait for vault port
  wait_for:
    port: 8200
  tags:
    - vault

- include: bootstrap.yml

- include: distributive.yml

---
- name: install vault
  sudo: yes
  yum:
    name: "https://bintray.com/artifact/download/chrisaubuchon/rpm/vault-0.4.0-1.x86_64.rpm"
    state: present
  tags:
    - vault
    - bootstrap

- name: configure vault
  sudo: yes
  template:
    src: vault.hcl.j2
    dest: /etc/vault/vault.hcl
  tags:
    - vault

- name: enable vault
  sudo: yes
  service:
    name: vault
    enabled: yes
    state: started
  tags:
    - vault

- name: wait for vault port
  wait_for:
    port: 8200
  tags:
    - vault

- include: bootstrap.yml

- include: distributive.yml

Use new RPM for vault installation.
Use new RPM for vault installation.

RPM path is temporary until the RPM is finalized
