Skip to content

Commit

Permalink
move vars, fail on older
Browse files Browse the repository at this point in the history
  • Loading branch information
brianshumate committed Oct 22, 2016
1 parent eca1eb6 commit ee7ded2
Show file tree
Hide file tree
Showing 9 changed files with 56 additions and 57 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@

- Doc meta

## v1.12.14
## v1.2.14

- Documentation updates

## v1.2.15

- Fail on older versions
- Move distro vars to defaults
- Remove vars
38 changes: 38 additions & 0 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,41 @@ consul_acl_datacenter: "{{ consul_datacenter }}"
consul_acl_default_policy: "allow"
consul_acl_replication_token: ""
consul_dnsmasq: "false"

# CentOS vars
consul_centos_pkg: "consul_{{ consul_version }}_linux_amd64.zip"
consul_centos_url: "{{ consul_zip_url }}"
consul_centos_sha256: "{{ consul_zip_sha256 }}"

consul_centos_os_packages:
- libselinux-python
- git
- unzip

# Debian vars
consul_debian_pkg: "consul_{{ consul_version }}_linux_amd64.zip"
consul_debian_url: "{{ consul_zip_url }}"
consul_debian_sha256: "{{ consul_zip_sha256 }}"

consul_debian_os_packages:
- git
- unzip

# Red Hat vars
consul_redhat_pkg: "consul_{{ consul_version }}_linux_amd64.zip"
consul_redhat_url: "{{ consul_zip_url }}"
consul_redhat_sha256: "{{ consul_zip_sha256 }}"

consul_redhat_os_packages:
- libselinux-python
- git
- unzip

# Ubuntu vars
consul_ubuntu_pkg: "consul_{{ consul_version }}_linux_amd64.zip"
consul_ubuntu_url: "{{ consul_zip_url }}"
consul_ubuntu_sha256: "{{ consul_zip_sha256 }}"

consul_ubuntu_os_packages:
- git
- unzip
3 changes: 0 additions & 3 deletions tasks/CentOS.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
---
# File: tasks/CentOS.yml - CentOS tasks for Consul

- name: "Distribution specific variables"
include_vars: main.yml

- name: OS packages
yum: "name={{ item }} state=present"
with_items: "{{ consul_centos_os_packages }}"
Expand Down
3 changes: 0 additions & 3 deletions tasks/Debian.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
---
# File: tasks/Debian.yml - Debian tasks for Consul

- name: "Distribution specific variables"
include_vars: main.yml

- name: OS packages
apt: "name={{ item }} state=present update_cache=yes"
with_items: "{{ consul_debian_os_packages }}"
Expand Down
3 changes: 0 additions & 3 deletions tasks/RedHat.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
---
# File: tasks/Red Hat.yml - Red Hat tasks for Consul

- name: "Distribution specific variables"
include_vars: main.yml

- name: OS packages
yum: "name={{ item }} state=present"
with_items: "{{ consul_redhat_os_packages }}"
Expand Down
3 changes: 0 additions & 3 deletions tasks/Ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
---
# File: tasks/Ubuntu.yml - Ubuntu tasks for Consul

- name: "Distribution specific variables"
include_vars: main.yml

- name: OS packages
apt: "name={{ item }} state=present update_cache=yes"
with_items: "{{ consul_ubuntu_os_packages }}"
Expand Down
13 changes: 10 additions & 3 deletions tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
---
# File: tasks/main.yml - Main tasks for Consul

- name: Fail if not a new release of Ubuntu
fail:
msg: "{{ ansible_distribution_version }} is not an acceptable version of Ubuntu for this role"
when: ansible_lsb.id|lower == "ubuntu" and ( ansible_distribution_version|version_compare(12.04, '<') or ansible_distribution_version|version_compare(12.10, '=') )

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

- name: Create cluster groupings
group_by: key={{ consul_node_role }}

Expand All @@ -9,9 +19,6 @@
- name: "Add Consul user"
user: name=consul comment="Consul user" uid=1042 group=bin

- name: "Distribution specific variables"
include_vars: main.yml

- name: "CentOS tasks"
include: CentOS.yml
when: ansible_distribution == "CentOS"
Expand Down
40 changes: 0 additions & 40 deletions vars/main.yml

This file was deleted.

2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.2.14
v1.2.15

0 comments on commit ee7ded2

Please sign in to comment.