-
-
Notifications
You must be signed in to change notification settings - Fork 77
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
Updating to use deb packages #42
Changes from 29 commits
8f7471d
7b48d88
0539c96
ff53402
843b652
8b873d8
f325d59
9740bd0
18c1b61
8ae7c41
849f233
d3a6496
7968d1e
85e7220
9bdbd30
02ce665
c177e6e
03c058e
1ef38da
a38da96
7bcbada
3122cfc
7a2e906
49c0663
c2b856b
1947b40
afac777
3ba2345
37bd981
6cacd9c
855e019
13598ee
f8ec21c
5994389
c182ee9
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 |
---|---|---|
|
@@ -4,5 +4,8 @@ | |
roles: | ||
- mongodb | ||
- rabbitmq | ||
- st2repos | ||
- mistral | ||
- st2 | ||
- st2web | ||
- st2smoketests |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
mistral_version: 0.13 | ||
mistral_version: 1.3.2-99 | ||
mistral_db_username: mistral | ||
mistral_db_password: StackStorm | ||
mistral_db: mistral |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,67 @@ | ||
- include: gather_facts.yml | ||
- include: install_deps.yml | ||
- include: install_mistral.yml | ||
- include: install_actions.yml | ||
- include: config.yml | ||
- include: sync.yml | ||
- include: install_client.yml | ||
--- | ||
|
||
- name: Install st2mistral | ||
sudo: yes | ||
apt: | ||
name: st2mistral={{ mistral_version }} | ||
state: present | ||
|
||
- name: Configure mistral | ||
sudo: yes | ||
ini_file: | ||
dest: /etc/mistral/mistral.conf | ||
section: database | ||
option: connection | ||
value: postgresql://{{ mistral_db_username }}:{{ mistral_db_password }}@localhost/{{ mistral_db }} | ||
backup: yes | ||
|
||
- name: Deploy database init script | ||
sudo: yes | ||
template: | ||
src: init_mistral_db.SQL.j2 | ||
dest: /etc/mistral/init_mistral_db.SQL | ||
notify: | ||
- restart mistral | ||
|
||
- name: Initiate database | ||
become: yes | ||
become_user: postgres | ||
shell: psql < /etc/mistral/init_mistral_db.SQL | ||
args: | ||
creates: /etc/mistral/init_mistral_db.SQL.ansible.has.run | ||
notify: | ||
- restart mistral | ||
|
||
- name: Make sure "Initiate database" doesn't run twice | ||
sudo: yes | ||
file: | ||
path: /etc/mistral/init_mistral_db.SQL.ansible.has.run | ||
state: touch | ||
|
||
- name: Setup Mistral DB tables, etc | ||
sudo: 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: | ||
- restart mistral | ||
|
||
- name: Make sure "Setup Mistral DB tables, etc" does not run again | ||
sudo: yes | ||
file: | ||
path: /etc/mistral/mistral-db-manage.upgrade.head.ansible.has.run | ||
state: touch | ||
|
||
- name: Register mistral actions | ||
sudo: yes | ||
command: /opt/stackstorm/mistral/bin/mistral-db-manage --config-file /etc/mistral/mistral.conf populate | ||
args: | ||
creates: /etc/mistral/mistral-db-manage.populate.ansible.has.run | ||
notify: | ||
- restart mistral | ||
|
||
- name: Make sure "Register mistral actions" does not run again | ||
sudo: yes | ||
file: | ||
path: /etc/mistral/mistral-db-manage.upgrade.head.ansible.has.run | ||
state: touch |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
CREATE ROLE {{ mistral_db_username }} WITH CREATEDB LOGIN ENCRYPTED PASSWORD {{ mistral_db_password }}; | ||
CREATE DATABASE {{ mistral_db }} OWNER {{ mistral_db_username }}; |
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,4 @@ | |
update_cache: yes | ||
state: present | ||
with_items: | ||
- mongodb | ||
- mongodb-server |
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
- name: restart st2 | ||
sudo: true | ||
service: | ||
name: "{{ item }}" | ||
state: restarted | ||
with_items: st2_services | ||
command: st2ctl restart | ||
|
||
- name: restart st2-api | ||
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. Can we rename it |
||
sudo: true | ||
command: st2ctl restart-component st2api |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,4 +12,5 @@ galaxy_info: | |
- precise | ||
categories: | ||
- system | ||
dependencies: [] | ||
dependencies: | ||
- role: st2repos |
This file was deleted.
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.
1.4.0
is latest mistral stable version from https://packagecloud.io/StackStorm/stable. Let's stick to some revision from that version.On related note, I would prefer to avoid such pinning in default config values. So if version is not explicitly set, playbook installs latest stable by default (with accordance with
st2
version).Anyway, it's something to rethink later. For now it's good enough.
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.
I guess you mean something like what's used here: https://github.com/johandahlberg/ansible-st2/blob/use_deb_packages/roles/st2/tasks/main.yml? If so I can fix it now, shouldn't be to tricky.
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.
Yeah, something like that would be definitely better.