Skip to content

Commit 329660b

Browse files
authored
Merge pull request #261 from amanda11/master
Ansible-playbooks to install on Centos8
2 parents 9710898 + c379542 commit 329660b

File tree

49 files changed

+193
-21
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+193
-21
lines changed

.kitchen-docker/centos8/Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM stackstorm/packagingtest:centos8-systemd
2+
3+
RUN mkdir -p /var/run/sshd
4+
RUN useradd -d /home/<%= @username %> -m -s /bin/bash <%= @username %>
5+
RUN echo <%= "#{@username}:#{@password}" %> | chpasswd
6+
RUN echo '<%= @username %> ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
7+
RUN mkdir -p /home/<%= @username %>/.ssh
8+
RUN chown -R <%= @username %> /home/<%= @username %>/.ssh
9+
RUN chmod 0700 /home/<%= @username %>/.ssh
10+
RUN touch /home/<%= @username %>/.ssh/authorized_keys
11+
RUN chown <%= @username %> /home/<%= @username %>/.ssh/authorized_keys
12+
RUN chmod 0600 /home/<%= @username %>/.ssh/authorized_keys
13+
RUN echo '<%= IO.read(@public_key).strip %>' >> /home/<%= @username %>/.ssh/authorized_keys

.kitchen.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ platforms:
5252
run_command: /sbin/init
5353
volume:
5454
- /sys/fs/cgroup:/sys/fs/cgroup:ro
55+
# CentOS8 with Systemd
56+
- name: centos-8
57+
driver_config:
58+
platform: centos
59+
dockerfile: .kitchen-docker/centos8/Dockerfile
60+
run_command: /sbin/init
61+
volume:
62+
- /sys/fs/cgroup:/sys/fs/cgroup:ro
5563

5664
suites:
5765
- name: default

.travis.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@ env:
1313
- DISTRO=ubuntu-16 LICENSE='BWC_LICENSE_ENTERPRISE'
1414
- DISTRO=centos-6 LICENSE='BWC_LICENSE_ENTERPRISE'
1515
- DISTRO=centos-7 LICENSE='BWC_LICENSE_ENTERPRISE'
16+
- DISTRO=centos-8 LICENSE='BWC_LICENSE_ENTERPRISE'
1617

1718
# StackStorm 'unstable' repo check
1819
- DISTRO=ubuntu-14 ST2_REPO=unstable EWC_REPO=enterprise-unstable LICENSE='BWC_LICENSE_ENTERPRISE_UNSTABLE'
1920
- DISTRO=ubuntu-16 ST2_REPO=unstable EWC_REPO=enterprise-unstable LICENSE='BWC_LICENSE_ENTERPRISE_UNSTABLE'
2021
- DISTRO=centos-6 ST2_REPO=unstable EWC_REPO=enterprise-unstable LICENSE='BWC_LICENSE_ENTERPRISE_UNSTABLE'
2122
- DISTRO=centos-7 ST2_REPO=unstable EWC_REPO=enterprise-unstable LICENSE='BWC_LICENSE_ENTERPRISE_UNSTABLE'
23+
- DISTRO=centos-8 ST2_REPO=unstable EWC_REPO=enterprise-unstable LICENSE='BWC_LICENSE_ENTERPRISE_UNSTABLE'
2224

2325
before_script:
2426
# Personal token for forked PRs

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ Aka IFTTT orchestration for Ops.
1313
* Ubuntu Xenial (16.04)
1414
* RHEL6 / CentOS6
1515
* RHEL7 / CentOS7
16+
* RHEL8 / CentOS8
1617

1718
> If you're using the provided Vagrantfile, note that it uses Xenial by default.
1819
20+
> In order to access StackStorm Web UI, please don't forget to ensure that http/https ports are opened in your firewall system.
21+
1922
## Requirements
2023
At least 2GB of memory and 3.5GB of disk space is required, since StackStorm is shipped with RabbitMQ, PostgreSQL, Mongo, nginx and OpenStack Mistral.
2124

@@ -102,8 +105,10 @@ These are the platforms we must support (must pass end-to-end testing):
102105
- Trusty
103106
- CentOS6
104107
- CentOS7
108+
- CentOS8
105109
- RHEL6 (via AWS)
106110
- RHEL7 (via AWS)
111+
- RHEL8 (via AWS)
107112

108113
Must also support Ansible Idempotence (Eg. Ansible-playbook re-run should end with the following results: `changed=0.*failed=0`)
109114

