Skip to content

Commit

Permalink
local packages
Browse files Browse the repository at this point in the history
  • Loading branch information
brianshumate committed Feb 13, 2017
1 parent 3267695 commit 386a506
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,7 @@

- Updated configuration templates
- Updated documentation

## v1.2.6

- Check for local packages and summary files
1 change: 1 addition & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ vault_address: "0.0.0.0"
vault_port: "8200"
vault_node_name: "{{ inventory_hostname_short }}"
vault_main_config: "{{ vault_config_path }}/vault_main.hcl"
vault_primary_node: "{{hostvars[groups['primary'][0]]['ansible_fqdn']}}"
18 changes: 17 additions & 1 deletion tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,20 @@
with_items: "{{ vault_os_packages }}"
tags: installation

- name: Get vault package checksum file
- name: Check Vault package checksum file
become: no
connection: local
stat: "path={{ role_path }}/files/vault_{{ vault_version }}_SHA256SUMS"
run_once: true
register: vault_checksum

- name: Get Vault package checksum file
become: no
connection: local
get_url: "url={{ vault_checksum_file_url }} dest={{ role_path }}/files/vault_{{ vault_version }}_SHA256SUMS"
run_once: true
tags: installation
when: vault_checksum.stat.exists == False

- name: Get vault package checksum
become: no
Expand All @@ -21,12 +29,20 @@
register: vault_sha256
tags: installation

- name: Check Vault package file
become: no
connection: local
stat: "path={{ role_path }}/files/{{ vault_pkg }}"
run_once: true
register: vault_package

- name: Download vault
become: no
connection: local
get_url: "url={{ vault_zip_url }} dest={{ role_path }}/files/{{ vault_pkg }} checksum=sha256:{{ vault_sha256.stdout.split(' ')|first }} timeout=42"
run_once: true
tags: installation
when: vault_package.stat.exists == False

- name: Unarchive vault
become: no
Expand Down
10 changes: 5 additions & 5 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
when: ansible_distribution == "Ubuntu" and ansible_distribution_version|version_compare(13.04, '<')

- name: Create cluster groupings
group_by: key=os_{{ ansible_os_family }}
group_by: "key=os_{{ ansible_os_family }}"

- name: "Add Vault user"
user: name=vault comment="Vault user" uid=1043 group=bin
Expand Down Expand Up @@ -52,18 +52,18 @@
file: "dest=/etc/vault.d state=directory owner={{ vault_user }} group={{ vault_group}}"

- name: Vault server configuration
template: src=vault_main.hcl.j2 dest={{ vault_config_path }}/vault_main.hcl
template: "src=vault_main.hcl.j2 dest={{ vault_config_path }}/vault_main.hcl"

- name: SYSV init script
template: src=vault_sysvinit.j2 dest=/etc/init.d/vault owner=root group=root mode=755
template: "src=vault_sysvinit.j2 dest=/etc/init.d/vault owner=root group=root mode=755"
when: not ansible_distribution == "Debian"

- name: Debian init script
template: src=vault_debian.init.j2 dest=/etc/init.d/vault owner=root group=root mode=755
template: "src=vault_debian.init.j2 dest=/etc/init.d/vault owner=root group=root mode=755"
when: ansible_distribution == "Debian" and ansible_distribution_major_version|int <= 7

- name: systemd script
template: src=vault_systemd.service.j2 dest=/lib/systemd/system/vault.service owner=root group=root mode=644
template: "src=vault_systemd.service.j2 dest=/lib/systemd/system/vault.service owner=root group=root mode=644"
when: ansible_distribution_major_version|int >= 7

- name: Start Vault
Expand Down
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.2.5
v1.2.6

0 comments on commit 386a506

Please sign in to comment.