Skip to content

Commit

Permalink
Minor cleanup; now using ansible module for yum config
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Oswalt <[email protected]>
  • Loading branch information
Matt Oswalt committed Jan 4, 2017
1 parent 36329a6 commit 8f1e76b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 25 deletions.
6 changes: 3 additions & 3 deletions roles/st2/tasks/debian.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
- name: Install latest st2 package
- name: Install latest Debian st2 package (stable)
become: yes
apt:
name: st2
Expand All @@ -8,11 +8,11 @@
notify:
- restart st2

- name: Install latest st2 package
- name: Install latest Debian st2 package (not stable)
become: yes
apt:
name: st2={{ st2_version }}-{{ st2_revision }}
state: present
when: st2_version != "stable"
notify:
- restart st2
- restart st2
7 changes: 4 additions & 3 deletions roles/st2/tasks/redhat.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
---
- name: Install latest st2 package
- name: Install latest RHEL st2 package (stable)
become: yes
yum:
name: st2
state: latest
disable_gpg_check: yes
when: st2_version == "stable"
notify:
- restart st2

- name: Install latest st2 package
- name: Install latest RHEL st2 package (not stable)
become: yes
yum:
name: st2={{ st2_version }}-{{ st2_revision }}
state: present
when: st2_version != "stable"
notify:
- restart st2
- restart st2
2 changes: 1 addition & 1 deletion roles/st2repos/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
when: ansible_os_family == 'Debian'

- include: redhat.yml
when: ansible_os_family == 'RedHat'
when: ansible_os_family == 'RedHat'
29 changes: 11 additions & 18 deletions roles/st2repos/tasks/redhat.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
---
# Tasks based on https://packagecloud.io/install/repositories/StackStorm/stable/script.rpm.sh

- name: Retrieve configuration
get_url:
url: "https://packagecloud.io/install/repositories/StackStorm/stable/config_file.repo?os={{ ansible_distribution }}&dist={{ ansible_distribution_version }}&source=script"
dest: /tmp/yum_config
mode: 0440

- name: Load config file
shell: cat /tmp/yum_config
register: yum_config
- name: Install RPM key for StackStorm
become: yes
rpm_key:
state: present
key: https://packagecloud.io/StackStorm/stable/gpgkey

- name: Update YUM configuration
- name: Add ST2 Repo
become: yes
blockinfile:
dest: /etc/yum.repos.d/StackStorm_stable.repo
create: yes
marker: "### ANSIBLE MANAGED BLOCK ###"
content: |
{{ yum_config.stdout }}
yum_repository:
name: stackstorm
description: Stackstorm Repo
file: st2
baseurl: https://packagecloud.io/StackStorm/stable/el/$releasever/$basearch

0 comments on commit 8f1e76b

Please sign in to comment.