Skip to content

Commit

Permalink
Set up alternatives for redis binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidWittman committed May 15, 2017
1 parent 882d728 commit a64644d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .kitchen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ platforms:
- name: ubuntu-14.04
- name: centos-6.7
driver_config:
box: wittman/centos-6.7-ansible
- name: centos-7.2
box: wittman/centos-6.8-ansible
- name: centos-7.3
driver_config:
box: wittman/centos-7.2-ansible
box: wittman/centos-7.3-ansible
- name: ubuntu-16.04

suites:
Expand Down
12 changes: 12 additions & 0 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,3 +51,15 @@
args:
chdir: /usr/local/src/redis-{{ redis_version }}
creates: "{{ redis_install_dir }}/bin/redis-server"

- name: list redis binaries to add to alternatives
command: ls -1 {{ redis_install_dir }}/bin
register: redis_binaries
changed_when: false

- name: add redis binaries to alternatives
alternatives:
name: "{{ item }}"
path: "{{ redis_install_dir }}/bin/{{ item }}"
link: "/usr/bin/{{ item }}"
with_items: "{{ redis_binaries.stdout_lines }}"
8 changes: 8 additions & 0 deletions test/integration/default/serverspec/redis_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,12 @@
it { should be_file }
it { should contain '1' }
end

describe file('/usr/bin/redis-server') do
it { should be_symlink }
end

describe file('/usr/bin/redis-cli') do
it { should be_symlink }
end
end

0 comments on commit a64644d

Please sign in to comment.