-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
Rhel support for mistral and create postgresql role (remove AXNS.postgresql dependency) #78
Changes from 10 commits
0a2bca9
143915c
b1fd33d
60861dc
3b42b08
8df8570
b7d92f7
e23443e
83be2c5
2a44c37
c76230d
8576179
127ca77
cddfc9a
eb24c61
697e31d
1426c6d
2d18979
d6144fd
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 |
---|---|---|
|
@@ -10,7 +10,7 @@ Aka IFTTT orchestration for Ops. | |
|
||
## Supported platforms | ||
* Ubuntu Trusty (14.04) | ||
* Ubuntu Xenial (16.04) | ||
* Ubuntu Xenial (16.04) | ||
|
||
> If you're using the provided Vagrantfile, note that it uses Xenial by default. Due to some of the changes there, Vagrant 1.9.1 or better is required. | ||
|
||
|
@@ -26,8 +26,6 @@ ansible-playbook stackstorm.yml | |
``` | ||
|
||
## Dependencies | ||
Ansible Galaxy roles used by StackStorm installation: | ||
* [ANXS.postgresql](https://galaxy.ansible.com/list#/roles/512) - PostgreSQL, needed by Mistral | ||
|
||
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. Please also remove another |
||
## Variables | ||
Below is the list of variables you can redefine in your playbook to customize st2 deployment: | ||
|
@@ -52,15 +50,15 @@ ansible-playbook stackstorm.yml -i 'localhost,' --connection=local | |
``` | ||
|
||
> Note that keeping `stable` version is useful to update StackStorm by re-running playbook, since it will reinstall st2 if there is new version available. | ||
This is default behavior. If you don't want updates - consider pinning version-revision numbers. | ||
This is default behavior. If you don't want updates - consider pinning version-revision numbers. | ||
|
||
Install specific numeric version of st2 with pinned revision number as well: | ||
```sh | ||
ansible-playbook stackstorm.yml --extra-vars='st2_version=1.4.0 st2_revision=8' | ||
``` | ||
|
||
## Other Installers | ||
You might be interested in other methods to deploy StackStorm engine: | ||
You might be interested in other methods to deploy StackStorm engine: | ||
* Configuration Management | ||
* [Chef Cookbook](https://github.com/StackStorm/chef-stackstorm/) | ||
* [Puppet Module](https://github.com/stackstorm/puppet-st2) | ||
|
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
--- | ||
|
||
- name: Install latest st2mistral | ||
become: yes | ||
apt: | ||
package: | ||
name: st2mistral | ||
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. Not sure if we should keep it 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, it's good. |
||
when: mistral_version == "stable" | ||
tags: mistral | ||
|
||
- name: Install latest st2mistral | ||
become: yes | ||
apt: | ||
package: | ||
name: st2mistral={{ mistral_version }} | ||
state: present | ||
when: mistral_version != "stable" | ||
tags: mistral | ||
|
||
- name: Configure mistral | ||
become: yes | ||
|
@@ -22,45 +23,51 @@ | |
option: connection | ||
value: postgresql://{{ mistral_db_username }}:{{ mistral_db_password }}@localhost/{{ mistral_db }} | ||
backup: yes | ||
tags: mistral | ||
|
||
- name: Deploy database init script | ||
become: yes | ||
template: | ||
src: init_mistral_db.SQL.j2 | ||
dest: /etc/mistral/init_mistral_db.SQL | ||
notify: | ||
dest: /etc/mistral/init_mistral_db.SQL | ||
notify: | ||
- restart mistral | ||
tags: mistral | ||
|
||
- name: Initiate database | ||
vars: | ||
ansible_ssh_pipelining: true | ||
become: yes | ||
become_user: postgres | ||
shell: psql < /etc/mistral/init_mistral_db.SQL | ||
args: | ||
args: | ||
creates: /etc/mistral/init_mistral_db.SQL.ansible.has.run | ||
notify: | ||
- restart mistral | ||
tags: mistral | ||
|
||
- name: Make sure "Initiate database" doesn't run twice | ||
become: yes | ||
file: | ||
path: /etc/mistral/init_mistral_db.SQL.ansible.has.run | ||
state: touch | ||
tags: mistral | ||
|
||
- name: Setup Mistral DB tables, etc | ||
become: yes | ||
command: /opt/stackstorm/mistral/bin/mistral-db-manage --config-file /etc/mistral/mistral.conf upgrade head | ||
args: | ||
creates: /etc/mistral/mistral-db-manage.upgrade.head.ansible.has.run | ||
notify: | ||
notify: | ||
- restart mistral | ||
tags: mistral | ||
|
||
- name: Make sure "Setup Mistral DB tables, etc" does not run again | ||
become: yes | ||
file: | ||
path: /etc/mistral/mistral-db-manage.upgrade.head.ansible.has.run | ||
state: touch | ||
tags: mistral | ||
|
||
- name: Register mistral actions | ||
become: yes | ||
|
@@ -69,9 +76,11 @@ | |
creates: /etc/mistral/mistral-db-manage.populate.ansible.has.run | ||
notify: | ||
- restart mistral | ||
tags: mistral | ||
|
||
- name: Make sure "Register mistral actions" does not run again | ||
become: yes | ||
file: | ||
path: /etc/mistral/mistral-db-manage.upgrade.head.ansible.has.run | ||
state: touch | ||
tags: mistral |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
CREATE ROLE {{ mistral_db_username }} WITH CREATEDB LOGIN ENCRYPTED PASSWORD {{ mistral_db_password }}; | ||
CREATE ROLE {{ mistral_db_username }} WITH CREATEDB LOGIN ENCRYPTED PASSWORD '{{ mistral_db_password }}'; | ||
CREATE DATABASE {{ mistral_db }} OWNER {{ mistral_db_username }}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--- | ||
galaxy_info: | ||
description: Install PostgreSQL | ||
author: humblearner | ||
company: StackStorm | ||
license: Apache | ||
min_ansible_version: 2.2 | ||
tags: [db, postgresql] | ||
platforms: | ||
- name: Ubuntu | ||
versions: | ||
- trusty | ||
- xenial | ||
- name: EL | ||
- 6 | ||
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.
|
||
- 7 | ||
categories: | ||
- system |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
- name: Install postgres on {{ ansible_distribution }}-{{ ansible_distribution_major_version }} | ||
include: roles/postgresql/tasks/postgresql_{{ ansible_pkg_mgr }}{{ ansible_distribution_major_version }}.yml | ||
tags: [db, postgresql] | ||
when: ansible_os_family == "RedHat" | ||
|
||
- name: Install postgres on {{ ansible_distribution }}-{{ ansible_distribution_major_version }} | ||
include: roles/postgresql/tasks/postgresql_{{ ansible_pkg_mgr }}.yml | ||
tags: [db, postgresql] | ||
when: ansible_os_family == "Debian" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
- name: apt | Initialize postgresql | ||
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. Probably |
||
become: yes | ||
apt: | ||
name: postgresql | ||
state: installed | ||
tags: [db, postgresql] | ||
|
||
- name: apt | Start and Enable Postgresql | ||
become: yes | ||
service: | ||
name: postgresql | ||
state: started | ||
tags: [db, postgresql] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
- name: yum | Get pgdg-centos94-9.4-2 for {{ ansible_distribution }} | ||
become: yes | ||
yum: | ||
name: http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-centos94-9.4-2.noarch.rpm | ||
state: installed | ||
update_cache: yes | ||
when: ansible_distribution == "CentOS" | ||
tags: [db, postgresql] | ||
|
||
- name: yum | Get pgdg-centos94-9.4-2 for {{ ansible_distribution }} | ||
become: yes | ||
yum: | ||
name: http://yum.postgresql.org/9.4/redhat/rhel-6-x86_64/pgdg-redhat94-9.4-2.noarch.rpm | ||
state: installed | ||
update_cache: yes | ||
when: ansible_distribution == "RedHat" | ||
tags: [db, postgresql] | ||
|
||
- name: yum | Install postgresql94 | ||
become: yes | ||
yum: | ||
name: "{{ item }}" | ||
state: installed | ||
update_cache: yes | ||
with_items: | ||
- postgresql94-server | ||
- postgresql94-contrib | ||
- postgresql94-devel | ||
tags: [db, postgresql] | ||
|
||
- name: yum | Initialize Postgresql-9.4 | ||
become: yes | ||
command: service postgresql-9.4 initdb | ||
tags: [db, postgresql] | ||
|
||
- name: yum | MD5-encrypted password for postgresql 1 | ||
become: yes | ||
command: 'sed -i "s/\(host.*all.*all.*127.0.0.1\/32.*\)ident/\1md5/" /var/lib/pgsql/9.4/data/pg_hba.conf' | ||
tags: [db, postgresql] | ||
|
||
- name: yum | MD5-encrypted password for postgresql 2 | ||
become: yes | ||
command: 'sed -i "s/\(host.*all.*all.*::1\/128.*\)ident/\1md5/" /var/lib/pgsql/9.4/data/pg_hba.conf' | ||
tags: [db, postgresql] | ||
|
||
- name: yum | Start and Enable Postgresql-9.4 | ||
become: yes | ||
service: | ||
name: postgresql-9.4 | ||
state: started | ||
tags: [db, postgresql] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
- name: yum | Initialize postgresql | ||
become: yes | ||
yum: | ||
name: "{{ item }}" | ||
state: installed | ||
update_cache: yes | ||
with_items: | ||
- postgresql-server | ||
- postgresql-contrib | ||
- postgresql-devel | ||
tags: [db, postgresql] | ||
|
||
- name: yum | Initialize Postgresql | ||
become: yes | ||
command: postgresql-setup initdb | ||
tags: [db, postgresql] | ||
|
||
- name: yum | MD5-encrypted password for postgres 1 | ||
become: yes | ||
command: 'sed -i "s/\(host.*all.*all.*127.0.0.1\/32.*\)ident/\1md5/" /var/lib/pgsql/data/pg_hba.conf' | ||
tags: [db, postgresql] | ||
|
||
- name: yum | MD5-encrypted password for postgres 2 | ||
become: yes | ||
command: 'sed -i "s/\(host.*all.*all.*::1\/128.*\)ident/\1md5/" /var/lib/pgsql/data/pg_hba.conf' | ||
tags: [db, postgresql] | ||
|
||
- name: yum | Start and Enable Postgresql | ||
become: yes | ||
service: | ||
name: postgresql | ||
state: started | ||
tags: [db, postgresql] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ | |
- mongodb | ||
- rabbitmq | ||
- st2repos | ||
- postgresql | ||
- mistral | ||
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. Please don't forget to rename So we'll use the following roles responsible for StackStorm:
for consistency. |
||
- st2 | ||
- st2web | ||
|
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.
This line could be removed as well, take a look at resulting
README.md
.