Skip to content

Commit

Permalink
Main task cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
brianshumate committed May 5, 2017
1 parent a3cffc3 commit b3abd13
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -253,3 +253,7 @@
- Add initial Vault Enterprise installation tasks
- Update when statements to avoid warnings about template delimiters
- Update documentation

## v1.6.1 (UNRELEASED)

- Further task cleanup
45 changes: 32 additions & 13 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,31 @@

- name: Fail if not a new release of Red Hat / CentOS
fail:
msg: "{{ ansible_distribution_version }} is not an acceptable version of {{ ansible_distribution }} for this role"
when: ansible_distribution in ['RedHat', 'CentOS'] and ansible_distribution_version|version_compare(7, '<')
msg: "{{ ansible_distribution_version }} is not a supported version of {{ ansible_distribution }} for this role"
when:
- ansible_distribution in ['RedHat', 'CentOS']
- ansible_distribution_version|version_compare(7, '<')

- name: Fail if not a new release of Debian
fail:
msg: "{{ ansible_distribution_version }} is not an acceptable version of {{ ansible_distribution }} for this role"
when: ansible_distribution == "Debian" and ansible_distribution_version|version_compare(8.5, '<')
msg: "{{ ansible_distribution_version }} is not a supported version of {{ ansible_distribution }} for this role"
when:
- ansible_distribution == "Debian"
- ansible_distribution_version|version_compare(8.5, '<')

- name: Fail if not a new release of FreeBSD
fail:
msg: "{{ ansible_distribution_version }} is not a supported version."
when: ansible_distribution == "FreeBSD" and ansible_distribution_version|version_compare(10, '<')
when:
- ansible_distribution == "FreeBSD"
- ansible_distribution_version|version_compare(10, '<')

- name: Fail if not a new release of Ubuntu
fail:
msg: "{{ ansible_distribution_version }} is not an acceptable version of {{ ansible_distribution }} for this role"
when: ansible_distribution == "Ubuntu" and ansible_distribution_version|version_compare(13.04, '<')
msg: "{{ ansible_distribution_version }} is not a supported version of {{ ansible_distribution }} for this role"
when:
- ansible_distribution == "Ubuntu"
- ansible_distribution_version|version_compare(13.04, '<')

- name: Create OS cluster grouping
group_by:
Expand All @@ -44,19 +52,19 @@
- name: Include OS-specific variables
include_vars: "{{ ansible_os_family }}.yml"

- name: Install OS packages and Vault Enterprise
- name: Install OS packages and Vault Enterprise via control host
include: install.yml
when:
- vault_enterprise | bool
- not vault_install_remotely | bool

- name: Install OS packages and vault - locally
- name: Install OS packages and Vault via control host
include: install.yml
when:
- not vault_enterprise | bool
- not vault_install_remotely | bool

- name: Install OS packages and vault - remotely
- name: Install OS packages and Vault via remote hosts
include: install_remote.yml
when:
- not vault_enterprise | bool
Expand Down Expand Up @@ -105,7 +113,11 @@
owner: root
group: root
mode: "0755"
when: not ansible_service_mgr == "systemd" and not ansible_os_family == "Debian" and not ansible_os_family == "FreeBSD" and not ansible_os_family == "Solaris"
when:
- not ansible_service_mgr == "systemd"
- not ansible_os_family == "Debian"
- not ansible_os_family == "FreeBSD"
- not ansible_os_family == "Solaris"

- name: Debian init script
template:
Expand All @@ -114,7 +126,11 @@
owner: root
group: root
mode: "0755"
when: not ansible_service_mgr == "systemd" and ansible_os_family == "Debian" and not ansible_os_family == "FreeBSD" and not ansible_os_family == "Solaris"
when:
- not ansible_service_mgr == "systemd"
- ansible_os_family == "Debian"
- not ansible_os_family == "FreeBSD"
- not ansible_os_family == "Solaris"

- name: systemd unit
template:
Expand All @@ -123,7 +139,10 @@
owner: root
group: root
mode: "0644"
when: ansible_service_mgr == "systemd" and not ansible_os_family == "FreeBSD" and not ansible_os_family == "Solaris"
when:
- ansible_service_mgr == "systemd"
- not ansible_os_family == "FreeBSD"
- not ansible_os_family == "Solaris"

- name: Start Vault
service:
Expand Down

0 comments on commit b3abd13

Please sign in to comment.