@@ -117,6 +122,7 @@ Other distros:
117122
vagrant up ubuntu14
118123
vagrant up centos6
119124
vagrant up centos7
125+
vagrant up centos8
120126
```
121127

122128
## Other Installers
@@ -127,6 +133,7 @@ You might be interested in other methods to deploy StackStorm engine:
127133

128134
* Manual Instructions
129135
* [Ubuntu 14.04/16.04](https://docs.stackstorm.com/install/deb.html)
136+
* [RHEL8/CentOS8](https://docs.stackstorm.com/install/rhel8.html)
130137
* [RHEL7/CentOS7](https://docs.stackstorm.com/install/rhel7.html)
131138
* [RHEL6/CentOS6](https://docs.stackstorm.com/install/rhel6.html)
132139

Vagrantfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ VIRTUAL_MACHINES = {
1818
:hostname => 'ansible-st2-centos7',
1919
:box => 'centos/7',
2020
},
21+
:centos8 => {
22+
:hostname => 'ansible-st2-centos8',
23+
:box => 'centos/8',
24+
},
2125
}
2226

2327
Vagrant.require_version ">= 1.9.1"

meta/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ galaxy_info:
2222
versions:
2323
- 6
2424
- 7
25+
- 8
2526
categories:
2627
- system
2728
- ops

roles/StackStorm.epel/meta/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ galaxy_info:
1010
versions:
1111
- 6
1212
- 7
13+
- 8
1314
galaxy_tags:
1415
- system

roles/StackStorm.ewc/meta/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ galaxy_info:
1414
versions:
1515
- 6
1616
- 7
17+
- 8
1718
galaxy_tags:
1819
- system
1920
- stackstorm

roles/StackStorm.ewc/tasks/ewc_repos_setup.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@
5757
- ewc
5858
- enterprise
5959

60-
- name: Add EWC enterprise repos on {{ ansible_facts.distribution }}
61-
include_tasks: ewc_repos_{{ ansible_facts.pkg_mgr }}.yml
60+
- name: Add EWC enterprise repos on {{ ansible_os_family | lower }}
61+
include_tasks: ewc_repos_{{ ansible_os_family | lower }}.yml
6262
tags:
6363
- ewc
6464
- enterprise

roles/StackStorm.ewc/tasks/license.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
- enterprise
5858

5959
- name: "Cleanup repo list file from disk"
60-
include_tasks: "ewc_repos_cleanup_{{ ansible_facts.pkg_mgr }}.yml"
60+
include_tasks: "ewc_repos_cleanup_{{ ansible_os_family | lower }}.yml"
6161
when: ewc_license | hash("sha512") != ewc_license_hash
6262
tags:
6363
- ewc

roles/StackStorm.ewc/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
- name: Install pinned bwc-enterprise package
4949
become: yes
5050
package:
51-
name: bwc-enterprise{{ '-' if ansible_facts.pkg_mgr == 'yum' else '=' }}{{ ewc_version }}-{{ ewc_revision }}
51+
name: bwc-enterprise{{ '-' if ansible_os_family == 'RedHat' else '=' }}{{ ewc_version }}-{{ ewc_revision }}
5252
state: present
5353
register: ewc_installed
5454
retries: 5

roles/StackStorm.ewc_smoketests/meta/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ galaxy_info:
1414
versions:
1515
- 6
1616
- 7
17+
- 8
1718
galaxy_tags:
1819
- stackstorm
1920
- bwc
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
---
2-
# MongoDB version to install
2+
# MongoDB3 version to install
33
# Should be '3.2' or '3.4'
44
mongodb_version: "3.4"
5+
# MongoDB4 version to install on RH 8
6+
mongodb4_version: "4.0"

roles/StackStorm.mongodb/meta/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ galaxy_info:
1414
versions:
1515
- 6
1616
- 7
17+
- 8
1718
galaxy_tags:
1819
- system
1920
dependencies:

roles/StackStorm.mongodb/tasks/main.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
---
2+
- name: Retrieve variables
3+
include_vars: "{{ item }}"
4+
with_first_found:
5+
- "{{ ansible_os_family | lower }}_{{ ansible_distribution_major_version }}.yml"
6+
- "{{ ansible_os_family | lower }}.yml"
7+
tags: [databases, mongodb]
8+
29
- name: Install mongodb on {{ ansible_facts.distribution }}
3-
include_tasks: mongodb_{{ ansible_facts.pkg_mgr }}.yml
10+
include_tasks: mongodb_{{ ansible_os_family | lower }}.yml
411
tags: [databases, mongodb]
512

613
- name: Start & Enable mongodb

roles/StackStorm.mongodb/tasks/mongodb_yum.yml renamed to roles/StackStorm.mongodb/tasks/mongodb_redhat.yml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,16 @@
22
- name: yum | Install mongodb dependencies
33
become: yes
44
yum:
5-
name:
5+
name: "{{ mongo_dependencies }}"
66
# Failed to validate the SSL certificate for www.mongodb.org:443. Make sure your managed systems have a valid CA certificate installed. If the website serving the url uses SNI you need python >= 2.7.9 on your managed machine or you can install the `urllib3`, `pyopenssl`, `ndg-httpsclient`, and `pyasn1` python modules to perform SNI verification in python >= 2.6. You can use validate_certs=False if you do not need to confirm the servers identity but this is unsafe and not recommended. Paths checked for this platform: /etc/ssl/certs, /etc/pki/ca-trust/extracted/pem, /etc/pki/tls/certs, /usr/share/ca-certificates/cacert.org, /etc/ansible
7-
- python-urllib3
8-
- pyOpenSSL
9-
- python-pyasn1
10-
- python-ndg_httpsclient
117
state: present
128
register: _task
139
retries: 5
1410
delay: 3
1511
until: _task is succeeded
1612
tags: [databases, mongodb]
1713

18-
- name: yum | Add mongodb key
14+
- name: yum | Add mongodb key {{ mongodb_major_minor_version }}
1915
become: yes
2016
rpm_key:
2117
key: https://www.mongodb.org/static/pgp/server-{{ mongodb_major_minor_version }}.asc
@@ -41,7 +37,7 @@
4137
- name: yum | Install mongodb
4238
become: yes
4339
yum:
44-
name: mongodb-org-{{ mongodb_version }}*
40+
name: mongodb-org-{{ mongodb_use_version }}*
4541
state: present
4642
# TODO: Allow yum downgrade since Ansible 2.4
4743
# https://github.com/ansible/ansible/pull/21516
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
mongo_dependencies:
2+
- python-urllib3
3+
- pyOpenSSL
4+
- python-pyasn1
5+
- python-ndg_httpsclient
6+
# For RH < 8 use mongodb_version
7+
mongodb_use_version: "{{ (mongodb_version|string)[:3] }}"
8+
# Extract mongodb "major.minor" version
9+
mongodb_major_minor_version: "{{ (mongodb_use_version|string)[:3] }}"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
mongo_dependencies:
2+
- python3-urllib3
3+
- python3-pyOpenSSL
4+
- python3-pyasn1
5+
# We cannot have conditional defaults. The default for mongodb_version is 3, but
6+
# for RH 8 we want to use version 4 at least. So if mongodb_version is 3 use the
7+
# default mongodb4_version
8+
mongodb_use_version: "{{ (mongodb4_version|string)[:3] if ( mongodb_version|string)[:1] == '3' else (mongodb_version|string)[:3] }}"
9+
# Extract mongodb "major.minor" version
10+
mongodb_major_minor_version: "{{ (mongodb_use_version|string)[:3] }}"

roles/StackStorm.nginx/meta/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ galaxy_info:
1515
versions:
1616
- 6
1717
- 7
18+
- 8
1819
galaxy_tags:
1920
- web
2021
- nginx

roles/StackStorm.nginx/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
- name: Install nginx on {{ ansible_facts.distribution }}
3-
include_tasks: nginx_{{ ansible_facts.pkg_mgr }}.yml
3+
include_tasks: nginx_{{ ansible_os_family | lower }}.yml
44
tags: nginx
55

66
- name: Create common virtual host folders

roles/StackStorm.nginx/tasks/nginx_yum.yml renamed to roles/StackStorm.nginx/tasks/nginx_redhat.yml

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
11
---
2+
- name: Install vars
3+
include_vars: "{{ item }}"
4+
with_first_found:
5+
- "{{ ansible_os_family | lower }}_{{ ansible_distribution_major_version }}.yml"
6+
- "{{ ansible_os_family | lower }}.yml"
7+
28
- name: Add nginx key
39
become: yes
410
rpm_key:
@@ -40,10 +46,31 @@
4046
state: absent
4147
tags: nginx
4248

49+
- name: Comment out server line
50+
become: yes
51+
replace:
52+
path: /etc/nginx/nginx.conf
53+
backup: yes
54+
regexp: '^(?![#])(.*server\s*{)'
55+
replace: '#\1'
56+
tags: nginx
57+
when: (ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_major_version == '8')
58+
59+
- name: Comment out after server block
60+
become: yes
61+
replace:
62+
path: /etc/nginx/nginx.conf
63+
backup: yes
64+
after: '\s*server\s*{'
65+
regexp: '^(?![#}])(.+)$'
66+
replace: '#\1'
67+
tags: nginx
68+
when: (ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_major_version == '8')
69+
4370
- name: Install dependencies for SELinux Ansible module
4471
become: yes
4572
yum:
46-
name: libsemanage-python, libselinux-python
73+
name: "{{ selinux_dependencies }}"
4774
state: present
4875
register: nginx_selinux_dependencies
4976
retries: 5
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
selinux_dependencies:
2+
- libsemanage-python
3+
- libselinux-python
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
selinux_dependencies:
2+
- python3-libsemanage
3+
- python3-libselinux

roles/StackStorm.nodejs/meta/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@ galaxy_info:
1515
versions:
1616
- 6
1717
- 7
18+
- 8
1819
galaxy_tags:
1920
- system
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
---
22
- name: Install nodejs on {{ ansible_facts.distribution }}
3-
include_tasks: nodejs_{{ ansible_facts.pkg_mgr }}.yml
3+
include_tasks: nodejs_{{ ansible_os_family | lower }}.yml
44
tags: nodejs

roles/StackStorm.nodejs/tasks/nodejs_yum.yml renamed to roles/StackStorm.nodejs/tasks/nodejs_redhat.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,28 @@
1919
register: nodesource_repo_rm
2020
tags: nodejs
2121

22+
- name: Determine if nodejs disabled on AppStream for EL8
23+
become: yes
24+
shell:
25+
cmd: yum module list nodejs --disabled
26+
changed_when: False
27+
ignore_errors: True
28+
args:
29+
warn: False
30+
register: nodejs_disabled
31+
when: ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_major_version == '8'
32+
tags: [nodejs, skip_ansible_lint]
33+
34+
- name: Disable AppStream repository due to installation conflicts for EL8
35+
become: yes
36+
shell:
37+
cmd: yum module disable -y nodejs
38+
args:
39+
warn: False
40+
when: ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_major_version == '8' and "AppStream" not in nodejs_disabled.stdout
41+
# Disable warning as yum doesn't support disable module
42+
tags: [nodejs, skip_ansible_lint]
43+
2244
- name: Add nodesource repo file
2345
become: yes
2446
# This is based on the nodesource repo rpm (both 4.x and 10.x for EL6/7/8),

roles/StackStorm.rabbitmq/meta/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ galaxy_info:
1414
versions:
1515
- 6
1616
- 7
17+
- 8
1718
galaxy_tags:
1819
- system

roles/StackStorm.rabbitmq/tasks/main.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,34 @@
11
---
2+
- name: RabbitMQ on RHEL8 requires module(perl:5.26)
3+
become: yes
4+
shell:
5+
cmd: yum -y module enable perl:5.26
6+
args:
7+
warn: False
8+
when: rabbitmq_on_el8
9+
register: perl_result
10+
changed_when:
11+
- '"Nothing to do" not in perl_result.stdout'
12+
# Disable warning as yum doesn't support enable module
13+
tags: [rabbitmq, skip_ansible_lint]
14+
15+
- name: Install rabbit from packagecloud for RH 8
16+
become: yes
17+
no_log: yes
18+
yum_repository:
19+
name: rabbitmq-server
20+
description: rabbitmq-server
21+
baseurl: https://packagecloud.io/rabbitmq/rabbitmq-server/el/{{ ansible_facts.distribution_major_version }}/$basearch
22+
repo_gpgcheck: yes
23+
gpgkey: "https://packagecloud.io/rabbitmq/rabbitmq-server/gpgkey"
24+
sslcacert: /etc/pki/tls/certs/ca-bundle.crt
25+
metadata_expire: 300
26+
gpgcheck: no
27+
enabled: yes
28+
sslverify: yes
29+
when: rabbitmq_on_el8
30+
tags: rabbitmq
31+
232
- name: Install rabbitmq package on {{ ansible_facts.distribution }}
333
become: yes
434
package:
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
---
22
rabbitmq_el6_prefix: "/usr/lib/rabbitmq/"
33
rabbitmq_on_el6: "{{ (ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_major_version == '6') }}"
4+
rabbitmq_on_el8: "{{ (ansible_facts.os_family == 'RedHat' and ansible_facts.distribution_major_version == '8') }}"

0 commit comments

Comments
 (0)