-
-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
EL6/7 and CentOS 6/7 support for st2 and st2repos #66
Changes from 36 commits
36329a6
8f1e76b
6a4467f
5a1f2e4
c40a809
f6ac495
f87c472
81af829
455c7f4
8877d9d
2c388f3
9f5c41e
df414fe
c3ee82f
3c1fd14
025ed66
82f7072
7998048
6448f3b
6984fae
15ba22e
80032d9
09df69b
1904363
7254866
acce004
0ad201d
da000f6
abb465e
6abec30
07b08bc
709bc97
92f82ee
f5bb4b5
edcb8a2
7fa3a70
9c52c7b
100ca71
9988842
56ed120
3c3f272
d8714bb
e9ed597
13d1d4c
968b9e5
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
galaxy_info: | ||
description: Install EPEL repository | ||
author: mierdin | ||
company: StackStorm | ||
license: Apache | ||
min_ansible_version: 1.9 | ||
platforms: | ||
- name: Ubuntu | ||
versions: | ||
- trusty | ||
- precise | ||
- name: EL | ||
versions: | ||
- 6 | ||
- 7 | ||
categories: | ||
- system |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
--- | ||
- name: Check if EPEL is installed | ||
stat: | ||
path: /etc/yum.repos.d/epel.repo | ||
register: epel_installed | ||
when: ansible_os_family == "RedHat" | ||
|
||
- name: Install EPEL repo | ||
yum: | ||
name: "https://dl.fedoraproject.org/pub/epel/epel-release-latest-{{ ansible_distribution_major_version }}.noarch.rpm" | ||
state: present | ||
when: ansible_os_family == "RedHat" and not epel_installed.stat.exists |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,6 @@ galaxy_info: | |
- 7 | ||
categories: | ||
- system | ||
dependencies: | ||
- role: epel | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should have conditional check: Even despite there is a OS check in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 9988842 |
||
become: yes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Using The good practice is to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ack, fixed in 9988842 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,29 @@ | ||
- name: Install auth pre-reqs | ||
- name: Install auth pre-reqs (Debian) | ||
become: yes | ||
apt: | ||
name: "{{ item }}" | ||
state: present | ||
with_items: | ||
- python-passlib | ||
- apache2-utils | ||
when: ansible_os_family == 'Debian' | ||
|
||
- name: Install epel-release repo (RedHat) | ||
become: yes | ||
yum: | ||
name: epel-release | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will this work on real There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, I will include both EL6 and EL7 in my testing. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So here we install There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in e9ed597 |
||
state: present | ||
when: ansible_os_family == 'RedHat' | ||
|
||
- name: Install auth pre-reqs (RedHat) | ||
become: yes | ||
yum: | ||
name: "{{ item }}" | ||
state: present | ||
with_items: | ||
- python-passlib | ||
- httpd-tools | ||
when: ansible_os_family == 'RedHat' | ||
|
||
- name: Create htpasswd file | ||
become: true | ||
|
@@ -16,7 +34,7 @@ | |
notify: | ||
- restart st2api/st2stream | ||
|
||
- name: Enable autentication | ||
- name: Enable authentication | ||
become: yes | ||
ini_file: | ||
dest: /etc/st2/st2.conf | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
--- | ||
- name: Install latest st2 package | ||
- name: Install libffi-devel on EL6 | ||
become: yes | ||
apt: | ||
package: | ||
name: ftp://fr2.rpmfind.net/linux/centos/6/os/x86_64/Packages/libffi-devel-3.0.5-3.2.el6.x86_64.rpm | ||
state: present | ||
when: ansible_os_family == "RedHat" and ansible_distribution_major_version == "6" | ||
ignore_errors: yes # Ignore error when already installed | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That's a hack, - generally a sign of improvement. There should be a better way. Additionally, I'm not sure if this block is idempotent. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Per https://docs.stackstorm.com/install/rhel6.html#system-requirements did you check if it's possible to enable See There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried that before, got this:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Additionally, this task does run idempotently, now that I've changed to
This should also make the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. +1 |
||
|
||
- name: Install latest st2 package (stable) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Package repository (if you meant that) is controlled via So There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, my intention with changing this was for easier debugging. Since both tasks had the same name, it was hard to tell from the output which one actually ran. This should work better: 3c3f272 |
||
become: yes | ||
package: | ||
name: st2 | ||
state: latest | ||
when: st2_version == "latest" | ||
notify: | ||
- restart st2 | ||
tags: skip_ansible_lint | ||
|
||
- name: Install latest st2 package | ||
- name: Install latest st2 package (not stable) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as https://github.com/StackStorm/ansible-st2/pull/66/files#r97132662
We can write There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 3c3f272 |
||
become: yes | ||
apt: | ||
package: | ||
name: st2={{ st2_version }}-{{ st2_revision }} | ||
state: present | ||
when: st2_version != "latest" | ||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -0,0 +1,23 @@ | ||||
--- | ||||
- name: Install prereqs (Debian) | ||||
become: yes | ||||
apt: | ||||
name: "{{ item }}" | ||||
state: present | ||||
with_items: | ||||
- debian-archive-keyring | ||||
- apt-transport-https | ||||
|
||||
- name: Add keys to keyring | ||||
become: yes | ||||
apt_key: | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be more solid if we check See example with Mongo:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where would I go about finding that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nevermind, added in f6ac495 |
||||
id: 418A7F2FB0E1E6E7EABF6FE8C2E73424D59097AB | ||||
url: https://packagecloud.io/StackStorm/{{ st2_pkg_repo }}/gpgkey | ||||
state: present | ||||
|
||||
- name: Add StackStorm repos | ||||
become: yes | ||||
apt_repository: | ||||
repo: 'deb https://packagecloud.io/StackStorm/{{ st2_pkg_repo }}/{{ ansible_distribution|lower }}/ {{ ansible_distribution_release|lower }} main' | ||||
state: present | ||||
update_cache: yes |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,4 @@ | ||
--- | ||
- name: Install prereqs | ||
become: yes | ||
apt: | ||
name: "{{ item }}" | ||
state: present | ||
with_items: | ||
- debian-archive-keyring | ||
- apt-transport-https | ||
# tasks file for st2repos | ||
|
||
- name: Add keys to keyring | ||
become: yes | ||
apt_key: | ||
url: https://packagecloud.io/StackStorm/{{ st2_pkg_repo }}/gpgkey | ||
state: present | ||
|
||
- name: Add StackStorm repos | ||
become: yes | ||
apt_repository: | ||
repo: 'deb https://packagecloud.io/StackStorm/{{ st2_pkg_repo }}/{{ ansible_distribution|lower }}/ {{ ansible_distribution_release|lower }} main' | ||
state: present | ||
update_cache: yes | ||
- include: "{{ ansible_os_family|lower }}.yml" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
--- | ||
- name: Add ST2 Repo | ||
become: yes | ||
yum_repository: | ||
name: "StackStorm_{{ st2_pkg_repo }}" | ||
description: "StackStorm_{{ st2_pkg_repo }}" | ||
file: "StackStorm_{{ st2_pkg_repo }}" | ||
baseurl: https://packagecloud.io/StackStorm/{{ st2_pkg_repo }}/el/{{ ansible_distribution_major_version }}/$basearch | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So seems this is good enough and doesn't look as hack anymore 👍 I think we can close the #89 now, just add a note that we should always use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yup, cool. Closed #89 |
||
repo_gpgcheck: yes | ||
gpgkey: "https://packagecloud.io/StackStorm/{{ st2_pkg_repo }}/gpgkey" | ||
sslcacert: /etc/pki/tls/certs/ca-bundle.crt | ||
metadata_expire: 300 | ||
gpgcheck: no | ||
enabled: yes | ||
sslverify: yes | ||
|
||
# Fixes "Failure talking to yum: Cannot retrieve repository metadata (repomd.xml) for repository: StackStorm_stable. Please verify its path and try again" when installing st2 | ||
- name: Update ca-certificates package | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since this fixes specific error for PackageCloud repository, maybe it's worth to move it before the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reordered in d8714bb |
||
become: yes | ||
package: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, since this block is part of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in d8714bb |
||
name: ca-certificates | ||
state: latest | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The For For everything else the safe way is to upgrade software on the server by running specific playbook which focuses on OS package upgrades (or patches) to have full control and react accordingly if something went wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just to be clear, for the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just change to
Sorry for my previous TL;DR comment ^^ 😄 Just wanted to give an explanation. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So the problem I had with this specific line (not other places where I made this linting error) was that unless I updated ca-certificates, I'd get this error when
I just checked, and setting this to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense for an exception 👍 This looks like old If that happens on There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I may have a better fix for this, give me a few minutes. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Mierdin It's not clear how 9c52c7b fixes the issue with outdated According to http://stackoverflow.com/questions/26734777/yum-error-cannot-retrieve-metalink-for-repository-epel-please-verify-its-path and http://unix.stackexchange.com/questions/21310/yum-cannot-retrieve-repository-centos-6 2 possible fixes for outdated
How I'd say, - we don't support some outdated RHEL6.5 which was released in So after all, - I'm +1 to remove this block completely :) WDYT? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Okay, per our slack conversation, I reverted back to the old approach and am now updating |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
- postgresql | ||
- nginx | ||
- st2repos | ||
- st2 | ||
- st2mistral | ||
- st2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's keep the original order. We install There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed in 56ed120 |
||
- st2web | ||
- st2smoketests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