From 386a506c2784c790e8bd7bc2f6b12f7c803ebc16 Mon Sep 17 00:00:00 2001 From: Brian Shumate Date: Mon, 13 Feb 2017 12:10:40 -0500 Subject: [PATCH] local packages --- CHANGELOG.md | 4 ++++ defaults/main.yml | 1 + tasks/install.yml | 18 +++++++++++++++++- tasks/main.yml | 10 +++++----- version.txt | 2 +- 5 files changed, 28 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62fe2dee..4cbac17e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -86,3 +86,7 @@ - Updated configuration templates - Updated documentation + +## v1.2.6 + +- Check for local packages and summary files diff --git a/defaults/main.yml b/defaults/main.yml index 531014ef..9c05db51 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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']}}" \ No newline at end of file diff --git a/tasks/install.yml b/tasks/install.yml index 5df4f0c7..cfbb7347 100644 --- a/tasks/install.yml +++ b/tasks/install.yml @@ -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 @@ -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 diff --git a/tasks/main.yml b/tasks/main.yml index c8b74a77..0cf41a98 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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 @@ -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 diff --git a/version.txt b/version.txt index 212c3bf8..a6c5252c 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -v1.2.5 +v1.2.6